-
Notifications
You must be signed in to change notification settings - Fork 39
66 lines (66 loc) · 2.46 KB
/
ci-helm-deploy-nginx.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
---
name: deploy with helm and ingress-nginx
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --snapshot --clean --skip=publish
- name: Setup kind
uses: engineerd/[email protected]
with:
config: "ci/kind-config.yaml"
version: "v0.11.1"
image: kindest/node:v1.23.1
- name: Show cluster info and switch to kube-system
run: |
kubectl cluster-info
kubectl get nodes
echo "current-context:" $(kubectl config current-context)
kubectl config set-context --current --namespace kube-system
- name: Deploy ingress-nginx
timeout-minutes: 2
run: |
kubectl apply -f \
https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s
- name: Import image into kind
run: |
docker images
docker tag postfinance/kubenurse:latest \
postfinance/kubenurse:latest-ci
kind load docker-image postfinance/kubenurse:latest-ci
- name: Deploy example setup
run: |
helm upgrade kubenurse \
--install helm/kubenurse/ \
-f helm/kubenurse/values.yaml \
--set ingress.url=ingress-nginx-controller.ingress-nginx.svc.cluster.local,daemonset.image.tag=latest-ci \
--wait
- name: Wait for pods
timeout-minutes: 2
run: |
sleep 15 # wait for the scheduler to create pods
kubectl -n kube-system wait pods -l app.kubernetes.io/name=kubenurse --for=condition=Ready
kubectl -n kube-system get pods -l app.kubernetes.io/name=kubenurse
kubectl rollout restart daemonset kubenurse
kubectl rollout status daemonset kubenurse --timeout=1m
sleep 60 # Wait to generate some checks etc.
- name: Check deployment
uses: ./.github/actions/check-deployment
with:
namespace: kube-system
svc-domain: ingress-nginx-controller.ingress-nginx.svc.cluster.local