Skip to content

Commit 7d56d36

Browse files
authored
ci: cleanup Cilium cli and connectivity test usage (#3772)
* ci: update lsg connectivity/cli * ci: update Connectivity test usages to template call * fix: replace ciliumNamespace var
1 parent caa1685 commit 7d56d36

12 files changed

+61
-101
lines changed

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ stages:
6565
- ${{ if eq(parameters.upgradeScenario, false) }}:
6666
- create_${{ parameters.name }}
6767
- ${{ else }}:
68-
- ${{ parameters.dependsOn }}
68+
- ${{ parameters.dependsOn }}
6969
- publish
7070
- setup
7171
displayName: "Cilium Test - ${{ parameters.name }}"
@@ -122,7 +122,7 @@ stages:
122122
123123
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
124124
kubectl get po -owide -A
125-
125+
126126
- ${{if eq(parameters.hubbleEnabled, true)}}:
127127
- job: deploy_cilium_components
128128
displayName: Deploy Cilium with Hubble
@@ -184,7 +184,7 @@ stages:
184184
IPAM=$(UPGRADE_AZURE_IPAM_VERSION)
185185
echo "UPGRADE_AZURE_IPAM_VERSION is set to $IPAM"
186186
fi
187-
187+
188188
if [ -z "$UPGRADE_CNS_VERSION" ]
189189
then
190190
echo "UPGRADE_CNS_VERSION is not set, using default value"
@@ -214,9 +214,9 @@ stages:
214214
echo "TEST_CNS_VERSION is set to $CNS"
215215
fi
216216
fi
217-
217+
218218
echo "Deploy Azure-CNS"
219-
sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) IPAM_IMAGE_REPO=$(IPAM_IMAGE_REPO)
219+
sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO) IPAM_IMAGE_REPO=$(IPAM_IMAGE_REPO)
220220
kubectl get po -owide -A
221221
kubectl get crd -A
222222
@@ -287,12 +287,7 @@ stages:
287287
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
288288
name: "GetCluster"
289289
displayName: "Get AKS Cluster"
290-
- script: |
291-
kubectl delete ns load-test
292-
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'
293-
retryCountOnTaskFailure: 6
294-
name: "CiliumConnectivityTests"
295-
displayName: "Run Cilium Connectivity Tests"
290+
- template: ../../templates/cilium-connectivity-tests.yaml
296291
- script: |
297292
cd hack/scripts
298293
chmod +x async-delete-test.sh

.pipelines/cni/cilium/nightly-release-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ stages:
162162
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=ciliumnightly-$(commitID)
163163
164164
set -e
165-
echo "Run Cilium Connectivity Tests"
165+
echo "Check Cilium Connectivity Test Logs"
166166
cilium status
167167
cilium connectivity test --test check-log-errors --log-check-levels error
168-
name: "ciliumConnectivityTests"
169-
displayName: "Run Cilium Connectivity Tests"
168+
name: "ciliumConnectivityLogs"
169+
displayName: "Check Cilium Connectivity Test Logs"
170170
condition: always()
171171

172172
- template: ../../templates/log-check-template.yaml # Operator Check

.pipelines/cni/lsg/lsg-cni-intergration-template.yaml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,7 @@ stages:
187187
dependsOn: recover
188188
condition: and( succeeded(), ${{ contains(parameters.cni, 'cilium') }} )
189189
steps:
190-
- script: |
191-
echo "install cilium CLI"
192-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
193-
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
194-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
195-
else
196-
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
197-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
198-
fi
199-
CLI_ARCH=amd64
200-
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
201-
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
202-
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
203-
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
204-
cilium status
205-
cilium version
206-
name: "InstallCiliumCli"
207-
displayName: "Install Cilium CLI"
190+
- template: ../../templates/cilium-cli.yaml
208191
- task: AzureCLI@2
209192
inputs:
210193
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
@@ -216,12 +199,7 @@ stages:
216199
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
217200
name: "GetCluster"
218201
displayName: "Get AKS Cluster"
219-
- script: |
220-
kubectl delete ns load-test
221-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors'
222-
retryCountOnTaskFailure: 6
223-
name: "CiliumConnectivityTests"
224-
displayName: "Run Cilium Connectivity Tests"
202+
- template: ../../templates/cilium-connectivity-tests.yaml
225203
- ${{ if contains(parameters.cni, 'cilium') }}:
226204
- template: ../k8s-e2e/k8s-e2e-job-template.yaml
227205
parameters:

