@@ -11,37 +11,39 @@ parameters:
1111 hubbleEnabled : false
1212 dualstackVersion : " "
1313 cni : " cilium"
14+ upgradeScenario : " "
1415
1516# Condition confirms that:
1617# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success.
1718# CONTROL_CNI either contains 'cniv1' or 'all'. It is not case sensitive
1819stages :
19- - stage : create_${{ parameters.name }}
20- condition : and( succeeded(), and( or( contains(variables.CONTROL_CNI, 'cilium') , contains(variables.CONTROL_CNI, 'all') ), or( contains(variables.CONTROL_OS, 'linux'), contains(variables.CONTROL_OS, 'all') ) ) )
21- variables :
22- ${{ if contains(parameters.clusterName, 'rdma') }} :
23- location : $(LOCATION_RDMA)
24- ${{ elseif eq(parameters.arch, 'arm64') }} :
25- location : $(LOCATION_ARM64)
26- ${{ else }} :
27- location : $(LOCATION_AMD64)
28- commitID : $[ stagedependencies.setup.env.outputs['SetEnvVars.commitID'] ]
29- dependsOn :
30- - setup
31- - build_images
32- displayName : " Create Cluster - ${{ parameters.clusterName }}"
33- jobs :
34- - job : create_aks_cluster_with_${{ parameters.name }}
35- pool :
36- name : " $(BUILD_POOL_NAME_DEFAULT)"
37- steps :
38- - template : ../load-test-templates/create-cluster-template.yaml
39- parameters :
40- clusterType : ${{ parameters.clusterType }}
41- clusterName : ${{ parameters.clusterName }}-$(commitID)
42- nodeCount : ${{ parameters.nodeCount }}
43- vmSize : ${{ parameters.vmSize }}
44- region : $(location)
20+ - ${{if eq(parameters.upgradeScenario, false)}} :
21+ - stage : create_${{ parameters.name }}
22+ condition : and( succeeded(), and( or( contains(variables.CONTROL_CNI, 'cilium') , contains(variables.CONTROL_CNI, 'all') ), or( contains(variables.CONTROL_OS, 'linux'), contains(variables.CONTROL_OS, 'all') ) ) )
23+ variables :
24+ ${{ if contains(parameters.clusterName, 'rdma') }} :
25+ location : $(LOCATION_RDMA)
26+ ${{ elseif eq(parameters.arch, 'arm64') }} :
27+ location : $(LOCATION_ARM64)
28+ ${{ else }} :
29+ location : $(LOCATION_AMD64)
30+ commitID : $[ stagedependencies.setup.env.outputs['SetEnvVars.commitID'] ]
31+ dependsOn :
32+ - setup
33+ - build_images
34+ displayName : " Create Cluster - ${{ parameters.clusterName }}"
35+ jobs :
36+ - job : create_aks_cluster_with_${{ parameters.name }}
37+ pool :
38+ name : " $(BUILD_POOL_NAME_DEFAULT)"
39+ steps :
40+ - template : ../load-test-templates/create-cluster-template.yaml
41+ parameters :
42+ clusterType : ${{ parameters.clusterType }}
43+ clusterName : ${{ parameters.clusterName }}-$(commitID)
44+ nodeCount : ${{ parameters.nodeCount }}
45+ vmSize : ${{ parameters.vmSize }}
46+ region : $(location)
4547
4648# Conditions for below E2E test scenarios confirm that:
4749# Pipeline has not been canceled and that the previous job has reports anything other than failure(Succeeded, SuccededWithIssues, Skipped). Previous job is declared by dependsOn:
@@ -60,7 +62,10 @@ stages:
6062 pool :
6163 name : " $(BUILD_POOL_NAME_DEFAULT)"
6264 dependsOn :
63- - create_${{ parameters.name }}
65+ - ${{ if eq(parameters.upgradeScenario, false) }} :
66+ - create_${{ parameters.name }}
67+ - ${{ else }} :
68+ - ${{ parameters.dependsOn }}
6469 - publish
6570 - setup
6671 displayName : " Cilium Test - ${{ parameters.name }}"
@@ -117,27 +122,7 @@ stages:
117122
118123 envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
119124 kubectl get po -owide -A
120-
121- if [ -z "$TEST_AZURE_IPAM_VERSION" ]
122- then
123- echo "TEST_AZURE_IPAM_VERSION is not set, using default value"
124- IPAM=$(make azure-ipam-version)
125- else
126- IPAM=$(TEST_AZURE_IPAM_VERSION)
127- echo "TEST_AZURE_IPAM_VERSION is set to $IPAM"
128- fi
129- if [ -z "$TEST_CNS_VERSION" ]
130- then
131- echo "TEST_CNS_VERSION is not set, using default value"
132- CNS=$(make cns-version)
133- else
134- CNS=$(TEST_CNS_VERSION)
135- echo "TEST_CNS_VERSION is set to $CNS"
136- fi
137- echo "Deploy Azure-CNS"
138- sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) IPAM_IMAGE_REPO=$(IPAM_IMAGE_REPO)
139- kubectl get po -owide -A
140- kubectl get crd -A
125+
141126 - ${{if eq(parameters.hubbleEnabled, true)}} :
142127 - job : deploy_cilium_components
143128 displayName : Deploy Cilium with Hubble
@@ -169,26 +154,71 @@ stages:
169154 envsubst '${CILIUM_IMAGE_REGISTRY},${CILIUM_VERSION_TAG}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
170155 kubectl get po -owide -A
171156
172- if [ -z "$TEST_AZURE_IPAM_VERSION" ]
173- then
174- echo "TEST_AZURE_IPAM_VERSION is not set, using default value"
175- IPAM=$(make azure-ipam-version)
176- else
177- IPAM=$(TEST_AZURE_IPAM_VERSION)
178- echo "TEST_AZURE_IPAM_VERSION is set to $IPAM"
179- fi
180- if [ -z "$TEST_CNS_VERSION" ]
181- then
182- echo "TEST_CNS_VERSION is not set, using default value"
183- CNS=$(make cns-version)
184- else
185- CNS=$(TEST_CNS_VERSION)
186- echo "TEST_CNS_VERSION is set to $CNS"
187- fi
188- echo "Deploy Azure-CNS"
189- sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) IPAM_IMAGE_REPO=$(IPAM_IMAGE_REPO)
190- kubectl get po -owide -A
191- kubectl get crd -A
157+ - job : deploy_cns_and_ipam
158+ displayName : " Deploy CNS and IPAM"
159+ dependsOn : deploy_cilium_components
160+ steps :
161+ - task : AzureCLI@2
162+ displayName : " Install CNS and IPAM"
163+ inputs :
164+ azureSubscription : $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
165+ scriptLocation : " inlineScript"
166+ scriptType : " bash"
167+ addSpnToEnvironment : true
168+ inlineScript : |
169+ set -ex
170+ az extension add --name aks-preview
171+ make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
172+ ls -lah
173+ pwd
174+ kubectl cluster-info
175+ kubectl get po -owide -A
176+ if [ ${{parameters.upgradeScenario}} = "true" ]
177+ then
178+ echo "Upgrade scenario is true, using upgrade azure ipam and cns version from pipeline variables"
179+ if [ -z "$UPGRADE_AZURE_IPAM_VERSION" ]
180+ then
181+ echo "UPGRADE_AZURE_IPAM_VERSION is not set, using default value"
182+ IPAM=$(make azure-ipam-version)
183+ else
184+ IPAM=$(UPGRADE_AZURE_IPAM_VERSION)
185+ echo "UPGRADE_AZURE_IPAM_VERSION is set to $IPAM"
186+ fi
187+
188+ if [ -z "$UPGRADE_CNS_VERSION" ]
189+ then
190+ echo "UPGRADE_CNS_VERSION is not set, using default value"
191+ CNS=$(make cns-version)
192+ else
193+ CNS=$(UPGRADE_CNS_VERSION)
194+ echo "UPGRADE_CNS_VERSION is set to $CNS"
195+ fi
196+ IPAM_IMAGE_REPO=$(UPGRADE_IPAM_IMAGE_REPO)
197+ CNS_IMAGE_REPO=$(UPGRADE_CNS_IMAGE_REPO)
198+ echo Deploying with Azure Ipam version $IPAM from $IPAM_IMAGE_REPO and CNS version $CNS from $CNS_IMAGE_REPO
199+ else
200+ if [ -z "$TEST_AZURE_IPAM_VERSION" ]
201+ then
202+ echo "TEST_AZURE_IPAM_VERSION is not set, using default value"
203+ IPAM=$(make azure-ipam-version)
204+ else
205+ IPAM=$(TEST_AZURE_IPAM_VERSION)
206+ echo "TEST_AZURE_IPAM_VERSION is set to $IPAM"
207+ fi
208+ if [ -z "$TEST_CNS_VERSION" ]
209+ then
210+ echo "TEST_CNS_VERSION is not set, using default value"
211+ CNS=$(make cns-version)
212+ else
213+ CNS=$(TEST_CNS_VERSION)
214+ echo "TEST_CNS_VERSION is set to $CNS"
215+ fi
216+ fi
217+
218+ echo "Deploy Azure-CNS"
219+ sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) IPAM_IMAGE_REPO=$(IPAM_IMAGE_REPO)
220+ kubectl get po -owide -A
221+ kubectl get crd -A
192222
193223 - job : deploy_pods
194224 condition : and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'scaleTest') , contains(variables.CONTROL_SCENARIO, 'all') ) )
@@ -203,6 +233,8 @@ stages:
203233 iterations : ${ITERATIONS_CILIUM}
204234 nodeCount : ${{ parameters.nodeCount }}
205235 cni : cilium
236+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
237+ logType : upgradeScaleTest
206238 - template : ../load-test-templates/validate-state-template.yaml
207239 parameters :
208240 clusterName : ${{ parameters.clusterName }}-$(commitID)
@@ -218,6 +250,8 @@ stages:
218250 os : ${{ parameters.os }}
219251 cni : cilium
220252 region : $(location)
253+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
254+ logType : upgradeRestartNode
221255 - template : ../load-test-templates/validate-state-template.yaml
222256 parameters :
223257 clusterName : ${{ parameters.clusterName }}-$(commitID)
@@ -235,6 +269,8 @@ stages:
235269 scaleup : ${SCALEUP_CILIUM}
236270 nodeCount : ${{ parameters.nodeCount }}
237271 cni : ${{ parameters.cni }}
272+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
273+ logType : upgradeRestartCNS
238274 - job : cni_tests
239275 displayName : " Cilium Test"
240276 dependsOn : restart_cns
0 commit comments