This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (149 loc) · 4.73 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- '*'
push:
branches:
- master
- main
workflow_dispatch:
jobs:
specs:
name: specs
strategy:
matrix:
runner:
- actuated-arm64
- actuated
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Check specs
run: |
./specs.sh
registry-mirror:
strategy:
matrix:
runner:
- actuated-arm64
- actuated
runs-on: ${{ matrix.runner }}
steps:
- name: Setup mirror
uses: self-actuated/hub-mirror@master
- name: Checkout
uses: actions/checkout@v4
- name: Pull image using cache
run: |
docker pull alpine:latest
shell: bash
# kind-test:
# name: Test KIND 1.7.0
# runs-on: ${{ matrix.runner }}
# strategy:
# fail-fast: false
# matrix:
# k8s-release:
# - 'v1.27.3'
# - 'v1.26.6'
# - 'v1.25.11'
# - 'v1.24.15'
# - 'v1.23.17'
# runner:
# - actuated
# - ubuntu-latest
# steps:
# # Prevent any image throttling from DockerHub (e.g. for Kind)
# - name: Set up Actuated mirror
# uses: self-actuated/hub-mirror@master
# - name: Create k8s Kind Cluster
# uses: helm/[email protected]
# timeout-minutes: 5
# with:
# node_image: kindest/node:${{ matrix.k8s-release }}
# cluster_name: kind
# wait: 300s
# kind-test-18:
# name: Test KIND 1.8.0
# runs-on: ${{ matrix.runner }}
# strategy:
# fail-fast: false
# matrix:
# k8s-release:
# - 'v1.27.3'
# - 'v1.26.6'
# - 'v1.25.11'
# - 'v1.24.15'
# - 'v1.23.17'
# runner:
# - actuated
# - ubuntu-latest
# steps:
# # Prevent any image throttling from DockerHub (e.g. for Kind)
# - name: Set up Actuated mirror
# uses: self-actuated/hub-mirror@master
# - name: Create k8s Kind Cluster
# uses: helm/[email protected]
# timeout-minutes: 5
# with:
# node_image: kindest/node:${{ matrix.k8s-release }}
# cluster_name: kind
# wait: 300s
kind-ingress-test:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- actuated
- actuated-arm64
- ubuntu-latest
steps:
# Prevent any image throttling from DockerHub (e.g. for Kind)
- name: Set up Actuated mirror
uses: self-actuated/hub-mirror@master
- uses: helm/[email protected]
with:
install_only: true
- run: |
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
# we cannot just wait immediately, it triggers a race so first ensure something spins up to wait on
until kubectl get pod --namespace ingress-nginx -l app.kubernetes.io/component=controller | grep -q 'Running'
do
sleep 10
done
# Now wait for the condition
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=90s
# Now apply an ingress
kubectl apply -f https://kind.sigs.k8s.io/examples/ingress/usage.yaml
# should output "foo-app"
until curl -sSfL localhost/foo/hostname; do
sleep 5
done
# should output "bar-app"
curl localhost/bar/hostname
shell: bash
timeout-minutes: 10