.pipelines/networkobservability/pipeline.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,9 @@ stages:
113113
displayName: "Wait for all pods to be running"
114114
retryCountOnTaskFailure: 3
115115
116-
- script: |
117-
echo "Run Cilium Connectivity Tests"
118-
cilium status
119-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors'
120-
retryCountOnTaskFailure: 3
121-
name: "ciliumConnectivityTests"
122-
displayName: "Run Cilium Connectivity Tests"
123-
enabled: true
116+
- template: ../templates/cilium-connectivity-tests.yaml
117+
parameters:
118+
skipTests: '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors,!to-fqdns'
124119

125120
- script: |
126121
export DIR=${CILIUM_VERSION_TAG%.*}

.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e-step-template.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,14 @@ steps:
107107
displayName: "Validate Node Restart"
108108
retryCountOnTaskFailure: 3
109109

110+
- template: ../../templates/cilium-connectivity-tests.yaml
111+
110112
- script: |
111-
set -e
112-
echo "Run Cilium Connectivity Tests"
113-
cilium status
114-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!no-unexpected-packet-drops,!check-log-errors' --force-deploy
115113
ns=`kubectl get ns | grep cilium-test | awk '{print $1}'`
116114
echo "##vso[task.setvariable variable=ciliumNamespace]$ns"
117115
retryCountOnTaskFailure: 3
118-
name: "ciliumConnectivityTests"
119-
displayName: "Run Cilium Connectivity Tests"
116+
name: "nsCapture"
117+
displayName: "Capture Connectivity Test Namespace"
120118
121119
- script: |
122120
set -e
@@ -158,5 +156,5 @@ steps:
158156
fi
159157
name: "testAsyncDelete"
160158
displayName: "Verify Async Delete when CNS is down"
161-
159+
162160
- template: ../../templates/cilium-mtu-check.yaml

.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.steps.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ steps:
6464
SCALE_UP=32 OS_TYPE=linux CNI_TYPE=cilium_dualstack VALIDATE_STATEFILE=true \
6565
INSTALL_CNS=true INSTALL_OVERLAY=true CLEANUP=true \
6666
AZURE_IPAM_VERSION=$(AZURE_IPAM_VERSION) CNS_VERSION=$(CNS_VERSION) \
67-
IPAM_IMAGE_NAME_OVERRIDE=$(IPAM_IMAGE_NAME_OVERRIDE) CNS_IMAGE_NAME_OVERRIDE=$(CNS_IMAGE_NAME_OVERRIDE)
67+
IPAM_IMAGE_NAME_OVERRIDE=$(IPAM_IMAGE_NAME_OVERRIDE) CNS_IMAGE_NAME_OVERRIDE=$(CNS_IMAGE_NAME_OVERRIDE)
6868
retryCountOnTaskFailure: 3
6969
name: "aziliumTest"
7070
displayName: "Run Azilium E2E on AKS Overlay"
@@ -116,16 +116,14 @@ steps:
116116
displayName: "Validate Node Restart"
117117
retryCountOnTaskFailure: 3
118118

119+
- template: ../../templates/cilium-connectivity-tests.yaml
120+
119121
- script: |
120-
set -e
121-
echo "Run Cilium Connectivity Tests"
122-
cilium status
123-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!no-unexpected-packet-drops,!check-log-errors' --force-deploy
124122
ns=`kubectl get ns | grep cilium-test | awk '{print $1}'`
125123
echo "##vso[task.setvariable variable=ciliumNamespace]$ns"
126124
retryCountOnTaskFailure: 3
127-
name: "ciliumConnectivityTests"
128-
displayName: "Run Cilium Connectivity Tests"
125+
name: "nsCapture"
126+
displayName: "Capture Connectivity Test Namespace"
129127
130128
- script: |
131129
set -e
@@ -170,5 +168,5 @@ steps:
170168
fi
171169
name: "testAsyncDelete"
172170
displayName: "Verify Async Delete when CNS is down"
173-
171+
174172
- template: ../../templates/cilium-mtu-check.yaml

.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e-step-template.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,14 @@ steps:
111111
displayName: "Validate Node Restart"
112112
retryCountOnTaskFailure: 3
113113

114+
- template: ../../templates/cilium-connectivity-tests.yaml
115+
114116
- script: |
115-
set -e
116-
echo "Run Cilium Connectivity Tests"
117-
cilium status
118-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors' --force-deploy
119117
ns=`kubectl get ns | grep cilium-test | awk '{print $1}'`
120118
echo "##vso[task.setvariable variable=ciliumNamespace]$ns"
121119
retryCountOnTaskFailure: 3
122-
name: "ciliumConnectivityTests"
123-
displayName: "Run Cilium Connectivity Tests"
120+
name: "nsCapture"
121+
displayName: "Capture Connectivity Test Namespace"
124122
125123
- ${{ if eq( parameters['testHubble'], true) }}:
126124
- script: |

