|
| 1 | +pr: none |
| 2 | +trigger: none |
| 3 | + |
| 4 | +stages: |
| 5 | + - stage: creating_aks_cluster |
| 6 | + displayName: "Create AKS Cluster with Cilium" |
| 7 | + jobs: |
| 8 | + - job: create_aks_cluster_with_cilium |
| 9 | + 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-cilium-up AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${RESOURCE_GROUP} NODE_COUNT=10 VM_SIZE=Standard_DS4_v2 |
| 20 | + name: "CreateAksCluster" |
| 21 | + displayName: "Create AKS Cluster" |
| 22 | + - stage: pod_deployment |
| 23 | + dependsOn: creating_aks_cluster |
| 24 | + displayName: "Pod Deployment" |
| 25 | + jobs: |
| 26 | + - job: deploy_pods |
| 27 | + steps: |
| 28 | + - task: AzureCLI@1 |
| 29 | + displayName: "Pod Deployment" |
| 30 | + inputs: |
| 31 | + azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) |
| 32 | + scriptLocation: "inlineScript" |
| 33 | + scriptType: "bash" |
| 34 | + addSpnToEnvironment: true |
| 35 | + inlineScript: | |
| 36 | + set -ex |
| 37 | + az extension add --name aks-preview |
| 38 | + make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP} |
| 39 | + bash hack/scripts/scale_deployment.sh |
| 40 | + - stage: validate_state |
| 41 | + dependsOn: pod_deployment |
| 42 | + displayName: "Validate State" |
| 43 | + jobs: |
| 44 | + - job: validate_state |
| 45 | + steps: |
| 46 | + - task: AzureCLI@1 |
| 47 | + inputs: |
| 48 | + azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) |
| 49 | + scriptLocation: "inlineScript" |
| 50 | + scriptType: "bash" |
| 51 | + addSpnToEnvironment: true |
| 52 | + inlineScript: | |
| 53 | + make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP} |
| 54 | + kubectl get pods -A |
| 55 | + bash hack/scripts/validate_state.sh |
| 56 | + name: "ValidateState" |
| 57 | + displayName: "Validate State" |
| 58 | + retryCountOnTaskFailure: 3 |
| 59 | + - stage: connectivity_tests |
| 60 | + dependsOn: validate_state |
| 61 | + displayName: "Connectivity Tests" |
| 62 | + jobs: |
| 63 | + - job: cni_tests |
| 64 | + steps: |
| 65 | + - script: | |
| 66 | + echo "install cilium CLI" |
| 67 | + CILIUM_CLI_VERSION=v0.13.2 |
| 68 | + CLI_ARCH=amd64 |
| 69 | + curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} |
| 70 | + sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum |
| 71 | + sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin |
| 72 | + rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} |
| 73 | + name: "InstallCiliumCli" |
| 74 | + displayName: "Install Cilium CLI" |
| 75 | + - task: AzureCLI@1 |
| 76 | + inputs: |
| 77 | + azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) |
| 78 | + scriptLocation: "inlineScript" |
| 79 | + scriptType: "bash" |
| 80 | + addSpnToEnvironment: true |
| 81 | + inlineScript: | |
| 82 | + set -ex |
| 83 | + make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP} |
| 84 | + name: "GetCluster" |
| 85 | + displayName: "Get AKS Cluster" |
| 86 | + - script: | |
| 87 | + cilium connectivity test |
| 88 | + retryCountOnTaskFailure: 6 |
| 89 | + name: "CiliumConnectivityTests" |
| 90 | + displayName: "Run Cilium Connectivity Tests" |
| 91 | + - stage: delete |
| 92 | + displayName: "Delete Resources" |
| 93 | + dependsOn: |
| 94 | + - connectivity_tests |
| 95 | + jobs: |
| 96 | + - job: delete_resources |
| 97 | + steps: |
| 98 | + - task: AzureCLI@1 |
| 99 | + inputs: |
| 100 | + azureSubscription: $(TEST_SUB_SERVICE_CONNECTION) |
| 101 | + scriptLocation: "inlineScript" |
| 102 | + scriptType: "bash" |
| 103 | + addSpnToEnvironment: true |
| 104 | + inlineScript: | |
| 105 | + set -ex |
| 106 | + if [ "$(DELETE_RESOURCES)" ] |
| 107 | + then |
| 108 | + echo "Deleting Cluster and resource group" |
| 109 | + make -C ./hack/swift set-kubeconf AZCLI=az CLUSTER=${RESOURCE_GROUP} |
| 110 | + make -C ./hack/swift azcfg AZCLI=az REGION=$(LOCATION) |
| 111 | + make -C ./hack/swift down AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${RESOURCE_GROUP} |
| 112 | + echo "Cluster and resources down" |
| 113 | + else |
| 114 | + echo "Deletion of resources is False" |
| 115 | + fi |
| 116 | + name: "CleanUpCluster" |
| 117 | + displayName: "Cleanup cluster" |
| 118 | + condition: always() |
0 commit comments