-
Notifications
You must be signed in to change notification settings - Fork 242
/
Copy pathcilium-overlay-e2e-step-template.yaml
165 lines (150 loc) · 6.02 KB
/
cilium-overlay-e2e-step-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
parameters:
name: ""
testDropgz: ""
clusterName: ""
steps:
- bash: |
echo $UID
sudo rm -rf $(System.DefaultWorkingDirectory)/*
displayName: "Set up OS environment"
- checkout: self
- bash: |
go version
go env
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
name: "GoEnv"
displayName: "Set up the Go environment"
- task: AzureCLI@1
inputs:
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
addSpnToEnvironment: true
inlineScript: |
mkdir -p ~/.kube/
echo "Create AKS Overlay cluster"
make -C ./hack/swift azcfg AZCLI=az REGION=$(REGION_OVERLAY_CLUSTER_TEST)
make -C ./hack/swift overlay-no-kube-proxy-up AZCLI=az REGION=$(REGION_OVERLAY_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision)
echo "Cluster successfully created"
displayName: Create Overlay cluster
condition: succeeded()
- script: |
ls -lah
pwd
echo "installing kubectl"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl cluster-info
kubectl get po -owide -A
echo "deploy Cilium ConfigMap"
kubectl apply -f cilium/configmap.yaml
kubectl apply -f test/integration/manifests/cilium/cilium-config.yaml
echo "install Cilium onto Overlay Cluster"
kubectl apply -f test/integration/manifests/cilium/cilium-agent
kubectl apply -f test/integration/manifests/cilium/cilium-operator
kubectl get po -owide -A
name: "installCilium"
displayName: "Install Cilium on AKS Overlay"
- script: |
echo "install cilium CLI"
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
CLI_ARCH=amd64
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
cilium status
name: "installCiliumCLI"
displayName: "Install Cilium CLI"
- script: |
echo "install kubetest2 and gsutils"
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
go install github.com/onsi/ginkgo/ginkgo@latest
go install sigs.k8s.io/kubetest2@latest
go install sigs.k8s.io/kubetest2/kubetest2-noop@latest
go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest
wget https://storage.googleapis.com/pub/gsutil.tar.gz
tar xfz gsutil.tar.gz
sudo mv gsutil /usr/local/bin
name: "installKubetest"
displayName: "Set up Conformance Tests"
- script: |
echo "Start Azilium E2E Tests on Overlay Cluster"
echo "deploy ip-masq-agent for overlay"
kubectl create -f test/integration/manifests/ip-masq-agent/ip-masq-agent.yaml --validate=false
cd test/integration/manifests/ip-masq-agent/
kubectl create configmap config-custom.yaml
kubectl create configmap config-reconcile.yaml
cd ../../../..
kubectl get po -owide -A
sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_OVERLAY=true TEST_DROPGZ=${{ parameters.testDropgz }}
retryCountOnTaskFailure: 3
name: "aziliumTest"
displayName: "Run Azilium E2E on AKS Overlay"
- script: |
echo "Logs will be available as a build artifact"
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/
echo $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo mkdir $ARTIFACT_DIR
sudo cp test/integration/logs/* $ARTIFACT_DIR
name: "GetLogs"
displayName: "Get logs"
condition: always()
- task: PublishBuildArtifacts@1
inputs:
artifactName: test-output
pathtoPublish: "$(Build.ArtifactStagingDirectory)/test-output"
condition: always()
- script: |
echo "Run Service Conformance E2E"
export PATH=${PATH}:/usr/local/bin/gsutil
KUBECONFIG=~/.kube/config kubetest2 noop \
--test ginkgo -- \
--focus-regex "Services.*\[Conformance\].*"
name: "servicesConformance"
displayName: "Run Services Conformance Tests"
- script: |
echo "Run Cilium Connectivity Tests"
cilium status
cilium connectivity test
name: "ciliumConnectivityTests"
displayName: "Run Cilium Connectivity Tests"
- script: |
echo "validate pod IP assignment and check systemd-networkd restart"
kubectl get pod -owide -A
make test-validate-state
echo "delete cilium connectivity test resources and re-validate state"
kubectl delete ns cilium-test
kubectl get pod -owide -A
make test-validate-state
name: "validatePods"
displayName: "Validate Pods"
- script: |
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/
echo $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo rm -rf test/integration/logs
name: "Cleanupartifactdir"
displayName: "Cleanup artifact dir"
condition: always()
- task: AzureCLI@2
inputs:
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
addSpnToEnvironment: true
inlineScript: |
echo "Deleting cluster"
make -C ./hack/swift azcfg AZCLI=az
make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
echo "Cluster and resources down"
name: "Cleanupcluster"
displayName: "Cleanup cluster"
condition: always()