forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
688 lines (613 loc) · 27.9 KB
/
conformance-clustermesh.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
name: Conformance Cluster Mesh (ci-clustermesh)
# Any change in triggers needs to be reflected in the concurrency group.
on:
workflow_dispatch:
inputs:
PR-number:
description: "Pull request number."
required: true
context-ref:
description: "Context in which the workflow runs. If PR is from a fork, will be the PR target branch (general case). If PR is NOT from a fork, will be the PR branch itself (this allows committers to test changes to workflows directly from PRs)."
required: true
SHA:
description: "SHA under test (head of the PR branch)."
required: true
extra-args:
description: "[JSON object] Arbitrary arguments passed from the trigger comment via regex capture group. Parse with 'fromJson(inputs.extra-args).argName' in workflow."
required: false
default: '{}'
push:
branches:
- main
- ft/main/**
- 'renovate/main-**'
paths-ignore:
- 'Documentation/**'
# By specifying the access of one of the scopes, all of those that are not
# specified are set to 'none'.
permissions:
# To read actions state with catchpoint/workflow-telemetry-action
actions: read
# To be able to access the repository with actions/checkout
contents: read
# To allow retrieving information from the PR API
pull-requests: read
# To be able to set commit status
statuses: write
concurrency:
# Structure:
# - Workflow name
# - Event type
# - A unique identifier depending on event type:
# - push: SHA
# - workflow_dispatch: PR number
#
# This structure ensures a unique concurrency group name is generated for each
# type of testing, such that re-runs will cancel the previous run.
group: |
${{ github.workflow }}
${{ github.event_name }}
${{
(github.event_name == 'push' && github.sha) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.PR-number)
}}
cancel-in-progress: true
env:
clusterName1: cluster1-${{ github.run_id }}
clusterName2: cluster2-${{ github.run_id }}
ciliumClusterName1: c1
ciliumClusterName2: cluster2-with-long-name-01234567
contextName1: kind-cluster1-${{ github.run_id }}
contextName2: kind-cluster2-${{ github.run_id }}
# renovate: datasource=github-releases depName=cert-manager/cert-manager
CERT_MANAGER_VERSION: v1.17.0
jobs:
echo-inputs:
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Echo Workflow Dispatch Inputs
runs-on: ubuntu-24.04
steps:
- name: Echo Workflow Dispatch Inputs
run: |
echo '${{ tojson(inputs) }}'
commit-status-start:
name: Commit Status Start
runs-on: ubuntu-24.04
steps:
- name: Set initial commit status
uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1
with:
sha: ${{ inputs.SHA || github.sha }}
wait-for-images:
name: Wait for images
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout context ref (trusted)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.context-ref || github.sha }}
persist-credentials: false
- name: Wait for images
uses: ./.github/actions/wait-for-images
with:
SHA: ${{ inputs.SHA }}
images: cilium-ci operator-generic-ci hubble-relay-ci clustermesh-apiserver-ci cilium-cli-ci
installation-and-connectivity:
needs: [wait-for-images]
name: Installation and Connectivity Test
runs-on: ${{ vars.GH_RUNNER_EXTRA_POWER_UBUNTU_LATEST || 'ubuntu-24.04' }}
timeout-minutes: 60
env:
job_name: "Installation and Connectivity Test"
strategy:
fail-fast: false
matrix:
include:
- name: '1'
tunnel: 'disabled'
ipFamily: 'ipv4'
encryption: 'disabled'
kube-proxy: 'iptables'
mode: 'kvstoremesh'
tls-auto-method: helm
cm-auth-mode-1: 'legacy'
cm-auth-mode-2: 'legacy'
maxConnectedClusters: '255'
ciliumEndpointSlice: 'enabled'
- name: '2'
tunnel: 'disabled'
ipFamily: 'dual'
encryption: 'wireguard'
kube-proxy: 'none'
mode: 'clustermesh'
tls-auto-method: cronJob
cm-auth-mode-1: 'migration'
cm-auth-mode-2: 'migration'
maxConnectedClusters: '511'
ciliumEndpointSlice: 'disabled'
- name: '3'
tunnel: 'disabled'
ipFamily: 'dual'
encryption: 'ipsec'
kube-proxy: 'none'
mode: 'kvstoremesh'
tls-auto-method: certmanager
cm-auth-mode-1: 'cluster'
cm-auth-mode-2: 'cluster'
maxConnectedClusters: '255'
ciliumEndpointSlice: 'disabled'
# IPsec encryption is currently not supported in case of ipv6-only clusters (#23553)
# Wireguard encryption is currently affected by a bug in case of ipv6-only clusters (#23917)
- name: '4'
tunnel: 'disabled'
ipFamily: 'ipv6'
encryption: 'disabled'
kube-proxy: 'none'
mode: 'clustermesh'
tls-auto-method: certmanager
cm-auth-mode-1: 'legacy'
cm-auth-mode-2: 'migration'
maxConnectedClusters: '255'
ciliumEndpointSlice: 'disabled'
- name: '5'
tunnel: 'disabled'
ipFamily: 'dual'
encryption: 'ipsec'
kube-proxy: 'iptables'
mode: 'external'
tls-auto-method: helm
maxConnectedClusters: '255'
ciliumEndpointSlice: 'disabled'
- name: '6'
tunnel: 'vxlan'
ipFamily: 'ipv4'
encryption: 'disabled'
kube-proxy: 'none'
mode: 'clustermesh'
tls-auto-method: helm
cm-auth-mode-1: 'cluster'
cm-auth-mode-2: 'cluster'
maxConnectedClusters: '255'
ciliumEndpointSlice: 'enabled'
- name: '7'
tunnel: 'geneve'
ipFamily: 'dual'
encryption: 'wireguard'
kube-proxy: 'iptables'
mode: 'kvstoremesh'
tls-auto-method: cronJob
cm-auth-mode-1: 'migration'
cm-auth-mode-2: 'cluster'
maxConnectedClusters: '511'
ciliumEndpointSlice: 'disabled'
- name: '8'
tunnel: 'vxlan'
ipFamily: 'dual'
encryption: 'ipsec'
kube-proxy: 'iptables'
mode: 'clustermesh'
tls-auto-method: certmanager
cm-auth-mode-1: 'cluster'
cm-auth-mode-2: 'cluster'
maxConnectedClusters: '255'
ciliumEndpointSlice: 'disabled'
# Tunneling is currently not supported in case of ipv6-only clusters (#17240)
# - name: '9'
# tunnel: 'vxlan'
# ipFamily: 'ipv6'
# encryption: 'disabled'
# kube-proxy: 'none'
# mode: 'kvstoremesh'
# tls-auto-method: certmanager
# cm-auth-mode-1: 'cluster'
# cm-auth-mode-2: 'cluster'
- name: '10'
tunnel: 'vxlan'
ipFamily: 'dual'
encryption: 'wireguard'
kube-proxy: 'iptables'
mode: 'external'
tls-auto-method: helm
maxConnectedClusters: '511'
ciliumEndpointSlice: 'disabled'
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@94c3c3d9567a0205de6da68a76c428ce4e769af1 # v2.0.0
with:
comment_on_pr: false
- name: Checkout context ref (trusted)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.context-ref || github.sha }}
persist-credentials: false
- name: Set Environment Variables
uses: ./.github/actions/set-env-variables
- name: Get Cilium's default values
id: default_vars
uses: ./.github/actions/helm-default
with:
image-tag: ${{ inputs.SHA || github.sha }}
chart-dir: ./untrusted/install/kubernetes/cilium
- name: Set up job variables for GHA environment
id: vars
run: |
CILIUM_INSTALL_DEFAULTS="${{ steps.default_vars.outputs.cilium_install_defaults }} \
--helm-set=kubeProxyReplacement=${{ matrix.kube-proxy == 'none' }} \
--helm-set=bpf.masquerade=${{ matrix.kube-proxy == 'none' }} \
--helm-set=hubble.enabled=true \
--helm-set=hubble.relay.enabled=true \
--helm-set=hubble.tls.auto.method=${{ matrix.tls-auto-method }} \
--helm-set=hubble.tls.auto.certManagerIssuerRef.group=cert-manager.io \
--helm-set=hubble.tls.auto.certManagerIssuerRef.kind=Issuer \
--helm-set=hubble.tls.auto.certManagerIssuerRef.name=cilium \
--helm-set=clustermesh.useAPIServer=${{ matrix.mode != 'external' }} \
--helm-set=clustermesh.apiserver.kvstoremesh.enabled=${{ matrix.mode == 'kvstoremesh' }} \
--helm-set=clustermesh.maxConnectedClusters=${{ matrix.maxConnectedClusters }} \
--helm-set=clustermesh.enableEndpointSliceSynchronization=true \
--helm-set=clustermesh.apiserver.tls.auto.method=${{ matrix.tls-auto-method }} \
--helm-set=clustermesh.apiserver.tls.auto.certManagerIssuerRef.group=cert-manager.io \
--helm-set=clustermesh.apiserver.tls.auto.certManagerIssuerRef.kind=Issuer \
--helm-set=clustermesh.apiserver.tls.auto.certManagerIssuerRef.name=cilium \
--helm-set=ciliumEndpointSlice.enabled=${{ matrix.ciliumEndpointSlice == 'enabled'}} \
--helm-set=extraConfig.clustermesh-sync-timeout=5m \
"
CILIUM_INSTALL_TUNNEL="--helm-set=tunnelProtocol=${{ matrix.tunnel }}"
if [ "${{ matrix.tunnel }}" == "disabled" ]; then
CILIUM_INSTALL_TUNNEL="--helm-set-string=routingMode=native \
--helm-set=autoDirectNodeRoutes=true \
--helm-set=ipv4NativeRoutingCIDR=10.240.0.0/12 \
--helm-set=ipv6NativeRoutingCIDR=fd00:10:240::/44"
fi
case "${{ matrix.ipFamily }}" in
ipv4)
CILIUM_INSTALL_IPFAMILY="--helm-set=ipv4.enabled=true --helm-set=ipv6.enabled=false"
KIND_POD_CIDR_1="10.242.0.0/16"
KIND_SVC_CIDR_1="10.243.0.0/16"
KIND_POD_CIDR_2="10.244.0.0/16"
KIND_SVC_CIDR_2="10.245.0.0/16"
;;
ipv6)
CILIUM_INSTALL_IPFAMILY="--helm-set=ipv4.enabled=false --helm-set=ipv6.enabled=true"
KIND_POD_CIDR_1="fd00:10:242::/48"
KIND_SVC_CIDR_1="fd00:10:243::/112"
KIND_POD_CIDR_2="fd00:10:244::/48"
KIND_SVC_CIDR_2="fd00:10:245::/112"
;;
dual)
CILIUM_INSTALL_IPFAMILY="--helm-set=ipv4.enabled=true --helm-set=ipv6.enabled=true"
KIND_POD_CIDR_1="10.242.0.0/16,fd00:10:242::/48"
KIND_SVC_CIDR_1="10.243.0.0/16,fd00:10:243::/112"
KIND_POD_CIDR_2="10.244.0.0/16,fd00:10:244::/48"
KIND_SVC_CIDR_2="10.245.0.0/16,fd00:10:245::/112"
;;
*)
echo "Unknown IP family '${{ matrix.ipFamily }}'" && false
;;
esac
CILIUM_INSTALL_ENCRYPTION=""
if [ "${{ matrix.encryption }}" != "disabled" ]; then
CILIUM_INSTALL_ENCRYPTION="--helm-set=encryption.enabled=true \
--helm-set=encryption.type=${{ matrix.encryption }}"
fi
CILIUM_INSTALL_INGRESS=""
if [ "${{ matrix.kube-proxy }}" == "none" ]; then
CILIUM_INSTALL_INGRESS="--helm-set=ingressController.enabled=true"
fi
CONNECTIVITY_TEST_DEFAULTS="--hubble=false \
--flow-validation=disabled \
--test-concurrency=5 \
--multi-cluster=${{ env.contextName2 }} \
--external-target=google.com. \
--include-unsafe-tests \
--collect-sysdump-on-failure \
--sysdump-output-filename 'cilium-sysdump-${{ matrix.name }}-<ts>'" \
# Skip external traffic (e.g. 1.1.1.1 and www.google.com) tests as IPv6 is not supported
# in GitHub runners: https://github.com/actions/runner-images/issues/668
if [[ "${{ matrix.ipFamily }}" == "ipv6" ]]; then
CONNECTIVITY_TEST_DEFAULTS="$CONNECTIVITY_TEST_DEFAULTS \
--test='!/pod-to-world' \
--test='!/pod-to-cidr'"
fi
echo cilium_install_defaults="${CILIUM_INSTALL_DEFAULTS} ${CILIUM_INSTALL_TUNNEL} \
${CILIUM_INSTALL_IPFAMILY} ${CILIUM_INSTALL_ENCRYPTION} ${CILIUM_INSTALL_INGRESS}" >> $GITHUB_OUTPUT
echo connectivity_test_defaults=${CONNECTIVITY_TEST_DEFAULTS} >> $GITHUB_OUTPUT
echo sha=${{ steps.default_vars.outputs.sha }} >> $GITHUB_OUTPUT
echo kind_pod_cidr_1=${KIND_POD_CIDR_1} >> $GITHUB_OUTPUT
echo kind_svc_cidr_1=${KIND_SVC_CIDR_1} >> $GITHUB_OUTPUT
echo kind_pod_cidr_2=${KIND_POD_CIDR_2} >> $GITHUB_OUTPUT
echo kind_svc_cidr_2=${KIND_SVC_CIDR_2} >> $GITHUB_OUTPUT
- name: Generate Kind configuration files
run: |
PODCIDR=${{ steps.vars.outputs.kind_pod_cidr_1 }} \
SVCCIDR=${{ steps.vars.outputs.kind_svc_cidr_1 }} \
IPFAMILY=${{ matrix.ipFamily }} \
KUBEPROXYMODE=${{ matrix.kube-proxy }} \
envsubst < ./.github/kind-config.yaml.tmpl > ./.github/kind-config-cluster1.yaml
PODCIDR=${{ steps.vars.outputs.kind_pod_cidr_2 }} \
SVCCIDR=${{ steps.vars.outputs.kind_svc_cidr_2 }} \
IPFAMILY=${{ matrix.ipFamily }} \
KUBEPROXYMODE=${{ matrix.kube-proxy }} \
envsubst < ./.github/kind-config.yaml.tmpl > ./.github/kind-config-cluster2.yaml
- name: Create Kind cluster 1
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
with:
cluster_name: ${{ env.clusterName1 }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ./.github/kind-config-cluster1.yaml
wait: 0 # The control-plane never becomes ready, since no CNI is present
- name: Create Kind cluster 2
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
with:
cluster_name: ${{ env.clusterName2 }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ./.github/kind-config-cluster2.yaml
wait: 0 # The control-plane never becomes ready, since no CNI is present
- name: Install Cilium CLI
uses: cilium/cilium-cli@a4936ec2afa58bf755162928456190344a179207 # v0.16.24
with:
skip-build: ${{ env.CILIUM_CLI_SKIP_BUILD }}
image-repo: ${{ env.CILIUM_CLI_IMAGE_REPO }}
image-tag: ${{ steps.vars.outputs.sha }}
- name: Label one of the nodes as external to the cluster
run: |
kubectl --context ${{ env.contextName1 }} label node \
${{ env.clusterName1 }}-worker2 cilium.io/no-schedule=true
# Make sure that coredns uses IPv4-only upstream DNS servers also in case of clusters
# with IP family dual, since IPv6 ones are not reachable and cause spurious failures.
# Additionally, this is also required to workaround
# https://github.com/cilium/cilium/issues/23283#issuecomment-1597282247.
- name: Configure the coredns nameservers
run: |
COREDNS_PATCH="
spec:
template:
spec:
dnsPolicy: None
dnsConfig:
nameservers:
- 8.8.4.4
- 8.8.8.8
"
kubectl --context ${{ env.contextName1 }} -n kube-system get configmap coredns -o yaml | \
sed '/loadbalance/a \ log' | kubectl --context ${{ env.contextName1 }} replace -f -
kubectl --context ${{ env.contextName2 }} -n kube-system get configmap coredns -o yaml | \
sed '/loadbalance/a \ log' | kubectl --context ${{ env.contextName2 }} replace -f -
kubectl --context ${{ env.contextName1 }} patch deployment -n kube-system coredns --patch="$COREDNS_PATCH"
kubectl --context ${{ env.contextName2 }} patch deployment -n kube-system coredns --patch="$COREDNS_PATCH"
- name: Start kvstore clusters
id: kvstore
if: matrix.mode == 'external'
uses: ./.github/actions/kvstore
with:
clusters: 2
- name: Create the secret containing the kvstore credentials
if: matrix.mode == 'external'
run: |
kubectl --context ${{ env.contextName1 }} create -n kube-system -f ${{ steps.kvstore.outputs.cilium_etcd_secrets_path }}
kubectl --context ${{ env.contextName2 }} create -n kube-system -f ${{ steps.kvstore.outputs.cilium_etcd_secrets_path }}
- name: Install cert-manager CRDs and create Cilium's issuer
if: matrix.tls-auto-method == 'certmanager'
run: |
# Generate the Cilium CA key and certificate
openssl genrsa 4096 > cilium-ca-key.pem
openssl req -new -x509 -nodes -days 1 -key cilium-ca-key.pem -out cilium-ca-crt.pem -subj "/CN=Cilium CA/"
cat << EOF > issuer.yaml
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: cilium
namespace: kube-system
spec:
ca:
secretName: cilium-root-ca
EOF
for ctx in ${{ env.contextName1 }} ${{ env.contextName2 }}; do
# Install the cert-manager CRDs
CRD_URL="https://github.com/cert-manager/cert-manager/releases/download/${{ env.CERT_MANAGER_VERSION }}/cert-manager.crds.yaml"
kubectl --context $ctx apply -f $CRD_URL
# Create the Cilium CA secret
kubectl --context $ctx create -n kube-system secret tls cilium-root-ca \
--key=cilium-ca-key.pem --cert=cilium-ca-crt.pem
# Create the cert-manager issuer
kubectl --context $ctx apply -f issuer.yaml
done
- name: Set clustermesh connection parameters
if: matrix.mode == 'external'
id: clustermesh-vars
run: |
echo "cilium_install_clustermesh= \
--set=clustermesh.config.enabled=true \
--set clustermesh.config.clusters[0].name=${{ env.ciliumClusterName1 }} \
--set clustermesh.config.clusters[1].name=${{ env.ciliumClusterName2 }} \
${{ steps.kvstore.outputs.cilium_install_clustermesh }} \
" >> $GITHUB_OUTPUT
# Warning: since this is a privileged workflow, subsequent workflow job
# steps must take care not to execute untrusted code.
- name: Checkout pull request branch (NOT TRUSTED)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ steps.vars.outputs.sha }}
persist-credentials: false
path: untrusted
sparse-checkout: |
install/kubernetes/cilium
- name: Create the IPSec secret in both clusters
if: matrix.encryption == 'ipsec'
run: |
SECRET="3+ rfc4106(gcm(aes)) $(openssl rand -hex 20) 128"
kubectl --context ${{ env.contextName1 }} create -n kube-system secret generic cilium-ipsec-keys --from-literal=keys="${SECRET}"
kubectl --context ${{ env.contextName2 }} create -n kube-system secret generic cilium-ipsec-keys --from-literal=keys="${SECRET}"
- name: Install Cilium in cluster1
id: install-cilium-cluster1
env:
KVSTORE_ID: 1
run: |
# Explicitly configure the NodePort to make sure that it is different in
# each cluster, to workaround #24692
cilium --context ${{ env.contextName1 }} install \
${{ steps.vars.outputs.cilium_install_defaults }} \
--helm-set cluster.name=${{ env.ciliumClusterName1 }} \
--helm-set cluster.id=1 \
--helm-set clustermesh.apiserver.service.nodePort=32379 \
--helm-set clustermesh.apiserver.tls.authMode=${{ matrix.cm-auth-mode-1 }} \
${{ steps.kvstore.outputs.cilium_install_kvstore }} \
${{ steps.clustermesh-vars.outputs.cilium_install_clustermesh }} \
--nodes-without-cilium
- name: Copy the Cilium CA secret to cluster2, as they must match
if: matrix.tls-auto-method != 'certmanager'
run: |
kubectl --context ${{ env.contextName1 }} get secret -n kube-system cilium-ca -o yaml |
kubectl --context ${{ env.contextName2 }} create -f -
- name: Install Cilium in cluster2
env:
KVSTORE_ID: 2
run: |
# Explicitly configure the NodePort to make sure that it is different in
# each cluster, to workaround #24692
cilium --context ${{ env.contextName2 }} install \
${{ steps.vars.outputs.cilium_install_defaults }} \
--helm-set cluster.name=${{ env.ciliumClusterName2 }} \
--helm-set cluster.id=${{ matrix.maxConnectedClusters }} \
--helm-set clustermesh.apiserver.service.nodePort=32380 \
--helm-set clustermesh.apiserver.tls.authMode=${{ matrix.cm-auth-mode-2 }} \
${{ steps.kvstore.outputs.cilium_install_kvstore }} \
${{ steps.clustermesh-vars.outputs.cilium_install_clustermesh }}
- name: Install cert-manager
if: matrix.tls-auto-method == 'certmanager'
run: |
helm repo add jetstack https://charts.jetstack.io
for ctx in ${{ env.contextName1 }} ${{ env.contextName2 }}; do
helm --kube-context $ctx install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version ${{ env.CERT_MANAGER_VERSION }}
done
- name: Wait for cluster mesh status to be ready
run: |
cilium --context ${{ env.contextName1 }} status --wait --interactive=false
cilium --context ${{ env.contextName2 }} status --wait --interactive=false
cilium --context ${{ env.contextName1 }} clustermesh status --wait
cilium --context ${{ env.contextName2 }} clustermesh status --wait
- name: Connect clusters
if: matrix.mode != 'external'
run: |
cilium --context ${{ env.contextName1 }} clustermesh connect --destination-context ${{ env.contextName2 }}
- name: Wait for cluster mesh status to be ready
if: matrix.mode != 'external'
run: |
cilium --context ${{ env.contextName1 }} status --wait --interactive=false
cilium --context ${{ env.contextName2 }} status --wait --interactive=false
cilium --context ${{ env.contextName1 }} clustermesh status --wait
cilium --context ${{ env.contextName2 }} clustermesh status --wait
- name: Make JUnit report directory
run: |
mkdir -p cilium-junits
- name: Run connectivity test (${{ join(matrix.*, ', ') }})
run: |
cilium --context ${{ env.contextName1 }} connectivity test ${{ steps.vars.outputs.connectivity_test_defaults }} \
--junit-file "cilium-junits/${{ env.job_name }} (${{ join(matrix.*, ', ') }}).xml" \
--junit-property github_job_step="Run connectivity test (${{ join(matrix.*, ', ') }})"
- name: Features tested on cluster 1
uses: ./.github/actions/feature-status
with:
cilium-cli: "cilium --context ${{ env.contextName1 }}"
title: "Summary of all features tested on cluster 1"
json-filename: "${{ env.job_name }} (${{ join(matrix.*, ', ') }}) - cluster 1"
- name: Features tested on cluster 2
uses: ./.github/actions/feature-status
with:
cilium-cli: "cilium --context ${{ env.contextName2 }}"
title: "Summary of all features tested on cluster 2"
json-filename: "${{ env.job_name }} (${{ join(matrix.*, ', ') }}) - cluster 2"
- name: Post-test information gathering
if: ${{ !success() && steps.install-cilium-cluster1.outcome != 'skipped' }}
run: |
cilium --context ${{ env.contextName1 }} status
cilium --context ${{ env.contextName1 }} clustermesh status
cilium --context ${{ env.contextName2 }} status
cilium --context ${{ env.contextName2 }} clustermesh status
kubectl config use-context ${{ env.contextName1 }}
kubectl get pods --all-namespaces -o wide
cilium sysdump --output-filename cilium-sysdump-context1-final-${{ join(matrix.*, '-') }}
kubectl config use-context ${{ env.contextName2 }}
kubectl get pods --all-namespaces -o wide
cilium sysdump --output-filename cilium-sysdump-context2-final-${{ join(matrix.*, '-') }}
kubectl --context ${{ env.contextName1 }} logs -n kube-system -l k8s-app=kube-dns --prefix --timestamps --tail=-1
kubectl --context ${{ env.contextName2 }} logs -n kube-system -l k8s-app=kube-dns --prefix --timestamps --tail=-1
if [ "${{ matrix.mode }}" == "external" ]; then
for i in {1..2}; do
echo
echo "# Retrieving logs from kvstore$i docker container"
docker logs kvstore$i
done
fi
shell: bash {0} # Disable default fail-fast behaviour so that all commands run independently
- name: Upload artifacts
if: ${{ !success() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: cilium-sysdumps-${{ matrix.name }}
path: cilium-sysdump-*.zip
- name: Upload JUnits [junit]
if: ${{ always() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: cilium-junits-${{ matrix.name }}
path: cilium-junits/*.xml
- name: Upload features tested
if: ${{ always() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: features-tested-${{ matrix.name }}
path: ${{ env.job_name }}*.json
- name: Publish Test Results As GitHub Summary
if: ${{ always() }}
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "cilium-junits"
merge-upload:
if: ${{ always() }}
name: Merge and Upload Artifacts
runs-on: ubuntu-24.04
needs: installation-and-connectivity
steps:
- name: Checkout context ref (trusted)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.context-ref || github.sha }}
persist-credentials: false
- name: Merge Sysdumps
uses: ./.github/actions/merge-artifacts
with:
name: cilium-sysdumps
pattern: cilium-sysdumps-*
token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge JUnits
uses: ./.github/actions/merge-artifacts
with:
name: cilium-junits
pattern: cilium-junits-*
token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge Features tested
uses: ./.github/actions/merge-artifacts
with:
name: features-tested
pattern: features-tested-*
token: ${{ secrets.GITHUB_TOKEN }}
commit-status-final:
if: ${{ always() }}
name: Commit Status Final
needs: installation-and-connectivity
runs-on: ubuntu-24.04
steps:
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1
with:
sha: ${{ inputs.SHA || github.sha }}
status: ${{ needs.installation-and-connectivity.result }}