Skip to content

Commit 50f0679

Browse files
committed
ci: azure-ipam patch upgrade testing conditions and variables added
1 parent 7d60962 commit 50f0679

File tree

6 files changed

+280
-75
lines changed

6 files changed

+280
-75
lines changed

.pipelines/cni/cilium/cilium-overlay-load-test-template.yaml

Lines changed: 84 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,40 @@ parameters:
1111
hubbleEnabled: false
1212
dualstackVersion: ""
1313
cni: "cilium"
14+
upgradeScenario: ""
15+
upgradeAzureIpam: ""
1416

1517
# Condition confirms that:
1618
# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success.
1719
# CONTROL_CNI either contains 'cniv1' or 'all'. It is not case sensitive
1820
stages:
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)
21+
- ${{if eq(parameters.upgradeAzureIpam, '')}}:
22+
- stage: create_${{ parameters.name }}
23+
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') ) ) )
24+
variables:
25+
${{ if contains(parameters.clusterName, 'rdma') }}:
26+
location: $(LOCATION_RDMA)
27+
${{ elseif eq(parameters.arch, 'arm64') }}:
28+
location: $(LOCATION_ARM64)
29+
${{ else }}:
30+
location: $(LOCATION_AMD64)
31+
commitID: $[ stagedependencies.setup.env.outputs['SetEnvVars.commitID'] ]
32+
dependsOn:
33+
- setup
34+
- build_images
35+
displayName: "Create Cluster - ${{ parameters.clusterName }}"
36+
jobs:
37+
- job: create_aks_cluster_with_${{ parameters.name }}
38+
pool:
39+
name: "$(BUILD_POOL_NAME_DEFAULT)"
40+
steps:
41+
- template: ../load-test-templates/create-cluster-template.yaml
42+
parameters:
43+
clusterType: ${{ parameters.clusterType }}
44+
clusterName: ${{ parameters.clusterName }}-$(commitID)
45+
nodeCount: ${{ parameters.nodeCount }}
46+
vmSize: ${{ parameters.vmSize }}
47+
region: $(location)
4548

4649
# Conditions for below E2E test scenarios confirm that:
4750
# 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 +63,10 @@ stages:
6063
pool:
6164
name: "$(BUILD_POOL_NAME_DEFAULT)"
6265
dependsOn:
63-
- create_${{ parameters.name }}
66+
- ${{ if and(eq(parameters.upgradeAzureIpam, ''), eq(parameters.upgradeScenario, false)) }}:
67+
- create_${{ parameters.name }}
68+
- ${{ else }}:
69+
- ${{ parameters.dependsOn }}
6470
- publish
6571
- setup
6672
displayName: "Cilium Test - ${{ parameters.name }}"
@@ -118,22 +124,33 @@ stages:
118124
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
119125
kubectl get po -owide -A
120126
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" ]
127+
if [ "$UPGRADE_SCENARIO" = "true" ]
130128
then
131-
echo "TEST_CNS_VERSION is not set, using default value"
132-
CNS=$(make cns-version)
129+
echo "Upgrade scenario is true, using upgrade azure ipam and cns version from pipeline variables"
130+
IPAM=$(UPGRADE_AZURE_IPAM_VERSION)
131+
IPAM_IMAGE_REPO=$(UPGRADE_IPAM_IMAGE_REPO)
132+
CNS=$(UPGRADE_CNS_VERSION)
133+
CNS_IMAGE_REPO=$(UPGRADE_CNS_IMAGE_REPO)
134+
echo Deploying with Azure Ipam version $IPAM from $IPAM_IMAGE_REPO and CNS version $CNS from $CNS_IMAGE_REPO
133135
else
134-
CNS=$(TEST_CNS_VERSION)
135-
echo "TEST_CNS_VERSION is set to $CNS"
136+
if [ -z "$TEST_AZURE_IPAM_VERSION" ]
137+
then
138+
echo "TEST_AZURE_IPAM_VERSION is not set, using default value"
139+
IPAM=$(make azure-ipam-version)
140+
else
141+
IPAM=$(TEST_AZURE_IPAM_VERSION)
142+
echo "TEST_AZURE_IPAM_VERSION is set to $IPAM"
143+
fi
144+
if [ -z "$TEST_CNS_VERSION" ]
145+
then
146+
echo "TEST_CNS_VERSION is not set, using default value"
147+
CNS=$(make cns-version)
148+
else
149+
CNS=$(TEST_CNS_VERSION)
150+
echo "TEST_CNS_VERSION is set to $CNS"
151+
fi
136152
fi
153+
137154
echo "Deploy Azure-CNS"
138155
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)
139156
kubectl get po -owide -A
@@ -169,22 +186,33 @@ stages:
169186
envsubst '${CILIUM_IMAGE_REGISTRY},${CILIUM_VERSION_TAG}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
170187
kubectl get po -owide -A
171188
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" ]
189+
if [ "$UPGRADE_SCENARIO" = "true" ]
181190
then
182-
echo "TEST_CNS_VERSION is not set, using default value"
183-
CNS=$(make cns-version)
191+
echo "Upgrade scenario is true, using upgrade azure ipam and cns version from pipeline variables"
192+
IPAM=$(UPGRADE_AZURE_IPAM_VERSION)
193+
IPAM_IMAGE_REPO=$(UPGRADE_IPAM_IMAGE_REPO)
194+
CNS=$(UPGRADE_CNS_VERSION)
195+
CNS_IMAGE_REPO=$(UPGRADE_CNS_IMAGE_REPO)
196+
echo Deploying with Azure Ipam version $IPAM from $IPAM_IMAGE_REPO and CNS version $CNS from $CNS_IMAGE_REPO
184197
else
185-
CNS=$(TEST_CNS_VERSION)
186-
echo "TEST_CNS_VERSION is set to $CNS"
198+
if [ -z "$TEST_AZURE_IPAM_VERSION" ]
199+
then
200+
echo "TEST_AZURE_IPAM_VERSION is not set, using default value"
201+
IPAM=$(make azure-ipam-version)
202+
else
203+
IPAM=$(TEST_AZURE_IPAM_VERSION)
204+
echo "TEST_AZURE_IPAM_VERSION is set to $IPAM"
205+
fi
206+
if [ -z "$TEST_CNS_VERSION" ]
207+
then
208+
echo "TEST_CNS_VERSION is not set, using default value"
209+
CNS=$(make cns-version)
210+
else
211+
CNS=$(TEST_CNS_VERSION)
212+
echo "TEST_CNS_VERSION is set to $CNS"
213+
fi
187214
fi
215+
188216
echo "Deploy Azure-CNS"
189217
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)
190218
kubectl get po -owide -A
@@ -203,6 +231,7 @@ stages:
203231
iterations: ${ITERATIONS_CILIUM}
204232
nodeCount: ${{ parameters.nodeCount }}
205233
cni: cilium
234+
upgradeScenario: ${{ parameters.upgradeScenario }}
206235
- template: ../load-test-templates/validate-state-template.yaml
207236
parameters:
208237
clusterName: ${{ parameters.clusterName }}-$(commitID)
@@ -218,6 +247,7 @@ stages:
218247
os: ${{ parameters.os }}
219248
cni: cilium
220249
region: $(location)
250+
upgradeScenario: ${{ parameters.upgradeScenario }}
221251
- template: ../load-test-templates/validate-state-template.yaml
222252
parameters:
223253
clusterName: ${{ parameters.clusterName }}-$(commitID)
@@ -235,6 +265,7 @@ stages:
235265
scaleup: ${SCALEUP_CILIUM}
236266
nodeCount: ${{ parameters.nodeCount }}
237267
cni: ${{ parameters.cni }}
268+
upgradeScenario: ${{ parameters.upgradeScenario }}
238269
- job: cni_tests
239270
displayName: "Cilium Test"
240271
dependsOn: restart_cns

