Skip to content

Commit

Permalink
docs: Helm plugins via initContainers (argoproj#7815)
Browse files Browse the repository at this point in the history
* Docs: Helm plugins via initContainers

Related: argoproj#7066

Include an alternative method for installing Helm plugins that don't require users to maintain their own version of the ArgoCD container image.

Signed-off-by: Didrik Finnøy <[email protected]>

* add codeblock

Signed-off-by: Didrik Finnøy <[email protected]>

* change helm repo name in example code

Signed-off-by: Didrik Finnøy <[email protected]>
  • Loading branch information
djfinnoy authored Dec 19, 2021
1 parent e50d03e commit e32c070
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions docs/user-guide/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ Or via declarative syntax:

Argo CD is un-opinionated on what cloud provider you use and what kind of Helm plugins you are using, that's why there are no plugins delivered with the ArgoCD image.

But sometimes it happens you would like to use a custom plugin. One of the cases is that you would like to use Google Cloud Storage or Amazon S3 storage to save the Helm charts, for example: https://github.com/hayorov/helm-gcs where you can use `gs://` protocol for Helm chart repository access.
But sometimes you want to use a custom plugin. Perhaps you would like to use Google Cloud Storage or Amazon S3 storage to save the Helm charts, for example: https://github.com/hayorov/helm-gcs where you can use `gs://` protocol for Helm chart repository access.
There are two ways to install custom plugins; you can modify the ArgoCD container image, or you can use a Kubernetes `initContainer`.

In order to do that you have to prepare your own ArgoCD image with installed plugins.
### Modifying the ArgoCD container image
One way to use this plugin is to prepare your own ArgoCD image where it is included.

Example `Dockerfile`:

Expand Down Expand Up @@ -199,6 +201,62 @@ You have to remember about `HELM_PLUGINS` environment property - this is require

After that you have to use your custom image for ArgoCD installation.

### Using `initContainers`
Another option is to install Helm plugins via Kubernetes `initContainers`.
Some users find this pattern preferable to maintaining their own version of the ArgoCD container image.

Below is an example of how to add Helm plugins when installing ArgoCD with the [official ArgoCD helm chart](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd):

```
# helm-gcs plugin
repoServer:
volumes:
- name: helm
emptyDir: {}
- name: gcloud
secret:
secretName: helm-credentials
volumeMounts:
- mountPath: /helm
name: helm
- mountPath: /gcloud
name: gcloud
env:
- name: HELM_DATA_HOME
value: /helm
- name: HELM_CACHE_HOME
value: /helm/cache
- name: HELM_CONFIG_HOME
value: /helm/config
- name: HELM_PLUGINS
value: /helm/plugins/
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /gcloud/key.json
initContainers:
- name: install-helm-plugins
image: alpine/helm:3.6.3
volumeMounts:
- mountPath: /helm
name: helm
- mountPath: /gcloud
name: gcloud
env:
- name: HELM_DATA_HOME
value: /helm
- name: HELM_CACHE_HOME
value: /helm/cache
- name: HELM_CONFIG_HOME
value: /helm/config
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /gcloud/key.json
command: ["/bin/sh", "-c"]
args:
- apk --no-cache add curl;
helm plugin install https://github.com/hayorov/helm-gcs.git;
helm repo add my-gcs-repo gs://my-private-helm-gcs-repository;
chmod -R 777 $HELM_DATA_HOME;
```

## Helm Version

Argo CD will assume that the Helm chart is v3 (even if the apiVersion field in the chart is Helm v2), unless v2 is explicitly specified within the Argo CD Application (see below).
Expand Down

0 comments on commit e32c070

Please sign in to comment.