-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (69 loc) · 2.65 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
64
65
66
67
68
69
70
71
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.11.1
image: kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047
- name: Install Flux in Kubernetes Kind
run: flux install --log-level debug
- name: Setup cluster reconciliation
run: |
kubectl apply -f - <<EOF > cat
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: flux-system
namespace: flux-system
spec:
interval: 15m
ref:
branch: ${GITHUB_REF#refs/heads/}
url: ${{ github.event.repository.html_url }}
ignore: |
/clusters/staging/flux-system/
/clusters/production/flux-system/
EOF
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=1m
kubectl -n flux-system wait kustomization/kyverno-controller --for=condition=ready --timeout=1m
kubectl -n flux-system wait kustomization/kyverno-policies --for=condition=ready --timeout=1m
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 logs deploy/kyverno
kubectl get clusterpolicy flux-multi-tenancy -oyaml
flux get sources all --all-namespaces
flux get ks --all-namespaces