forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (143 loc) · 6.25 KB
/
conformance-kind.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
name: ConformanceKind1.19
# Any change in triggers needs to be reflected in the concurrency group.
on:
pull_request:
paths-ignore:
- 'Documentation/**'
- 'test/**'
push:
branches:
- master
- ft/master/**
paths-ignore:
- 'Documentation/**'
- 'test/**'
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
env:
kind_version: v0.11.1
kind_config: .github/kind-config.yaml
cilium_cli_version: v0.11.7
jobs:
installation-and-connectivity:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Set up job variables
id: vars
run: |
if [ ${{ github.event.pull_request }} ]; then
SHA=${{ github.event.pull_request.head.sha }}
else
SHA=${{ github.sha }}
fi
CILIUM_INSTALL_DEFAULTS="--chart-directory=install/kubernetes/cilium \
--helm-set=image.repository=quay.io/${{ github.repository_owner }}/cilium-ci \
--helm-set=image.useDigest=false \
--helm-set=image.tag=${SHA} \
--helm-set=operator.image.repository=quay.io/${{ github.repository_owner }}/operator \
--helm-set=operator.image.suffix=-ci \
--helm-set=operator.image.tag=${SHA} \
--helm-set=operator.image.useDigest=false \
--helm-set=clustermesh.apiserver.image.repository=quay.io/${{ github.repository_owner }}/clustermesh-apiserver-ci \
--helm-set=clustermesh.apiserver.image.tag=${SHA} \
--helm-set=clustermesh.apiserver.image.useDigest=false \
--helm-set=hubble.relay.image.repository=quay.io/${{ github.repository_owner }}/hubble-relay-ci \
--helm-set=hubble.relay.image.tag=${SHA} \
--helm-set=debug.enabled=true \
--wait=false \
--rollback=false \
--config monitor-aggregation=none \
--base-version=v1.12 \
--version="
HUBBLE_ENABLE_DEFAULTS=" --chart-directory=install/kubernetes/cilium \
--relay-image=quay.io/${{ github.repository_owner }}/hubble-relay-ci:${SHA} \
--base-version=v1.12 \
--relay-version=${SHA}"
CONNECTIVITY_TEST_DEFAULTS="--base-version=v1.12 \
--flow-validation=disabled"
echo ::set-output name=cilium_install_defaults::${CILIUM_INSTALL_DEFAULTS}
echo ::set-output name=hubble_enable_defaults::${HUBBLE_ENABLE_DEFAULTS}
echo ::set-output name=connectivity_test_defaults::${CONNECTIVITY_TEST_DEFAULTS}
echo ::set-output name=sha::${SHA}
- name: Install Cilium CLI
run: |
curl -sSL --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${{ env.cilium_cli_version }}/cilium-linux-amd64.tar.gz{,.sha256sum}
sha256sum --check cilium-linux-amd64.tar.gz.sha256sum
sudo tar xzvfC cilium-linux-amd64.tar.gz /usr/local/bin
rm cilium-linux-amd64.tar.gz{,.sha256sum}
cilium version
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
with:
ref: ${{ steps.vars.outputs.sha }}
persist-credentials: false
- name: Create kind cluster
uses: helm/kind-action@94729529f85113b88f4f819c17ce61382e6d8478
with:
version: ${{ env.kind_version }}
config: ${{ env.kind_config }}
- name: Wait for images to be available
timeout-minutes: 30
shell: bash
run: |
for image in cilium-ci operator-generic-ci hubble-relay-ci ; do
until docker manifest inspect quay.io/${{ github.repository_owner }}/$image:${{ steps.vars.outputs.sha }} &> /dev/null; do sleep 45s; done
done
- name: Install Cilium
run: |
cilium install ${{ steps.vars.outputs.cilium_install_defaults }}
- name: Enable Relay
run: |
cilium hubble enable ${{ steps.vars.outputs.hubble_enable_defaults }}
- name: Port forward Relay
run: |
cilium hubble port-forward&
sleep 10s
[[ $(pgrep -f "cilium.*hubble.*port-forward|kubectl.*port-forward.*hubble-relay" | wc -l) == 2 ]]
- name: Run connectivity test
run: |
cilium connectivity test ${{ steps.vars.outputs.connectivity_test_defaults }}
- name: Clean up Cilium
run: |
pkill -f "cilium.*hubble.*port-forward|kubectl.*port-forward.*hubble-relay"
cilium uninstall --chart-directory=install/kubernetes/cilium --wait
- name: Install Cilium with encryption
run: |
cilium install ${{ steps.vars.outputs.cilium_install_defaults }} \
--encryption=ipsec
- name: Enable Relay
run: |
cilium hubble enable ${{ steps.vars.outputs.hubble_enable_defaults }}
- name: Port forward Relay
run: |
cilium hubble port-forward&
sleep 10s
[[ $(pgrep -f "cilium.*hubble.*port-forward|kubectl.*port-forward.*hubble-relay" | wc -l) == 2 ]]
- name: Run connectivity test
run: |
cilium connectivity test ${{ steps.vars.outputs.connectivity_test_defaults }} --force-deploy
- name: Post-test information gathering
if: ${{ !success() }}
run: |
kubectl get pods --all-namespaces -o wide
cilium status
cilium sysdump --output-filename cilium-sysdump-out
shell: bash {0} # Disable default fail-fast behaviour so that all commands run independently
- name: Upload artifacts
if: ${{ !success() }}
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
with:
name: cilium-sysdump-out.zip
path: cilium-sysdump-out.zip
retention-days: 5
- name: Send slack notification
if: ${{ !success() && (github.event_name == 'schedule' || github.event_name == 'push') }}
uses: 8398a7/action-slack@a74b761b4089b5d730d813fbedcd2ec5d394f3af
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}