This terraform code deploys a minimal AKS cluster.
You will need the following installed:
Run az login
to authenticate with your Azure Account.
Update the defaults in ./variables.tf
.
terraform apply
[!IMPORTANT]
You can run terraform plan
first to see what all resources will be deployed.
After terraform apply
is done running, you will get the following output:
Apply complete! Resources: 8 added, 0 changed, 0 destroyed.
Outputs:
client_certificate = <sensitive>
client_key = <sensitive>
cluster_ca_certificate = <sensitive>
cluster_password = <sensitive>
cluster_username = <sensitive>
host = <sensitive>
key_data = <sensitive>
kube_config = <sensitive>
kubernetes_cluster_name = "cluster-upright-tapir"
resource_group_name = "rg-upright-tapir"
Make a note of the kubernetes_cluster_name
az aks get-credentials --resource-group learning-aks-rg --name <kubernetes_cluster_name>
The above command will save the file in default .kube\config
directory, to get kubeconfig
file in the specific location use the following:
az aks get-credentials --resource-group learning-aks-rg --name <kubernetes_cluster_name> --file <specific_location>
kubectl apply -f app.yaml
You can check what pods are running in your cluster:
kubectl get pods
To get the external IP for your load-balancer, you can:
kubectl get service aks-sample-linux-service
- GitHub - Rishab Kumar
- Twitter - Rishab Kumar