-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI:[CNI] Templatise CNI load test pipeline yaml (#2011)
- Loading branch information
Showing
6 changed files
with
151 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.pipelines/cni/load-test-templates/create-cluster-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
parameters: | ||
clusterType: "" | ||
clusterName: "" | ||
nodeCount: "" | ||
vmSize: "" | ||
|
||
steps: | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
set -ex | ||
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION) | ||
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 }} | ||
name: "CreateAksCluster" | ||
displayName: "Create AKS Cluster" |
17 changes: 17 additions & 0 deletions
17
.pipelines/cni/load-test-templates/pod-deployment-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
parameters: | ||
clusterName: "" | ||
|
||
steps: | ||
- task: AzureCLI@1 | ||
displayName: "Pod Deployment" | ||
inputs: | ||
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
set -ex | ||
az extension add --name aks-preview | ||
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision) | ||
cd test/integration/load | ||
go test -timeout 30m -tags load -run ^TestLoad$ -tags=load -iterations=4 -scaleup=2400 |
26 changes: 26 additions & 0 deletions
26
.pipelines/cni/load-test-templates/restart-node-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
parameters: | ||
clusterName: "" | ||
|
||
steps: | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
echo "Scale up the pods and immediated restart the nodes" | ||
clusterName=${{ parameters.clusterName }}-$(make revision) | ||
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${clusterName} | ||
make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION) | ||
cd test/integration/load | ||
echo "Scaling the pods down to 100 per node" | ||
go test -count 1 -timeout 30m -tags load -run ^TestScaleDeployment$ -tags=load -scaleup=1000 -skip-wait=true | ||
cd ../../../ | ||
echo "Restarting the nodes" | ||
vmss_name=$(az vmss list -g MC_${clusterName}_${clusterName}_$(LOCATION) --query "[].name" -o tsv) | ||
make -C ./hack/swift restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(LOCATION) VMSS_NAME=$vmss_name | ||
cd test/integration/load | ||
go test -count 1 -timeout 30m -tags load -run ^TestScaleDeployment$ -tags=load -replicas=1000 | ||
name: "RestartNodes" | ||
displayName: "Restart Nodes" |
19 changes: 19 additions & 0 deletions
19
.pipelines/cni/load-test-templates/validate-state-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
parameters: | ||
clusterName: "" | ||
restartCase: "false" | ||
|
||
steps: | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
export RESTART_CASE=${{ parameters.restartCase }} | ||
make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision) | ||
kubectl get pods -A | ||
make test-validate-state | ||
name: "ValidateState" | ||
displayName: "Validate State" | ||
retryCountOnTaskFailure: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
pr: none | ||
trigger: none | ||
|
||
stages: | ||
- stage: setup | ||
displayName: Setup | ||
jobs: | ||
- job: env | ||
displayName: Setup | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
steps: | ||
- script: | | ||
echo "Setting up environment" | ||
go version | ||
name: "SetEnvVars" | ||
displayName: "Set Environment Variables" | ||
condition: always() | ||
- template: cilium/cilium-overlay-load-test-template.yaml | ||
parameters: | ||
name: cilium | ||
clusterType: "overlay-no-kube-proxy-up" | ||
clusterName: "cilium-overlay" | ||
nodeCount: 10 | ||
vmSize: "Standard_DS4_v2" | ||
dependsOn: setup |