Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update explanation on Helm use case #1375

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions content/en/flux/use-cases/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Additional benefits Flux adds to Helm include:
- Automated drift detection between the desired and actual state of your operations
- Automated responses to that drift, including reconciliation, notifications, and unified logging

## Prerequisites

To follow along you'll need a Kubernetes cluster with Flux installed on it.
Please see the [get started guide](../get-started/index.md)
or the [installation guide](../installation/).


## Getting Started

The simplest way to explain is by example.
Expand All @@ -47,25 +54,26 @@ helm install my-traefik traefik/traefik \

Flux client:

Clone your bootstrap repository to your local machine and create a `traefik` directory in your bootstrap path.

```sh
flux create source helm traefik --url https://helm.traefik.io/traefik --namespace traefik
flux create source helm traefik --url https://helm.traefik.io/traefik --namespace traefik --export > traefik/helmrepo.yaml
flux create helmrelease my-traefik --chart traefik \
--source HelmRepository/traefik \
--chart-version 9.18.2 \
--namespace traefik
--namespace traefik \
--export > traefik/helmrepo.yaml
```

The main difference is that the Flux client will not imperatively create resources in the cluster.
Instead, these commands create Custom Resource *files*, which are committed to version control
as instructions only (note: you may use the `--export` flag to manage any file edits with
finer grained control before pushing to version control).
Separately, the Flux Helm Controller automatically reconciles these instructions
with the running state of your cluster based on your configured rules.
These commands save the YAML for the Flux helm custom resources to the specified fil. When these resources are pushed to the
repository, Flux applies them on the cluster and the Flux Helm Controller automatically reconciles these instructions
with the running state of your cluster based on your configured rules. Alternatively, you can run the commands without
the `--export` command and this will apply the resources directly on your cluster.

Let's check out what the Custom Resource files look like:
Lets check out what the Custom Resource files look like:

```yaml
# /flux/boot/traefik/helmrepo.yaml
# traefik/helmrepo.yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
Expand All @@ -77,7 +85,7 @@ spec:
```

```yaml
# /flux/boot/traefik/helmrelease.yaml
# traefik/helmrelease.yaml
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
Expand All @@ -87,6 +95,7 @@ spec:
chart:
spec:
chart: traefik
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: traefik
Expand Down