|
| 1 | +parameters: |
| 2 | + dependsOn: "" |
| 3 | + name: "cilium" |
| 4 | + clusterType: "overlay-byocni-nokubeproxy-up" |
| 5 | + clusterName: "cilium-overlay" |
| 6 | + nodeCount: 10 |
| 7 | + vmSize: "Standard_DS4_v2" |
| 8 | + os: "linux" |
| 9 | + arch: "" |
| 10 | + osSKU: Ubuntu |
| 11 | + hubbleEnabled: false |
| 12 | + dualstackVersion: "" |
| 13 | + cni: "cilium" |
| 14 | + |
| 15 | +# Condition confirms that: |
| 16 | +# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success. |
| 17 | +# CONTROL_CNI either contains 'cniv1' or 'all'. It is not case sensitive |
| 18 | +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) |
| 45 | + |
| 46 | +# Conditions for below E2E test scenarios confirm that: |
| 47 | +# 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: |
| 48 | +# CONTROL_SCENARIO either contains 'all' or its respective scenario 'npm', 'scaleTest', 'restartNode', 'restartCNS'. It is not case sensitive |
| 49 | +# Ex. CONTROL_SCENARIO = "restartnode SCALETEST" will only run Scale Test and Restart Test. |
| 50 | + - stage: ${{ parameters.name }} |
| 51 | + variables: |
| 52 | + commitID: $[ stagedependencies.setup.env.outputs['SetEnvVars.commitID'] ] |
| 53 | + cnsVersion: $[ stagedependencies.setup.env.outputs['SetEnvVars.cnsVersion'] ] |
| 54 | + ${{ if contains(parameters.clusterName, 'rdma') }}: |
| 55 | + location: $(LOCATION_RDMA) |
| 56 | + ${{ elseif eq(parameters.arch, 'arm64') }}: |
| 57 | + location: $(LOCATION_ARM64) |
| 58 | + ${{ else }}: |
| 59 | + location: $(LOCATION_AMD64) |
| 60 | + pool: |
| 61 | + name: "$(BUILD_POOL_NAME_DEFAULT)" |
| 62 | + dependsOn: |
| 63 | + - create_${{ parameters.name }} |
| 64 | + - publish |
| 65 | + - setup |
| 66 | + displayName: "Cilium Test - ${{ parameters.name }}" |
| 67 | + variables: |
| 68 | + IMAGE_REPO_PATH: 'artifact/dd590928-4e04-48cb-9d3d-ee06c5f0e17f/buddy' |
| 69 | + AZURE_IPAM_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.azureIpamVersion'] ] |
| 70 | + IPV6_HP_BPF_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.ipv6HpBpfVersion'] ] |
| 71 | + CNI_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.cniVersion'] ] |
| 72 | + CNS_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.cnsVersion'] ] |
| 73 | + CNS_IMAGE_NAME_OVERRIDE: $(IMAGE_REPO_PATH)/cns |
| 74 | + CNI_IMAGE_NAME_OVERRIDE: $(IMAGE_REPO_PATH)/cni |
| 75 | + IPV6_HP_BPF_IMAGE_NAME_OVERRIDE: $(IMAGE_REPO_PATH)/ipv6-hp-bpf |
| 76 | + jobs: |
| 77 | + - ${{if eq(parameters.hubbleEnabled, false)}}: |
| 78 | + - job: deploy_cilium_components |
| 79 | + displayName: Deploy Cilium |
| 80 | + steps: |
| 81 | + - task: AzureCLI@2 |
| 82 | + displayName: "Install Cilium, CNS, and ip-masq-agent" |
| 83 | + inputs: |
| 84 | + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) |
| 85 | + scriptLocation: "inlineScript" |
| 86 | + scriptType: "bash" |
| 87 | + addSpnToEnvironment: true |
| 88 | + inlineScript: | |
| 89 | + set -ex |
| 90 | + az extension add --name aks-preview |
| 91 | + make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID) |
| 92 | + ls -lah |
| 93 | + pwd |
| 94 | + kubectl cluster-info |
| 95 | + kubectl get po -owide -A |
| 96 | +
|
| 97 | + if [ ! -z ${{ parameters.dualstackVersion }} ]; then |
| 98 | + echo "Use dualstack version of Cilium" |
| 99 | + export CILIUM_VERSION_TAG=${{ parameters.dualstackVersion }} |
| 100 | + fi |
| 101 | +
|
| 102 | + echo "install Cilium ${CILIUM_VERSION_TAG}" |
| 103 | + export DIR=$(echo ${CILIUM_VERSION_TAG#v} | cut -d. -f1,2) |
| 104 | + echo "installing files from ${DIR}" |
| 105 | +
|
| 106 | + echo "deploy Cilium ConfigMap" |
| 107 | + if [ ! -z ${{ parameters.dualstackVersion }} ]; then |
| 108 | + echo "Use dualstack configmap for Cilium" |
| 109 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config-dualstack.yaml |
| 110 | + else |
| 111 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config.yaml |
| 112 | + fi |
| 113 | +
|
| 114 | + [[ -z $IPV6_HP_BPF_VERSION ]] && IPV6_HP_BPF_VERSION=$(make ipv6-hp-bpf-version) |
| 115 | + [[ -z $IPV6_HP_BPF_IMAGE_NAME_OVERRIDE ]] && IPV6_HP_BPF_IMAGE_NAME_OVERRIDE=ipv6-hp-bpf |
| 116 | + [[ -z $IPV6_IMAGE_REGISTRY ]] && IPV6_IMAGE_REGISTRY=acnpublic.azurecr.io |
| 117 | +
|
| 118 | + # Passes Cilium image to daemonset and deployment |
| 119 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files |
| 120 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files |
| 121 | +
|
| 122 | + if [ ! -z ${{ parameters.dualstackVersion }} ]; then |
| 123 | + echo "Use dualstack daemonset for Cilium" |
| 124 | + envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY},${IPV6_IMAGE_REGISTRY},${IPV6_HP_BPF_IMAGE_NAME_OVERRIDE},${IPV6_HP_BPF_VERSION}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset-dualstack.yaml | kubectl apply -f - |
| 125 | + else |
| 126 | + envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f - |
| 127 | + fi |
| 128 | +
|
| 129 | + envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f - |
| 130 | + kubectl get po -owide -A |
| 131 | +
|
| 132 | + echo "Deploy Azure-CNS" |
| 133 | + sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) |
| 134 | + kubectl get po -owide -A |
| 135 | + kubectl get crd -A |
| 136 | + - ${{if eq(parameters.hubbleEnabled, true)}}: |
| 137 | + - job: deploy_cilium_components |
| 138 | + displayName: Deploy Cilium with Hubble |
| 139 | + steps: |
| 140 | + - task: AzureCLI@2 |
| 141 | + displayName: "Install Cilium, CNS, and ip-masq-agent" |
| 142 | + inputs: |
| 143 | + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) |
| 144 | + scriptLocation: "inlineScript" |
| 145 | + scriptType: "bash" |
| 146 | + addSpnToEnvironment: true |
| 147 | + inlineScript: | |
| 148 | + set -ex |
| 149 | + az extension add --name aks-preview |
| 150 | + make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID) |
| 151 | + ls -lah |
| 152 | + pwd |
| 153 | + kubectl cluster-info |
| 154 | + kubectl get po -owide -A |
| 155 | +
|
| 156 | + echo "install Cilium onto Overlay Cluster with hubble enabled" |
| 157 | + export CILIUM_VERSION_TAG=${CILIUM_HUBBLE_VERSION_TAG} |
| 158 | + export DIR=$(echo ${CILIUM_VERSION_TAG#v} | cut -d. -f1,2) |
| 159 | + echo "installing files from ${DIR}" |
| 160 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config-hubble.yaml |
| 161 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files |
| 162 | + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files |
| 163 | + envsubst '${CILIUM_IMAGE_REGISTRY},${CILIUM_VERSION_TAG}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f - |
| 164 | + envsubst '${CILIUM_IMAGE_REGISTRY},${CILIUM_VERSION_TAG}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f - |
| 165 | + kubectl get po -owide -A |
| 166 | +
|
| 167 | + echo "Deploy Azure-CNS" |
| 168 | + sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) |
| 169 | + kubectl get po -owide -A |
| 170 | + kubectl get crd -A |
| 171 | +
|
| 172 | + - job: deploy_pods |
| 173 | + condition: and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'scaleTest') , contains(variables.CONTROL_SCENARIO, 'all') ) ) |
| 174 | + displayName: "Scale Test" |
| 175 | + dependsOn: deploy_cilium_components |
| 176 | + steps: |
| 177 | + - template: ../load-test-templates/pod-deployment-template.yaml |
| 178 | + parameters: |
| 179 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 180 | + scaleup: ${SCALEUP_CILIUM} |
| 181 | + os: linux |
| 182 | + iterations: ${ITERATIONS_CILIUM} |
| 183 | + nodeCount: ${{ parameters.nodeCount }} |
| 184 | + cni: cilium |
| 185 | + - template: ../load-test-templates/validate-state-template.yaml |
| 186 | + parameters: |
| 187 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 188 | + cni: ${{ parameters.cni }} |
| 189 | + - job: restart_nodes |
| 190 | + condition: and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'restartNode') , contains(variables.CONTROL_SCENARIO, 'all') ) ) |
| 191 | + displayName: "Restart Test" |
| 192 | + dependsOn: deploy_pods |
| 193 | + steps: |
| 194 | + - template: ../load-test-templates/restart-node-template.yaml |
| 195 | + parameters: |
| 196 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 197 | + os: ${{ parameters.os }} |
| 198 | + cni: cilium |
| 199 | + region: $(location) |
| 200 | + - template: ../load-test-templates/validate-state-template.yaml |
| 201 | + parameters: |
| 202 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 203 | + restartCase: "true" |
| 204 | + cni: ${{ parameters.cni }} |
| 205 | + - job: restart_cns |
| 206 | + condition: and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'restartCNS') , contains(variables.CONTROL_SCENARIO, 'all') ) ) |
| 207 | + displayName: "Restart and Validate CNS" |
| 208 | + dependsOn: restart_nodes |
| 209 | + steps: |
| 210 | + - template: ../load-test-templates/restart-cns-template.yaml |
| 211 | + parameters: |
| 212 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 213 | + os: ${{ parameters.os }} |
| 214 | + scaleup: ${SCALEUP_CILIUM} |
| 215 | + nodeCount: ${{ parameters.nodeCount }} |
| 216 | + cni: ${{ parameters.cni }} |
| 217 | + - job: cni_tests |
| 218 | + displayName: "Cilium Test" |
| 219 | + dependsOn: restart_cns |
| 220 | + steps: |
| 221 | + - template: ../../templates/cilium-cli.yaml |
| 222 | + - task: AzureCLI@2 |
| 223 | + inputs: |
| 224 | + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) |
| 225 | + scriptLocation: "inlineScript" |
| 226 | + scriptType: "bash" |
| 227 | + addSpnToEnvironment: true |
| 228 | + inlineScript: | |
| 229 | + set -ex |
| 230 | + make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID) |
| 231 | + name: "GetCluster" |
| 232 | + displayName: "Get AKS Cluster" |
| 233 | + - script: | |
| 234 | + kubectl delete ns load-test |
| 235 | + cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors,!no-unexpected-packet-drops' |
| 236 | + retryCountOnTaskFailure: 6 |
| 237 | + name: "CiliumConnectivityTests" |
| 238 | + displayName: "Run Cilium Connectivity Tests" |
| 239 | + - script: | |
| 240 | + cd hack/scripts |
| 241 | + chmod +x async-delete-test.sh |
| 242 | + ./async-delete-test.sh |
| 243 | + if ! [ -z $(kubectl -n kube-system get ds azure-cns | grep non-existing) ]; then |
| 244 | + kubectl -n kube-system patch daemonset azure-cns --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' |
| 245 | + fi |
| 246 | + name: "testAsyncDelete" |
| 247 | + displayName: "Verify Async Delete when CNS is down" |
| 248 | + - template: ../k8s-e2e/k8s-e2e.stages.yaml |
| 249 | + parameters: |
| 250 | + sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) |
| 251 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 252 | + os: ${{ parameters.os }} |
| 253 | + cni: cilium |
| 254 | + dependsOn: cni_tests |
| 255 | + dns: true |
| 256 | + portforward: true |
| 257 | + service: true |
| 258 | + ${{ if eq(parameters.dualstackVersion, '') }}: |
| 259 | + datapath: true |
| 260 | + ${{ else }}: |
| 261 | + dualstack: true |
| 262 | + - job: failedE2ELogs |
| 263 | + displayName: "Failure Logs" |
| 264 | + dependsOn: |
| 265 | + - deploy_cilium_components |
| 266 | + - deploy_pods |
| 267 | + - restart_nodes |
| 268 | + - restart_cns |
| 269 | + - cni_tests |
| 270 | + - cni_${{ parameters.os }} |
| 271 | + condition: failed() |
| 272 | + steps: |
| 273 | + - template: ../../templates/log-template.yaml |
| 274 | + parameters: |
| 275 | + clusterName: ${{ parameters.clusterName }}-$(commitID) |
| 276 | + os: linux |
| 277 | + cni: cilium |
0 commit comments