-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfile.yaml
49 lines (42 loc) · 1.5 KB
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
version: '3'
vars:
TAGS: "AKS Cluster with Kata nodes Demo"
NODE_COUNT: 2
SKU: "Standard_D4ads_v5"
tasks:
default:
desc: Calls `task --list`
cmds:
- task --list
up:
desc: Creates a {{.TAGS}} environment
cmds:
- terraform workspace new {{.REGION}} || true
- terraform workspace select {{.REGION}}
- terraform init
- terraform apply -auto-approve -var "region={{.REGION}}" -var "vm_size={{.SKU}}" -var "tags={{.TAGS}}" -var "node_count={{.NODE_COUNT}}" -compact-warnings
- task: creds
vars:
REGION: '{{default "southcentralus" .CLI_ARGS}}'
creds:
desc: Gets AKS credential file
cmds:
- az aks get-credentials -g {{.RG}} -n {{.AKS}} --overwrite-existing
- kubelogin convert-kubeconfig -l azurecli
vars:
RG:
sh: terraform output -raw AKS_RESOURCE_GROUP
AKS:
sh: terraform output -raw AKS_CLUSTER_NAME
deploy:
cmds:
- kubectl apply -f manifests/pods.yaml
- kubectl wait --for=condition=ready pod -l app=kata-demo
- kubectl get pods
- kubectl exec -it kata-isolation -- uname -r
- kubectl exec -it default-isolation -- uname -r
down:
desc: Destroys all Azure resources and cleans up Terraform
cmds:
- az group list --tag Application="{{.TAGS}}" --query "[].name" -o tsv | xargs -ot -n 1 az group delete -y --verbose --no-wait -n || true
- rm -rf terraform.tfstate.d .terraform.lock.hcl .terraform terraform.tfstate terraform.tfstate.backup .terraform.tfstate.lock.info