.pipelines/cni/load-test-templates/pod-deployment-template.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parameters:
66
nodeCount: 10
77
cni: ""
88
jobName: "deploy_pods"
9+
upgradeScenario: ""
910

1011
steps:
1112
- task: AzureCLI@2
@@ -26,7 +27,10 @@ steps:
2627
- template: ../../templates/log-template.yaml
2728
parameters:
2829
clusterName: ${{ parameters.clusterName }}
29-
logType: scaleTest
3030
os: ${{ parameters.os }}
3131
cni: ${{ parameters.cni }}
3232
jobName: ${{ parameters.jobName }}
33+
${{ if eq(parameters.upgradeScenario, 'true') }}:
34+
logType: upgradeScaleTest
35+
${{ else }}:
36+
logType: scaleTest

.pipelines/cni/load-test-templates/restart-cns-template.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
nodeCount: 10
66
os: ""
77
jobName: "restart_cns"
8+
upgradeScenario: ""
89

910
steps:
1011
- task: AzureCLI@2
@@ -38,7 +39,10 @@ steps:
3839
- template: ../../templates/log-template.yaml
3940
parameters:
4041
clusterName: ${{ parameters.clusterName }}
41-
logType: restartCNS
42+
${{ if eq(parameters.upgradeScenario, 'true') }}:
43+
logType: upgradeRestartCNS
44+
${{ else }}:
45+
logType: restartCNS
4246
os: ${{ parameters.os }}
4347
cni: ${{ parameters.cni }}
4448
jobName: ${{ parameters.jobName }}

.pipelines/cni/load-test-templates/restart-node-template.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ parameters:
44
cni: ""
55
jobName: "restart_nodes"
66
region: ""
7+
upgradeScenario: ""
78

89
steps:
910
- task: AzureCLI@2
@@ -56,7 +57,10 @@ steps:
5657
- template: ../../templates/log-template.yaml
5758
parameters:
5859
clusterName: ${{ parameters.clusterName }}
59-
logType: restartNode
60+
${{ if eq(parameters.upgradeScenario, 'true') }}:
61+
logType: upgradeRestartNode
62+
${{ else }}:
63+
logType: restartNode
6064
os: ${{ parameters.os }}
6165
cni: ${{ parameters.cni }}
6266
jobName: ${{ parameters.jobName }}

0 commit comments

Comments
 (0)