Skip to content

Commit bffb8c5

Browse files
committed
CI:[CNI] Templatise CNI load test pipeline yaml
1 parent f687dee commit bffb8c5

6 files changed

+152
-76
lines changed

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

+44-76
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
pr: none
2-
trigger: none
1+
parameters:
2+
dependsOn: ""
3+
name: "cilium"
4+
clusterType: "overlay-no-kube-proxy-up"
5+
clusterName: "cilium-overlay"
6+
nodeCount: 10
7+
vmSize: "Standard_DS4_v2"
8+
39

410
stages:
5-
- stage: creating_aks_cluster
6-
displayName: "Create AKS Cluster with Cilium"
11+
12+
- stage: createAKScluster
13+
dependsOn: ${{ parameters.dependsOn }}
14+
displayName: "AKS Cluster with Cilium"
715
jobs:
8-
- job: create_aks_cluster_with_cilium
16+
- job: create_aks_cluster_with_${{ parameters.name }}
917
steps:
10-
- task: AzureCLI@1
11-
inputs:
12-
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
13-
scriptLocation: "inlineScript"
14-
scriptType: "bash"
15-
addSpnToEnvironment: true
16-
inlineScript: |
17-
set -ex
18-
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION)
19-
make -C ./hack/swift overlay-no-kube-proxy-up AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${RESOURCE_GROUP}-$(make revision) NODE_COUNT=10 VM_SIZE=Standard_DS4_v2
20-
name: "CreateAksCluster"
21-
displayName: "Create AKS Cluster"
18+
- template: ../load-test-templates/create-cluster-template.yaml
19+
parameters:
20+
clusterType: ${{ parameters.clusterType }}
21+
clusterName: ${{ parameters.clusterName }}
22+
nodeCount: ${{ parameters.nodeCount }}
23+
vmSize: ${{ parameters.vmSize }}
2224
- stage: install_cilium
23-
dependsOn: creating_aks_cluster
25+
dependsOn: createAKScluster
2426
displayName: "Install Cilium on AKS Overlay"
2527
jobs:
2628
- job: deploy_cilium_components
@@ -35,7 +37,7 @@ stages:
3537
inlineScript: |
3638
set -ex
3739
az extension add --name aks-preview
38-
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision)
40+
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
3941
ls -lah
4042
pwd
4143
kubectl cluster-info
@@ -65,73 +67,39 @@ stages:
6567
jobs:
6668
- job: deploy_pods
6769
steps:
68-
- task: AzureCLI@1
69-
displayName: "Pod Deployment"
70-
inputs:
71-
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
72-
scriptLocation: "inlineScript"
73-
scriptType: "bash"
74-
addSpnToEnvironment: true
75-
inlineScript: |
76-
set -ex
77-
az extension add --name aks-preview
78-
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision)
79-
cd test/integration/load
80-
go test -timeout 30m -tags load -run ^TestLoad$ -tags=load -iterations=4 -scaleup=2400
70+
- template: ../load-test-templates/pod-deployment-template.yaml
71+
parameters:
72+
clusterName: ${{ parameters.clusterName }}
8173
- stage: validate_state
8274
dependsOn: pod_deployment
8375
displayName: "Validate State"
8476
jobs:
8577
- job: validate_state
8678
steps:
87-
- task: AzureCLI@1
88-
inputs:
89-
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
90-
scriptLocation: "inlineScript"
91-
scriptType: "bash"
92-
addSpnToEnvironment: true
93-
inlineScript: |
94-
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision)
95-
kubectl get pods -A
96-
make test-validate-state
97-
name: "ValidateState"
98-
displayName: "Validate State"
99-
retryCountOnTaskFailure: 3
79+
- template: ../load-test-templates/validate-state-template.yaml
80+
parameters:
81+
clusterName: ${{ parameters.clusterName }}
10082
- stage: restart_nodes
10183
dependsOn: validate_state
10284
displayName: "Restart Node"
10385
jobs:
10486
- job: restart_nodes
10587
steps:
106-
- task: AzureCLI@1
107-
inputs:
108-
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
109-
scriptLocation: "inlineScript"
110-
scriptType: "bash"
111-
addSpnToEnvironment: true
112-
inlineScript: |
113-
echo "Scale up the pods and immediated restart the nodes"
114-
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision)
115-
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION)
116-
cd test/integration/load
117-
echo "Scaling the pods down to 100 per node"
118-
go test -count 1 -timeout 30m -tags load -run ^TestScaleDeployment$ -tags=load -scaleup=1000 -skip-wait=true
119-
cd ../../../
120-
echo "Restarting the nodes"
121-
vmss_name=$(az vmss list -g MC_${RESOURCE_GROUP}_${RESOURCE_GROUP}_$(LOCATION) --query "[].name" -o tsv)
122-
make -C ./hack/swift restart-vmss AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision) REGION=$(LOCATION) VMSS_NAME=$vmss_name
123-
cd test/integration/load
124-
go test -count 1 -timeout 30m -tags load -run ^TestScaleDeployment$ -tags=load -replicas=1000
125-
name: "RestartNodes"
126-
displayName: "Restart Nodes"
127-
- script: |
128-
export RESTART_CASE=true
129-
make test-validate-state
130-
name: "ValidateState"
131-
displayName: "Validate State"
132-
retryCountOnTaskFailure: 3
133-
- stage: connectivity_tests
88+
- template: ../load-test-templates/restart-node-template.yaml
89+
parameters:
90+
clusterName: ${{ parameters.clusterName }}
91+
- stage: validate_restart_state
13492
dependsOn: restart_nodes
93+
displayName: "Validate Restart State"
94+
jobs:
95+
- job: validate_restart_state
96+
steps:
97+
- template: ../load-test-templates/validate-state-template.yaml
98+
parameters:
99+
clusterName: ${{ parameters.clusterName }}
100+
restartCase: "true"
101+
- stage: connectivity_tests
102+
dependsOn: validate_restart_state
135103
displayName: "Connectivity Tests"
136104
jobs:
137105
- job: cni_tests
@@ -154,7 +122,7 @@ stages:
154122
addSpnToEnvironment: true
155123
inlineScript: |
156124
set -ex
157-
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision)
125+
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
158126
name: "GetCluster"
159127
displayName: "Get AKS Cluster"
160128
- script: |
@@ -181,9 +149,9 @@ stages:
181149
if [ "$(DELETE_RESOURCES)" ]
182150
then
183151
echo "Deleting Cluster and resource group"
184-
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP}-$(make revision)
152+
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
185153
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION)
186-
make -C ./hack/swift down AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${RESOURCE_GROUP}-$(make revision)
154+
make -C ./hack/swift down AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${{ parameters.clusterName }}-$(make revision)
187155
echo "Cluster and resources down"
188156
else
189157
echo "Deletion of resources is False"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
parameters:
2+
clusterType: ""
3+
clusterName: ""
4+
nodeCount: ""
5+
vmSize: ""
6+
7+
steps:
8+
- task: AzureCLI@1
9+
inputs:
10+
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
11+
scriptLocation: "inlineScript"
12+
scriptType: "bash"
13+
addSpnToEnvironment: true
14+
inlineScript: |
15+
set -ex
16+
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION)
17+
make -C ./hack/swift ${{ parameters.clusterType }} AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${{ parameters.clusterName }}-$(make revision) NODE_COUNT=${{ parameters.nodeCount }} VM_SIZE=${{ parameters.vmSize }}
18+
name: "CreateAksCluster"
19+
displayName: "Create AKS Cluster"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
parameters:
2+
clusterName: ""
3+
4+
steps:
5+
- task: AzureCLI@1
6+
displayName: "Pod Deployment"
7+
inputs:
8+
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
9+
scriptLocation: "inlineScript"
10+
scriptType: "bash"
11+
addSpnToEnvironment: true
12+
inlineScript: |
13+
set -ex
14+
az extension add --name aks-preview
15+
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
16+
cd test/integration/load
17+
go test -timeout 30m -tags load -run ^TestLoad$ -tags=load -iterations=4 -scaleup=2400
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
parameters:
2+
clusterName: ""
3+
4+
steps:
5+
- task: AzureCLI@1
6+
inputs:
7+
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
8+
scriptLocation: "inlineScript"
9+
scriptType: "bash"
10+
addSpnToEnvironment: true
11+
inlineScript: |
12+
echo "Scale up the pods and immediated restart the nodes"
13+
clusterName=${{ parameters.clusterName }}-$(make revision)
14+
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=$clusterName
15+
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION)
16+
cd test/integration/load
17+
echo "Scaling the pods down to 100 per node"
18+
go test -count 1 -timeout 30m -tags load -run ^TestScaleDeployment$ -tags=load -scaleup=1000 -skip-wait=true
19+
cd ../../../
20+
echo "Restarting the nodes"
21+
mc_resource_group=MC_$clusterName_$clusterName_$(LOCATION)
22+
vmss_name=$(az vmss list -g MC_$clusterName_$clusterName_$(LOCATION) --query "[].name" -o tsv)
23+
make -C ./hack/swift restart-vmss AZCLI=az CLUSTER=$clusterName REGION=$(LOCATION) VMSS_NAME=$vmss_name
24+
cd test/integration/load
25+
go test -count 1 -timeout 30m -tags load -run ^TestScaleDeployment$ -tags=load -replicas=1000
26+
name: "RestartNodes"
27+
displayName: "Restart Nodes"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
parameters:
2+
clusterName: ""
3+
restartCase: "false"
4+
5+
steps:
6+
- task: AzureCLI@1
7+
inputs:
8+
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
9+
scriptLocation: "inlineScript"
10+
scriptType: "bash"
11+
addSpnToEnvironment: true
12+
inlineScript: |
13+
export RESTART_CASE=${{ parameters.restartCase }}
14+
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
15+
kubectl get pods -A
16+
make test-validate-state
17+
name: "ValidateState"
18+
displayName: "Validate State"
19+
retryCountOnTaskFailure: 3

.pipelines/cni/pipeline.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pr: none
2+
trigger: none
3+
4+
stages:
5+
- stage: setup
6+
displayName: Setup
7+
jobs:
8+
- job: env
9+
displayName: Setup
10+
pool:
11+
name: "$(BUILD_POOL_NAME_DEFAULT)"
12+
steps:
13+
- script: |
14+
echo "Setting up environment"
15+
go version
16+
name: "SetEnvVars"
17+
displayName: "Set Environment Variables"
18+
condition: always()
19+
- template: cilium/cilium-overlay-load-test-template.yaml
20+
parameters:
21+
name: cilium
22+
clusterType: "overlay-no-kube-proxy-up"
23+
clusterName: "cilium-overlay"
24+
nodeCount: 10
25+
vmSize: "Standard_DS4_v2"
26+
dependsOn: setup

0 commit comments

Comments
 (0)