Skip to content

Commit 9e1942d

Browse files
gke: Run cilium-cli inside a container
Update gke.yaml to run cilium-cli inside a container instead of using cilium-cli-test-job-chart. Ref: #2623 Ref: #2627 Ref: cilium/design-cfps#9 Signed-off-by: Michi Mutsuzaki <[email protected]>
1 parent 9658f02 commit 9e1942d

File tree

2 files changed

+26
-70
lines changed

2 files changed

+26
-70
lines changed

.github/in-cluster-test-scripts/gke.sh

-31
This file was deleted.

.github/workflows/gke.yaml

+26-39
Original file line numberDiff line numberDiff line change
@@ -127,55 +127,42 @@ jobs:
127127
run: |
128128
gcloud container clusters get-credentials ${{ env.clusterName }} --zone ${{ env.zone }}
129129
130-
- name: Create gcloud-free kubeconfig and load it in configmap
131-
run: |
132-
.github/get-kubeconfig.sh
133-
kubectl create configmap cilium-cli-kubeconfig -n kube-system --from-file kubeconfig
130+
- name: Install Cilium CLI
131+
uses: ./
132+
with:
133+
skip-build: 'true'
134+
image-tag: ${{ steps.vars.outputs.sha }}
134135

135-
- name: Load test script in configmap
136+
- name: Run test
136137
run: |
137-
kubectl create configmap cilium-cli-test-script -n kube-system --from-file=in-cluster-test-script.sh=.github/in-cluster-test-scripts/gke.sh
138+
cilium install \
139+
--version "${{ env.cilium_version }}" \
140+
--set cluster.name="${{ env.clusterName }}" \
141+
--set bpf.monitorAggregation=none \
142+
--set loadBalancer.l7.backend=envoy \
143+
--set tls.secretsBackend=k8s
138144
139-
- name: Create cilium-cli job
140-
run: |
141-
helm install .github/cilium-cli-test-job-chart \
142-
--generate-name \
143-
--set tag=${{ steps.vars.outputs.sha }} \
144-
--set cilium_version=${{ env.cilium_version }} \
145-
--set cluster_name=${{ env.clusterName }} \
146-
--set cluster_cidr=${{ steps.cluster.outputs.cluster_cidr }}
147-
148-
- name: Wait for test job
149-
env:
150-
timeout: 45m
151-
run: |
152-
# Background wait for job to complete or timeout
153-
kubectl -n kube-system wait job/cilium-cli --for=condition=complete --timeout=${{ env.timeout }} &
154-
complete_pid=$!
145+
# Enable Relay
146+
cilium hubble enable
155147
156-
# Background wait for job to fail
157-
(kubectl -n kube-system wait job/cilium-cli --for=condition=failed --timeout=${{ env.timeout }} && exit 1) &
158-
failed_pid=$!
148+
# Wait for cilium and hubble relay to be ready
149+
# NB: necessary to work against occassional flakes due to https://github.com/cilium/cilium-cli/issues/918
150+
cilium status --wait
159151
160-
# Active wait for whichever background process ends first
161-
wait -n $complete_pid $failed_pid
162-
EXIT_CODE=$?
152+
# Port forward Relay
153+
cilium hubble port-forward&
154+
sleep 10s
155+
[[ $(pgrep -f "kubectl.*port-forward.*hubble-relay" | wc -l) == 1 ]]
163156
164-
# Retrieve job logs
165-
kubectl logs --timestamps -n kube-system job/cilium-cli
166-
exit ${EXIT_CODE}
167-
shell: bash {0} # Disable default fail-fast behaviour so that all commands run independently
157+
# Run connectivity test
158+
cilium connectivity test --all-flows --collect-sysdump-on-failure --external-target google.com.
159+
160+
# Run performance test
161+
cilium connectivity perf --duration 1s
168162
169163
- name: Post-test information gathering
170164
if: ${{ !success() }}
171165
run: |
172-
echo "=== Install latest stable CLI ==="
173-
curl -sSL --remote-name-all https://github.com/cilium/cilium-cli/releases/latest/download/cilium-linux-amd64.tar.gz{,.sha256sum}
174-
sha256sum --check cilium-linux-amd64.tar.gz.sha256sum
175-
sudo tar xzvfC cilium-linux-amd64.tar.gz /usr/bin
176-
rm cilium-linux-amd64.tar.gz{,.sha256sum}
177-
cilium version
178-
179166
echo "=== Retrieve cluster state ==="
180167
kubectl get pods --all-namespaces -o wide
181168
cilium status

0 commit comments

Comments
 (0)