@@ -14,7 +14,7 @@ upgrade the Helm releases to their latest chart version based on semver ranges.
1414
1515## Prerequisites
1616
17- You will need a Kubernetes cluster version 1.28 or newer.
17+ You will need a Kubernetes cluster version 1.33 or newer.
1818For a quick local test, you can use [ Kubernetes kind] ( https://kind.sigs.k8s.io/docs/user/quick-start/ ) .
1919Any other Kubernetes setup will work as well though.
2020
@@ -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 :
@@ -164,31 +164,41 @@ The infrastructure is structured into:
164164 └── kustomization.yaml
165165```
166166
167- In **infrastructure/controllers/** dir we have the Flux `HelmRepository` and `HelmRelease` definitions such as:
167+ In **infrastructure/controllers/** dir we have the Flux definitions such as:
168168
169169```yaml
170+ apiVersion: source.toolkit.fluxcd.io/v1
171+ kind: OCIRepository
172+ metadata:
173+ name: cert-manager
174+ namespace: cert-manager
175+ spec:
176+ interval: 24h
177+ url: oci://quay.io/jetstack/charts/cert-manager
178+ layerSelector:
179+ mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
180+ operation: copy
181+ ref:
182+ semver: "1.x"
183+ ---
170184apiVersion: helm.toolkit.fluxcd.io/v2
171185kind: HelmRelease
172186metadata:
173187 name: cert-manager
174188 namespace: cert-manager
175189spec:
176- interval: 30m
177- chart:
178- spec:
179- chart: cert-manager
180- version: "1.x"
181- sourceRef:
182- kind: HelmRepository
183- name: cert-manager
184- namespace: cert-manager
185- interval: 12h
190+ interval: 12h
191+ chartRef:
192+ kind: OCIRepository
193+ name: cert-manager
186194 values:
187- installCRDs: true
195+ crds:
196+ enabled: true
197+ keep: false
188198```
189199
190- Note that with ` interval: 12h ` we configure Flux to pull the Helm repository index every twelfth hours to check for updates .
191- If the new chart version that matches the ` 1.x ` semver range is found , Flux will upgrade the release.
200+ Note that in the ` OCIRepository ` we configure Flux to check for new chart versions every 24 hours.
201+ If a newer chart is found that matches the ` semver: 1.x` constraint , Flux will upgrade the release accordingly .
192202
193203In ** infrastructure/configs/** dir we have Kubernetes custom resources, such as the Let's Encrypt issuer:
194204
@@ -258,18 +268,20 @@ metadata:
258268 name: apps
259269 namespace: flux-system
260270spec:
261- interval: 10m0s
262271 dependsOn:
263272 - name: infra-configs
273+ interval: 1h
274+ retryInterval: 2m
275+ timeout: 5m
264276 sourceRef:
265- kind: GitRepository
266- name: flux-system
267- path: ./apps/ staging
277+ kind: ExternalArtifact
278+ name: apps
279+ path: ./staging
268280 prune: true
269281 wait: true
270282` ` `
271283
272- Note that with `path : ./apps/ staging` we configure Flux to sync the staging Kustomize overlay and
284+ Note that with `path : ./staging` we configure Flux to sync the apps staging Kustomize overlay and
273285with `dependsOn` we tell Flux to create the infrastructure items before deploying the apps.
274286
275287Fork this repository on your personal GitHub account and export your GitHub access token, username and repo name :
@@ -290,6 +302,7 @@ Set the kubectl context to your staging cluster and bootstrap Flux:
290302
291303` ` ` sh
292304flux bootstrap github \
305+ --components-extra=source-watcher \
293306 --context=staging \
294307 --owner=${GITHUB_USER} \
295308 --repository=${GITHUB_REPO} \
@@ -328,6 +341,7 @@ Bootstrap Flux on production by setting the context and path to your production
328341
329342` ` ` sh
330343flux bootstrap github \
344+ --components-extra=source-watcher \
331345 --context=production \
332346 --owner=${GITHUB_USER} \
333347 --repository=${GITHUB_REPO} \
@@ -383,6 +397,7 @@ Set the kubectl context and path to your dev cluster and bootstrap Flux:
383397
384398` ` ` sh
385399flux bootstrap github \
400+ --components-extra=source-watcher \
386401 --context=dev \
387402 --owner=${GITHUB_USER} \
388403 --repository=${GITHUB_REPO} \
@@ -400,6 +415,7 @@ Bootstrap the `production-clone` cluster:
400415
401416` ` ` sh
402417flux bootstrap github \
418+ --components-extra=source-watcher \
403419 --context=production-clone \
404420 --owner=${GITHUB_USER} \
405421 --repository=${GITHUB_REPO} \
0 commit comments