@@ -2,6 +2,32 @@ pr: none
22trigger : none
33
44stages :
5+ - stage : create_rg_cluster
6+ displayName : " Create RG & Cluster"
7+ jobs :
8+ - job : create_rg_cluster
9+ pool :
10+ name : " $(BUILD_POOL_NAME_DEFAULT)"
11+ steps :
12+ - task : AzureCLI@2
13+ inputs :
14+ azureSubscription : $(TEST_SUB_SERVICE_CONNECTION)
15+ scriptLocation : " inlineScript"
16+ scriptType : " bash"
17+ addSpnToEnvironment : true
18+ inlineScript : |
19+ set -ex
20+ az extension add --name aks-preview
21+
22+ subscriptionId="$(az account list --query "[?isDefault].id" --output tsv)"
23+ make -C ./hack/aks AZCLI=az ${CLUSTER_TYPE} CLUSTER=${CLUSTER} GROUP=${RESOURCE_GROUP} REGION=${LOCATION} NODE_COUNT=5 VM_SIZE=${VMSIZE} SUB=${subscriptionId} || {
24+ echo "Failed to create Cluster"
25+ exit 1
26+ }
27+ ls -lah
28+ pwd
29+ kubectl cluster-info
30+ kubectl get po -owide -A
531 - stage : update_daemonset_versions
632 displayName : " Update Cilium + CNS Version and Restart Nodes"
733 jobs :
@@ -16,24 +42,54 @@ stages:
1642 scriptType : " bash"
1743 addSpnToEnvironment : true
1844 inlineScript : |
19- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
45+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
2046 echo "Redeploy all cilium components and update cilium version. Redeploy all to catch all changes between versions"
21- echo "deploy Cilium ConfigMap"
22- kubectl apply -f test/integration/manifests/cilium/cilium-config.yaml
47+ pwd
48+
2349 echo "install Cilium ${CILIUM_VERSION_TAG}"
24- envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/daemonset.yaml | kubectl apply -f -
25- envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/deployment.yaml | kubectl apply -f -
26- kubectl apply -f test/integration/manifests/cilium/cilium-agent
27- kubectl apply -f test/integration/manifests/cilium/cilium-operator
28- echo "Keep CNS version up to date, grabbing pipeline parameter"
29- CNS_IMAGE=${CNS_IMAGE}
30- sed -i '/containers:/{n;n;s/\(image\).*/\1: '"${CNS_IMAGE//\//\\/}"'/}' test/integration/manifests/cns/daemonset.yaml
31- kubectl apply -f test/integration/manifests/cns/daemonset.yaml
50+ export DIR=${CILIUM_VERSION_TAG%.*}
51+ echo "installing files from ${DIR}"
52+
53+ echo "deploy Cilium ConfigMap"
54+ if ${IS_DUALSTACK}; then
55+ echo "Use dualstack configmap for Cilium"
56+ kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config-dualstack.yaml
57+ else
58+ kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config.yaml
59+ fi
60+
61+ # Passes Cilium image to daemonset and deployment
62+ kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files
63+ kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files
64+
65+ export CILIUM_VERSION_TAG=${CILIUM_VERSION_TAG}
66+ export CILIUM_IMAGE_REGISTRY=${CILIUM_IMAGE_REGISTRY}
67+ if ${IS_DUALSTACK}; then
68+ echo "Use dualstack daemonset for Cilium"
69+ envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY},${IPV6_HP_BPF_VERSION}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset-dualstack.yaml | kubectl apply -f -
70+ else
71+ envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
72+ fi
73+
74+ envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
75+ kubectl get po -owide -A
76+
77+ echo "Deploy Azure-CNS"
78+ sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=v$(AZURE_IPAM_VERSION) CNS_ONLY=true CNS_VERSION=v$(CNS_VERSION) INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
79+ kubectl get po -owide -A
80+ kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=10m || {
81+ echo "Not all pods ready"
82+ kubectl get po -owide -A
83+ exit 1
84+ }
85+ kubectl get po -owide -A
86+
87+ echo "Restart Nodes"
3288 for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_AKS_CLUSTER_TEST) --query "[].name" -o tsv); do
3389 make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_AKS_CLUSTER_TEST) VMSS_NAME=${val}
3490 done
3591 kubectl get node
36- kubectl get pod -A
92+ kubectl get po -owide -A
3793 name : " UpdateCiliumandCNSVersion"
3894 displayName : " Update Cilium and CNS Version"
3995 - stage : scale_up_cluster
@@ -73,6 +129,7 @@ stages:
73129 fi
74130 name : " ScaleUp"
75131 displayName : " Scale up Nodes"
132+ timeoutInMinutes : 90
76133 - stage : label_nodes
77134 displayName : " Label Nodes for Testing"
78135 jobs :
@@ -88,7 +145,7 @@ stages:
88145 addSpnToEnvironment : true
89146 inlineScript : |
90147 echo "Set node label scale-test=true and connectivity-test=true for testing"
91- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
148+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
92149 cd test/scale
93150 chmod +x label-nodes.sh
94151 ./label-nodes.sh
@@ -100,6 +157,7 @@ stages:
100157 - job : scale_deployments
101158 pool :
102159 name : " $(BUILD_POOL_NAME_DEFAULT)"
160+ timeoutInMinutes : 120
103161 steps :
104162 - task : AzureCLI@2
105163 inputs :
@@ -108,7 +166,7 @@ stages:
108166 scriptType : " bash"
109167 addSpnToEnvironment : true
110168 inlineScript : |
111- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
169+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
112170 echo "collect cpu and memory usage before scaling for network policies"
113171 mkdir test1_1_netpol_cpu_and_mem_before
114172 cd test1_1_netpol_cpu_and_mem_before
@@ -173,7 +231,7 @@ stages:
173231 addSpnToEnvironment : true
174232 inlineScript : |
175233 echo "Run network policies test"
176- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
234+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
177235 cd test/scale/connectivity
178236 chmod +x test-connectivity.sh
179237 ./test-connectivity.sh --num-scale-pods-to-verify=${NUM_SCALE_PODS_TO_VERIFY} --max-wait-for-initial-connectivity=600 --max-wait-after-adding-netpol=120
@@ -206,6 +264,7 @@ stages:
206264 - job : deploy_service
207265 pool :
208266 name : " $(BUILD_POOL_NAME_DEFAULT)"
267+ timeoutInMinutes : 120
209268 steps :
210269 - task : AzureCLI@2
211270 inputs :
@@ -214,7 +273,7 @@ stages:
214273 scriptType : " bash"
215274 addSpnToEnvironment : true
216275 inlineScript : |
217- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
276+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
218277 echo "collect cpu and mem results before scale for lb tests"
219278 mkdir test2_1_lb_cpu_and_mem_before
220279 cd test2_1_lb_cpu_and_mem_before
@@ -276,7 +335,7 @@ stages:
276335 scriptType : " bash"
277336 addSpnToEnvironment : true
278337 inlineScript : |
279- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
338+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
280339 echo "Deploy apachebench pod and run test"
281340 cd hack/manifests
282341 kubectl apply -f apache.yaml
@@ -336,7 +395,7 @@ stages:
336395 scriptType : " bash"
337396 addSpnToEnvironment : true
338397 inlineScript : |
339- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
398+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
340399 chmod +x hack/scripts/netperf.sh
341400 kubectl apply -f hack/manifests/netperf-pod.yaml
342401 kubectl rollout status deployment container6 --timeout=30s
@@ -392,10 +451,10 @@ stages:
392451 addSpnToEnvironment : true
393452 inlineScript : |
394453 set -ex
395- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
454+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
396455 echo "Scaling to 5 nodes"
397- vmss_name=$(az vmss list -g MC_${CLUSTER }_${CLUSTER}_$(LOCATION) --query "[].name" -o tsv)
398- make -C ./hack/aks scale-vmss AZCLI=az CLUSTER=${CLUSTER} REGION=$(LOCATION) VMSS_NAME=$vmss_name NODE_COUNT=5
456+ vmss_name=$(az vmss list -g MC_${RESOURCE_GROUP }_${CLUSTER}_$(LOCATION) --query "[].name" -o tsv)
457+ make -C ./hack/aks scale-vmss AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} REGION=$(LOCATION) VMSS_NAME=$vmss_name NODE_COUNT=5
399458 kubectl get node
400459 name : " ScaleDown"
401460 displayName : " Scale down to 5 Nodes"
@@ -414,7 +473,7 @@ stages:
414473 addSpnToEnvironment : true
415474 inlineScript : |
416475 echo "delete test resources and namespaces"
417- az aks get-credentials --resource-group ${CLUSTER } --name ${CLUSTER}
476+ az aks get-credentials --resource-group ${RESOURCE_GROUP } --name ${CLUSTER}
418477 kubectl delete ns scale-test
419478 kubectl delete ns connectivity-test
420479 kubectl get ns
0 commit comments