.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.steps.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,14 @@ steps:
109109
displayName: "Validate Node Restart"
110110
retryCountOnTaskFailure: 3
111111

112+
- template: ../../templates/cilium-connectivity-tests.yaml
113+
112114
- script: |
113-
set -e
114-
echo "Run Cilium Connectivity Tests"
115-
cilium status
116-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors' --force-deploy
117115
ns=`kubectl get ns | grep cilium-test | awk '{print $1}'`
118116
echo "##vso[task.setvariable variable=ciliumNamespace]$ns"
119117
retryCountOnTaskFailure: 3
120-
name: "ciliumConnectivityTests"
121-
displayName: "Run Cilium Connectivity Tests"
118+
name: "nsCapture"
119+
displayName: "Capture Connectivity Test Namespace"
122120
123121
- ${{ if eq( parameters['testHubble'], true) }}:
124122
- script: |
@@ -198,7 +196,7 @@ steps:
198196
fi
199197
name: "testAsyncDelete"
200198
displayName: "Verify Async Delete when CNS is down"
201-
199+
202200
- template: ../../templates/cilium-mtu-check.yaml
203201

204202
- script: |

.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,14 @@ steps:
144144
displayName: "Validate Node Restart"
145145
retryCountOnTaskFailure: 3
146146

147+
- template: ../../templates/cilium-connectivity-tests.yaml
148+
147149
- script: |
148-
set -e
149-
echo "Run Cilium Connectivity Tests"
150-
cilium status
151-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors' --force-deploy
152150
ns=`kubectl get ns | grep cilium-test | awk '{print $1}'`
153151
echo "##vso[task.setvariable variable=ciliumNamespace]$ns"
154152
retryCountOnTaskFailure: 3
155-
name: "ciliumConnectivityTests"
156-
displayName: "Run Cilium Connectivity Tests"
153+
name: "nsCapture"
154+
displayName: "Capture Connectivity Test Namespace"
157155
158156
- ${{ if eq( parameters['testHubble'], true) }}:
159157
- script: |
@@ -238,4 +236,4 @@ steps:
238236
name: "testAsyncDelete"
239237
displayName: "Verify Async Delete when CNS is down"
240238
241-
- template: ../../templates/cilium-mtu-check.yaml
239+
- template: ../../templates/cilium-mtu-check.yaml

.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.steps.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ steps:
8080
SCALE_UP=32 OS_TYPE=linux VALIDATE_STATEFILE=true \
8181
INSTALL_CNS=true INSTALL_OVERLAY=true CLEANUP=true \
8282
AZURE_IPAM_VERSION=$(AZURE_IPAM_VERSION) CNS_VERSION=$(CNS_VERSION) \
83-
IPAM_IMAGE_NAME_OVERRIDE=$(IPAM_IMAGE_NAME_OVERRIDE) CNS_IMAGE_NAME_OVERRIDE=$(CNS_IMAGE_NAME_OVERRIDE)
83+
IPAM_IMAGE_NAME_OVERRIDE=$(IPAM_IMAGE_NAME_OVERRIDE) CNS_IMAGE_NAME_OVERRIDE=$(CNS_IMAGE_NAME_OVERRIDE)
8484
retryCountOnTaskFailure: 3
8585
name: "aziliumTest"
8686
displayName: "Run Azilium E2E on AKS Overlay"
@@ -142,16 +142,14 @@ steps:
142142
displayName: "Validate Node Restart"
143143
retryCountOnTaskFailure: 3
144144

145+
- template: ../../templates/cilium-connectivity-tests.yaml
146+
145147
- script: |
146-
set -e
147-
echo "Run Cilium Connectivity Tests"
148-
cilium status
149-
cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption,!check-log-errors' --force-deploy
150148
ns=`kubectl get ns | grep cilium-test | awk '{print $1}'`
151149
echo "##vso[task.setvariable variable=ciliumNamespace]$ns"
152150
retryCountOnTaskFailure: 3
153-
name: "ciliumConnectivityTests"
154-
displayName: "Run Cilium Connectivity Tests"
151+
name: "nsCapture"
152+
displayName: "Capture Connectivity Test Namespace"
155153
156154
- ${{ if eq( parameters['testHubble'], true) }}:
157155
- script: |
@@ -248,7 +246,7 @@ steps:
248246
fi
249247
name: "testAsyncDelete"
250248
displayName: "Verify Async Delete when CNS is down"
251-
249+
252250
- template: ../../templates/cilium-mtu-check.yaml
253-
251+
254252

0 commit comments

Comments
 (0)