forked from fluxcd/flux2-kustomize-helm-example
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 2.37 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
name: e2e
on:
workflow_dispatch:
push:
branches: [ '*' ]
tags-ignore: [ '*' ]
jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup tools
uses: ./.github/actions/tools
- name: Setup Flux
run: |
curl -s https://fluxcd.io/install.sh | sudo FLUX_VERSION=0.40.2 bash
flux --version
- name: Setup Kubernetes
uses: helm/[email protected]
with:
version: v0.17.0
cluster_name: flux
- name: Install Flux in Kubernetes Kind
run: flux install
- name: Create SSH key
run: |
mkdir -p ~/.ssh/
echo ${{ secrets.FLUX_MONOREPO_PRIVATE_KEY }} | base64 -d > ../private.key
sudo chmod 600 ../private.key
ssh-keyscan -H github.com > ~/.ssh/known_hosts
shell: bash
- 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 secret git flux-system \
--url=ssh://[email protected]/${{ github.event.repository.name }} \
--private-key-file=../private.key
flux create kustomization flux-system \
--source=flux-system \
--path=./clusters/ops
- name: Verify cluster reconciliation
run: |
kubectl -n flux-system wait kustomization/infra-controllers --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/apps --for=condition=ready --timeout=5m
- name: Verify helm reconciliation
run: |
kubectl -n podinfo wait helmrelease/podinfo --for=condition=ready --timeout=5m
- 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
flux get all --all-namespaces
kubectl -n flux-system describe gitrepository flux-system
kubectl describe secret flux-system -n flux-system
kubectl get secrets/flux-system -n flux-system \
--template={{.data.known_hosts}} | base64 -d