-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (110 loc) · 4.48 KB
/
test-private.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
name: Test Private Helm
on:
pull_request:
paths:
- charts-private/**
- .github/workflows/test-private.yaml
jobs:
test-helm-lint:
runs-on: ubuntu-latest
name: Lint Helm Charts
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.0
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0
- name: Run chart-testing (lint)
run: ct lint --config .github/config/cf.yaml --chart-dirs charts-private
test-helm-install:
needs: [test-helm-lint]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chart:
- "phylogatr-web"
- "focalmap"
- "sirmodel"
# TODO: Maybe too few resources with Kind cluster to support init job
# Init job is required to bootstrap Nominatim
#- nominatim
- "rigatoni"
- webmo
- emthub
- chatsqc
- emt-api
name: Test Install Helm Chart ${{ matrix.chart }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0
- name: Create kind cluster
uses: helm/kind-action@v1.4.0
with:
version: v0.17.0
cluster_name: kind
node_image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
config: .github/config/kind.yaml
- name: Label kind nodes
run: |
kubectl label node kind-worker node-role.kubernetes.io/test=''
kubectl label node kind-worker2 node-role.kubernetes.io/test=''
- name: Build and Load nominatim images
if: matrix.chart == 'nominatim'
run: |
make -f docker-images/postgresql/Makefile build
make -f docker-images/postgresql/Makefile kind-load
make -f docker-images/nominatim/Makefile build
make -f docker-images/nominatim/Makefile kind-load
make -f docker-images/postgresql-nominatim/Makefile build
make -f docker-images/postgresql-nominatim/Makefile kind-load
- name: Set image pull secret
run: |
sed -i 's|IMAGE-PULL-PASSWORD|${{ secrets.OSC_REGISTRY_ROBOT_WEBSERVICES_READ_TOKEN}}|g' charts-private/${{ matrix.chart }}/ci/*.yaml
sed -i 's|IMAGE-PULL-PASSWORD|${{ secrets.OSC_REGISTRY_ROBOT_WEBSERVICES_READ_TOKEN}}|g' .github/config/*.yaml
- name: Install Keycloak
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install keycloak bitnami/keycloak -n keycloak --create-namespace --version 21.2.0
- name: Install Kyverno
run: |
helm repo add kyverno https://kyverno.github.io/kyverno/
helm install kyverno kyverno/kyverno -n kyverno --create-namespace -f .github/config/kyverno-values.yaml --version 3.1.4
timeout 120 /bin/bash -c 'until kubectl get pods -n kyverno -l app.kubernetes.io/component=admission-controller -o jsonpath="{range .items[*]}{.status.containerStatuses[*].ready}{end}" | grep "true" ; do echo "Waiting for Kyverno" ; sleep 10 ; done'
helm dependency build charts/kyverno-policies
helm install kyverno-policies charts/kyverno-policies -n kyverno -f .github/config/kyverno-policies-values.yaml
kubectl apply -f .github/config/k8-ldap-configmaps.yaml
sleep 120
- name: Add namespaces
run: kubectl apply -f .github/config/namespaces.yaml
- name: Run chart-testing (install)
run: |
ct install --config .github/config/cf.yaml --charts charts-private/${{ matrix.chart }} --namespace ${{ matrix.chart }}
- name: Debug failure
if: failure()
run: |
kubectl describe node -A
kubectl describe pod -A
kubectl describe service -A
kubectl describe daemonset -A
if [ ${{ matrix.chart }} == "nominatim" ]; then
kubectl describe job -A
kubectl logs job.batch/$(kubectl get jobs -n nominatim -o jsonpath="{.items[0].metadata.name}") -n nominatim
fi
kubectl logs -n kyverno -l app.kubernetes.io/component=admission-controller