Setting Up a Kubernetes Cluster on AKS - nareshkumarthota/rootrepo GitHub Wiki
Azure Kubernetes Services (AKS) manages the Kubernetes environment and provides options to quickly deploy Kubernetes cluster.
-
To enable a Kubernetes cluster to interact with other Azure resource, an Azure Active Directory service principal is required.
-
Create a service principal by using the
az ad sp create-for-rbac
command.az ad sp create-for-rbac --skip-assignment
The output of the command provides the
appId
which is the service principal andpassword
which is theclient-secret
for creating the Kubernetes cluster. -
Create the Kubernetes cluster with repository group and service principal created earlier.
az aks create --orchestrator-type=kubernetes --resource-group <resource_group_name> --name=<cluster_name> --service-principal <service_principal> --client-secret <client_secret> --node-count <node_count> --generate-ssh-keys
Microsoft Azure creates a storage account when a Kubernetes cluster is created.
For more information about commands, see Microsoft Azure CLI documentation.
-
-
To connect to Kubernetes cluster from your local computer, use
kubectl
, the Kubernetes CLI. If you use the Azure Cloud Shell,kubectl
is already installed. You can also install it locally by using theaz aks install-cli
command.az aks install-cli
-
Configure
kubectl
to connect your Kubernetes cluster by using theaz aks get-credentials
command.az aks kubernetes get-credentials --resource-group <resource_group_name> --name=<cluster_name>
-
Verify the connection to your Kubernetes cluster by using the
kubectl get nodes
command.kubectl get nodes
Next Topic Setting Up an Azure Container Registry.