Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
docs: document usage of downloader plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco committed Feb 12, 2020
1 parent 1daace2 commit 91b4441
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chart/helm-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ helm upgrade -i helm-operator fluxcd/helm-operator \

The deploy key naming convention is `<Flux Release Name>-git-deploy`.

## Use Helm (getter) plugins
## Use Helm downloader plugins

Helm plugins like [`hypnoglow/helm-s3`](https://github.com/hypnoglow/helm-s3)
Helm downloader plugins like [`hypnoglow/helm-s3`](https://github.com/hypnoglow/helm-s3)
and [`hayorov/helm-gcs`](https://github.com/hayorov/helm-gcs) make it possible
to extend the protocols Helm recognizes to e.g. pull charts from a S3 bucket.

Expand Down
102 changes: 102 additions & 0 deletions docs/references/helmrelease-custom-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,108 @@ OK
> either need to port forward before making the request or put something
> in front of it to serve as a gatekeeper.

## Extending the supported Helm repository protocols

By default, the Helm operator is able to pull charts from repositories
using HTTP/S. It is however possible to extend the supported protocols
by making use of a [Helm downloader plugin](https://helm.sh/docs/topics/plugins/#downloader-plugins),
this allows you for example to use charts hosted on [Amazon S3](https://github.com/hayorov/helm-gcs)
or [Google Cloud Storage](https://github.com/hayorov/helm-gcs).

> **Note:** the operator only offers support for _downloader plugins_,
> other plugins will not be recognized nor used.

**Plugin folder paths per Helm version:**

| Version | Plugins | Config
|--------|---------|---
| Helm 2 | `/var/fluxd/helm/cache/plugins` | `/var/fluxd/helm/plugins`
| Helm 3 | `/root/.cache/helm/plugins` | `/root/.local/share/helm/plugins`

### Install a Helm downloader plugin

The easiest way to install a plugin so that it becomes accessible to
the Helm operator to use an [init container](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
and one of the available `helm` binaries in the operator's image and
a volume mount. For the Helm chart of the operator, [see the
documentation](https://github.com/fluxcd/helm-operator/tree/master/chart/helm-operator#use-helm-downloader-plugins).

#### Using an init container

Create a volume entry of [type `emptyDir`](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir)
to the deployment of your Helm operator, this is where the plugins will
be stored for the lifetime duration of the pod.

```yaml
spec:
volumes:
- name: helm-plugins-cache
emptyDir: {}
```

Add a new init container that utilizes the same image as the operator's
container and makes use of the earlier mentioned volume with correct
volume mounts for the Helm version your are making use of.
The available `helm2` and `helm3` binaries can then be used to install
the plugin.

```yaml
spec:
initContainers:
- name: helm-3-downloader-plugin
image: docker.io/fluxcd/helm-operator:<tag>
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'helm3 plugin install <plugin> --version <version>']
volumeMounts:
- name: helm-plugin-cache
# See: 'plugin folder paths per Helm version'
mountPath: /root/.cache/helm/plugins
subPath: v3
- name: helm-plugins-cache
# See: 'plugin folder paths per Helm version'
mountPath: /root/.local/share/helm/plugins
subPath: v3-config
```

Last, add the same volume mounts to the operator's container so the
downloaded plugin becomes available.

```yaml
spec:
containers:
- name: flux-helm-operator
image: docker.io/fluxcd/helm-operator:<tag>
...
volumeMounts:
- name: helm-plugin-cache
# See: 'plugin folder paths per Helm version'
mountPath: /root/.cache/helm/plugins
subPath: v3
- name: helm-plugins-cache
# See: 'plugin folder paths per Helm version'
mountPath: /root/.local/share/helm/plugins
subPath: v3-config
```

### Using an installed protocol in your `HelmRelease`

Once a Helm downloader plugin has been successfully installed, the
newly added protocol can be used in the `.spec.chart.repository`
value of a `HelmRelease`.

> **Note:** most downloader plugins expect some form of authentication
> to be available to be able to download a chart, make sure those are
> available in the operator's container before attempting to make use
> of the newly added protocol.

```yaml
spec:
chart:
repository: s3://bucket-name/charts
name: chart-name
version: 1.0.0
```

## Supplying values to the chart

You can supply values to be used with the chart when installing it, in
Expand Down

0 comments on commit 91b4441

Please sign in to comment.