https://github.com/will8ug/learn-terraform-aks
https://github.com/will8ug/learn-terraform-aks
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/will8ug/learn-terraform-aks
- Owner: will8ug
- Created: 2024-01-18T09:52:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-11T13:30:05.000Z (almost 2 years ago)
- Last Synced: 2025-07-31T04:41:47.306Z (11 months ago)
- Language: HCL
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# learn-terraform-aks
Practices of this guide: [Quickstart - Deploy an AKS using Terraform](https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-terraform?tabs=bash). The sample repository is [here](https://github.com/Azure-Samples/aks-store-demo).
Relevant commands of this repository:
```shell
az login
az account show
az account list --query "[?user.name==''].{Name:name, ID:id, Default:isDefault}" --output Table
# no need of this if using Terraform Cloud
printenv | grep '^ARM*'
# login first if using Terraform Cloud
terraform login
terraform init -upgrade
terraform plan -out main.tfplan
terraform apply main.tfplan
resource_group_name=$(terraform output -raw resource_group_name)
az aks list \
--resource-group $resource_group_name \
--query "[].{\"K8s cluster name\":name}" \
--output table
echo "$(terraform output kube_config | grep -v EOT)" > ./azurek8s
cat ./azurek8s
export KUBECONFIG=./azurek8s
kubectl get nodes
kubectl apply -f apps/aks-store-quickstart.yml
kubectl get pods
# Get the public IP:
kubectl get svc store-front -w
# Open browser to view the website using the above public IP
terraform plan -destroy -out main.destroy.tfplan
terraform apply main.destroy.tfplan
### helper commands ###
az account list-locations -o table
az vm list-sizes --location koreasouth -o table
az vm list-skus --location koreasouth -o table
```