forked from fluxcd/flux2-multi-tenancy
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 2.42 KB
/
e2e.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
name: e2e
on:
workflow_dispatch:
push:
branches: [ '*' ]
jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup tools
uses: ./.github/actions/tools
- name: Setup Flux
uses: fluxcd/flux2/action@main
- name: Setup Kubernetes
uses: engineerd/[email protected]
with:
version: v0.16.0
image: kindest/node:v1.23.12@sha256:9402cf1330bbd3a0d097d2033fa489b2abe40d479cc5ef47d0b6a6960613148a
- name: Install Flux in Kubernetes Kind
run: flux install --log-level debug
- name: Setup cluster reconciliation
run: |
flux create source git flux-system \
--interval=15m \
--url=${{ github.event.repository.html_url }} \
--branch=${GITHUB_REF#refs/heads/} \
--ignore-paths="./clusters/**/flux-system/"
flux create kustomization flux-system \
--interval=15m \
--source=flux-system \
--path=./clusters/staging
- name: Verify cluster reconciliation
run: |
kubectl -n flux-system wait kustomization/kyverno --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/kyverno-controller --for=condition=ready --timeout=3m
kubectl -n flux-system wait kustomization/kyverno-policies --for=condition=ready --timeout=3m
kubectl -n flux-system wait kustomization/tenants --for=condition=ready --timeout=3m
- name: Verify tenant reconciliation
run: |
kubectl -n apps wait kustomization/dev-team --for=condition=ready --timeout=1m
kubectl -n apps wait helmrelease/podinfo --for=condition=ready --timeout=1m
- name: List reconciliations
run: |
flux get all --all-namespaces
- name: Debug failure
if: failure()
run: |
kubectl -n flux-system get all
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller
kubectl -n flux-system logs deploy/helm-controller
kubectl -n flux-system logs deploy/notification-controller
kubectl -n kyverno get all
kubectl -n kyverno describe po
kubectl -n kyverno logs deploy/kyverno
kubectl get clusterpolicies.kyverno.io -oyaml
flux get sources all --all-namespaces
flux get ks --all-namespaces