Skip to content

Latest commit

 

History

History
 
 

kubernetes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Azure Kubernetes Service (AKS)

Set up Terraform access to Azure

Follow the guide at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure

az login
az account list --query "[].{name:name, subscriptionId:id, tenantId:tenantId}"
az account set --subscription="${SUBSCRIPTION_ID}"
az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/${SUBSCRIPTION_ID}"

Configure Terraform environment variables

export ARM_SUBSCRIPTION_ID=your_subscription_id
export ARM_CLIENT_ID=your_appId
export ARM_CLIENT_SECRET=your_password
export ARM_TENANT_ID=your_tenant_id

# Not needed for public, required for usgovernment, german, china
export ARM_ENVIRONMENT=public

Additional environment variables for the this project

export TF_VAR_client_id=${ARM_CLIENT_ID}
export TF_VAR_client_secret=${ARM_CLIENT_SECRET}
export TF_VAR_admin_username=<youradminsuername>
export TF_VAR_admin_password=<youradmionpassword>

Enable AKS preview features

az extension add --name aks-preview
az feature  register --name WindowsPreview --namespace Microsoft.ContainerService
az feature  register --name MultiAgentpoolPreview --namespace Microsoft.ContainerService
az provider register --name Microsoft.ContainerService

Run Terraform

terraform init
terraform apply

Stop and destroy

terrafrom destroy