-
Notifications
You must be signed in to change notification settings - Fork 8
132 lines (131 loc) · 4.64 KB
/
e2e.yml
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
name: e2e-test
on:
push:
branches:
- "*"
pull_request:
permissions:
contents: read
jobs:
e2e-test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arrays:
[
{
node: "v1.22.17",
digest: "f5b2e5698c6c9d6d0adc419c0deae21a425c07d81bbf3b6a6834042f25d4fba2",
},
{
node: "v1.23.17",
digest: "14d0a9a892b943866d7e6be119a06871291c517d279aedb816a4b4bc0ec0a5b3",
},
{
node: "v1.24.17",
digest: "bad10f9b98d54586cba05a7eaa1b61c6b90bfc4ee174fdc43a7b75ca75c95e51",
},
{
node: "v1.25.16",
digest: "6110314339b3b44d10da7d27881849a87e092124afab5956f2e10ecdb463b025",
},
{
node: "v1.26.15",
digest: "1cc15d7b1edd2126ef051e359bf864f37bbcf1568e61be4d2ed1df7a3e87b354",
},
{
node: "v1.27.16",
digest: "3fd82731af34efe19cd54ea5c25e882985bafa2c9baefe14f8deab1737d9fabe",
},
{
node: "v1.28.13",
digest: "45d319897776e11167e4698f6b14938eb4d52eb381d9e3d7a9086c16c69a8110",
},
{
node: "v1.29.8",
digest: "d46b7aa29567e93b27f7531d258c372e829d7224b25e3fc6ffdefed12476d3aa",
},
{
node: "v1.30.4",
digest: "976ea815844d5fa93be213437e3ff5754cd599b040946b5cca43ca45c2047114",
},
{
node: "v1.31.1",
digest: "cd224d8da58d50907d1dd41d476587643dad2ffd9f6a4d96caf530fb3b9a5956",
},
]
install-mode:
- ha
- standalone
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up kubectl
uses: azure/setup-kubectl@v4
with:
version: ${{ matrix.arrays.node }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.7.1
- name: Build Container Image
uses: docker/build-push-action@v6.10.0
with:
context: .
file: ./Dockerfile
load: true
platforms: linux/amd64
provenance: false
push: false
tags: ghcr.io/${{ github.repository }}:ci
- name: Set up KinD
uses: engineerd/setup-kind@v0.6.2
with:
config: ./hack/e2e-kind-config.yaml
image: docker.io/kindest/node@sha256:${{ matrix.arrays.digest }}
skipClusterLogsExport: true
version: "v0.24.0"
- name: Wait for KiND readiness
run: |
kubectl --namespace kube-system wait --for=condition=ready pod -l tier=control-plane --timeout=300s
kubectl get nodes -o wide
- name: Load image on the nodes of the KinD
run: |
kind load docker-image ghcr.io/${{ github.repository }}:ci
- name: Patch Install Manifests
run: |
sed -i -e 's@imagePullPolicy: Always@imagePullPolicy: IfNotPresent@g' ./deploy/${{ matrix.install-mode }}-install.yaml
sed -i -e 's@image: .*@image: ghcr.io/${{ github.repository }}:ci@g' ./deploy/${{ matrix.install-mode }}-install.yaml
- name: Deploy Application
id: deployment
run: |
kubectl apply -f ./deploy/${{ matrix.install-mode }}-install.yaml
count=0
until [[ $(kubectl --namespace kubelet-serving-cert-approver get pod --selector app.kubernetes.io/name=kubelet-serving-cert-approver 2>/dev/null) ]]; do
count=$((count + 1))
if [[ "${count}" -eq "150" ]]; then
echo 'Wait Timeout exceeded' >&3
return 1
fi
sleep 2
done
kubectl --namespace kubelet-serving-cert-approver wait --for=condition=ready pod --selector app.kubernetes.io/name=kubelet-serving-cert-approver --timeout=300s
- name: Get deployment failure logs
if: ${{ failure() && steps.deployment.outputs.exit_code != 0 }}
run: |
kubectl --namespace kubelet-serving-cert-approver get events
kubectl --namespace kubelet-serving-cert-approver describe deployments kubelet-serving-cert-approver
- name: Set up Go
uses: actions/setup-go@v5
with:
cache: true
go-version: 1.23.4
- name: Test Approved Certificate Signing Requests
run: go test -tags=e2e -v ./e2e
- name: Get Application logs
if: ${{ always() }}
run: |
kubectl --namespace kubelet-serving-cert-approver logs --selector app.kubernetes.io/name=kubelet-serving-cert-approver --prefix