Skip to content

Deploying Azure

Aaron-Pierce edited this page Apr 22, 2023 · 4 revisions

Deploying

To deploy for Azure, you must:

  1. Have the Azure CLI installed, and be logged in (run az login)
  2. Create an active directory service principal account by running az ad sp create-for-rbac --skip-assignment
  3. Create a terraform.tfvars with the appId and password which that command outputs:
    appId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    password = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    
  4. Run terraform init before running terraform apply for the first time
  5. Run terraform apply

After, you can run az aks get-credentials --resource-group $(terraform output -raw resource_group_name) --name $(terraform output -raw kubernetes_cluster_name) to automatically configure kubectl


After Deploying

Tearing Down

No extra steps are needed for Azure, simply run terraform destroy

Common Issues

To resolve cluster connectivity issues (similar to Error: Kubernetes cluster unreachable: ... try setting KUBERNETES_MASTER environment variable), you may need to run export KUBE_CONFIG_PATH=~/.kube/config. Be sure that you have configured kubectl with az aks get-credentials --resource-group $(terraform output -raw resource_group_name) --name $(terraform output -raw kubernetes_cluster_name) as well.

Clone this wiki locally