File tree Expand file tree Collapse file tree 9 files changed +83
-36
lines changed
infrastructure/controllers Expand file tree Collapse file tree 9 files changed +83
-36
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ jobs:
1111 runs-on : ubuntu-latest
1212 steps :
1313 - name : Checkout
14- uses : actions/checkout@v3
14+ uses : actions/checkout@v5
1515 - name : Setup Flux
1616 uses : fluxcd/flux2/action@main
1717 - name : Setup Kubernetes
18- uses : helm/kind-action@v1.7 .0
18+ uses : helm/kind-action@v1.12 .0
1919 with :
2020 cluster_name : flux
21+ version : v0.30.0
22+ node_image : kindest/node:v1.33.4
2123 - name : Install Flux in Kubernetes Kind
22- run : flux install
24+ run : flux install --components-extra source-watcher
2325 - name : Setup cluster reconciliation
2426 run : |
2527 flux create source git flux-system \
3840 - name : Verify helm reconciliation
3941 run : |
4042 kubectl -n podinfo wait helmrelease/podinfo --for=condition=ready --timeout=5m
43+ - name : List deployed resources
44+ run : flux tree ks flux-system
4145 - name : Debug failure
4246 if : failure()
4347 run : |
Original file line number Diff line number Diff line change 1212 runs-on : ubuntu-latest
1313 steps :
1414 - name : Checkout
15- uses : actions/checkout@v3
15+ uses : actions/checkout@v5
1616 - name : Setup yq
1717 uses : fluxcd/pkg/actions/yq@main
1818 - name : Setup kubeconform
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ spec:
122122 - host : podinfo.staging
123123` ` `
124124
125- Note that with ` version: ">=1.0.0-alpha"` we configure Flux to automatically upgrade
125+ Note that with ` version: ">=1.0.0-alpha"` we configure Flux to automatically upgrade
126126the `HelmRelease` to the latest chart version including alpha, beta and pre-releases.
127127
128128In **apps/production/** dir we have a Kustomize patch with the production specific values :
Original file line number Diff line number Diff line change 1+ ---
12apiVersion : kustomize.toolkit.fluxcd.io/v1
23kind : Kustomization
34metadata :
45 name : apps
56 namespace : flux-system
67spec :
7- interval : 10m0s
88 dependsOn :
99 - name : infra-configs
10+ interval : 1h
11+ retryInterval : 2m
12+ timeout : 5m
1013 sourceRef :
11- kind : GitRepository
12- name : flux-system
13- path : ./apps/ staging
14+ kind : ExternalArtifact
15+ name : apps
16+ path : ./staging
1417 prune : true
1518 wait : true
16- timeout : 5m0s
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : source.extensions.fluxcd.io/v1beta1
3+ kind : ArtifactGenerator
4+ metadata :
5+ name : flux-system
6+ namespace : flux-system
7+ spec :
8+ sources :
9+ - alias : monorepo
10+ kind : GitRepository
11+ name : flux-system
12+ artifacts :
13+ - name : infrastructure
14+ originRevision : " @monorepo"
15+ copy :
16+ - from : " @monorepo/infrastructure/**"
17+ to : " @artifact/"
18+ - name : apps
19+ originRevision : " @monorepo"
20+ copy :
21+ - from : " @monorepo/apps/**"
22+ to : " @artifact/"
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ metadata:
66 namespace : flux-system
77spec :
88 interval : 1h
9- retryInterval : 1m
9+ retryInterval : 2m
1010 timeout : 5m
1111 sourceRef :
12- kind : GitRepository
13- name : flux-system
14- path : ./infrastructure/ controllers
12+ kind : ExternalArtifact
13+ name : infrastructure
14+ path : ./controllers
1515 prune : true
1616 wait : true
1717---
@@ -24,12 +24,12 @@ spec:
2424 dependsOn :
2525 - name : infra-controllers
2626 interval : 1h
27- retryInterval : 1m
27+ retryInterval : 2m
2828 timeout : 5m
2929 sourceRef :
30- kind : GitRepository
31- name : flux-system
32- path : ./infrastructure/ configs
30+ kind : ExternalArtifact
31+ name : infrastructure
32+ path : ./configs
3333 prune : true
3434 patches :
3535 - patch : |
Original file line number Diff line number Diff line change @@ -7,30 +7,37 @@ metadata:
77 toolkit.fluxcd.io/tenant : sre-team
88---
99apiVersion : source.toolkit.fluxcd.io/v1
10- kind : HelmRepository
10+ kind : OCIRepository
1111metadata :
1212 name : cert-manager
1313 namespace : cert-manager
1414spec :
1515 interval : 24h
16- url : https://charts.jetstack.io
16+ url : oci://quay.io/jetstack/charts/cert-manager
17+ layerSelector :
18+ mediaType : " application/vnd.cncf.helm.chart.content.v1.tar+gzip"
19+ operation : copy
20+ ref :
21+ semver : " 1.x"
1722---
1823apiVersion : helm.toolkit.fluxcd.io/v2
1924kind : HelmRelease
2025metadata :
2126 name : cert-manager
2227 namespace : cert-manager
2328spec :
24- interval : 30m
25- chart :
26- spec :
27- chart : cert-manager
28- version : " 1.x"
29- sourceRef :
30- kind : HelmRepository
31- name : cert-manager
32- namespace : cert-manager
33- interval : 12h
29+ interval : 12h
30+ install :
31+ strategy :
32+ name : RetryOnFailure
33+ retryInterval : 2m
34+ upgrade :
35+ strategy :
36+ name : RetryOnFailure
37+ retryInterval : 3m
38+ chartRef :
39+ kind : OCIRepository
40+ name : cert-manager
3441 values :
3542 crds :
3643 enabled : true
Original file line number Diff line number Diff line change @@ -21,7 +21,18 @@ metadata:
2121 name : ingress-nginx
2222 namespace : ingress-nginx
2323spec :
24- interval : 30m
24+ dependsOn :
25+ - name : cert-manager
26+ namespace : cert-manager
27+ interval : 12h
28+ install :
29+ strategy :
30+ name : RetryOnFailure
31+ retryInterval : 2m
32+ upgrade :
33+ strategy :
34+ name : RetryOnFailure
35+ retryInterval : 3m
2536 chart :
2637 spec :
2738 chart : ingress-nginx
3344 interval : 12h
3445 values :
3546 controller :
47+ admissionWebhooks :
48+ certManager :
49+ enabled : true
3650 service :
3751 type : " NodePort"
38- admissionWebhooks :
39- enabled : false
Original file line number Diff line number Diff line change 2020# limitations under the License.
2121
2222# Prerequisites
23- # - yq v4.34
24- # - kustomize v5.3
25- # - kubeconform v0.6
23+ # - yq v4.48
24+ # - kustomize v5.7
25+ # - kubeconform v0.7
2626
2727set -o errexit
2828set -o pipefail
You can’t perform that action at this time.
0 commit comments