-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (69 loc) · 2.62 KB
/
e2e.yaml
File metadata and controls
77 lines (69 loc) · 2.62 KB
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
name: e2e
on:
push:
paths:
- "apps/**"
- "clusters/dev/**"
- "infrastructure/**"
- ".github/workflows/e2e.yaml"
branches: ["*"]
tags-ignore: ["*"]
workflow_dispatch:
jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flux
uses: fluxcd/flux2/action@main
- name: Setup Kubernetes
uses: helm/kind-action@v1.8.0
with:
cluster_name: dev
config: kind.config.yaml
- name: Install Flux in Kubernetes Kind
run: flux install --components-extra=image-reflector-controller,image-automation-controller
- name: Setup cluster reconciliation
run: |
flux create source git flux-system \
--url=${{ github.event.repository.html_url }} \
--branch=${GITHUB_REF#refs/heads/} \
--ignore-paths=clusters/**/flux-system/
flux create kustomization flux-system \
--source=flux-system \
--path=./clusters/dev
echo "$E2E_AGEKEY" | kubectl create secret generic sops-age \
--namespace=flux-system \
--from-file=sops.agekey=/dev/stdin
env:
E2E_AGEKEY: ${{ secrets.E2E_AGEKEY }}
- name: Verify infrastructure reconciliation
run: |
kubectl -n flux-system wait kustomization/infra-controllers --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/infra-configs --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m
- name: Verify app reconciliation
run: |
kubectl -n flux-system wait kustomization/fastapi-example --for=condition=ready --timeout=5m
kubectl -n podinfo wait helmrelease/podinfo --for=condition=ready --timeout=5m
- name: Debug failure
if: failure()
run: |
kubectl get namespaces
echo ""
echo "***** flux-system namespace *****"
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
echo ""
echo "***** fastapi-example namespace *****"
kubectl -n fastapi-example get all
echo ""
echo "***** podinfo namespace *****"
kubectl -n podinfo get all
echo ""
echo "***** flux custom resources *****"
flux get all --all-namespaces
kubectl describe -n flux-system gitrepository flux-system