https://argoproj.github.io/argo-cd/
This is an image to use helmfile
as a ArgoCD config management plugin. It also includes support for git-crypt
and will try to decrypt any encrypted files in the source repository if the correct is supplied.
Change the ArgoCD repo server image to this image and add the following settings to argocd-cm
:
configManagementPlugins: |
- name: helmfile
init:
command: ["argocd-helmfile"]
args: ["init"]
generate:
command: ["argocd-helmfile"]
args: ["generate"]
The argocd-helmfile
accepts some special environment variables which customize how helm
and helmfile
are called and which helmfile
configuration to use.
HELM_TEMPLATE_OPTIONS
-helm template --help
HELMFILE_GLOBAL_OPTIONS
-helmfile --help
HELMFILE_TEMPLATE_OPTIONS
-helmfile template --help
HELMFILE
- A completehelmfile.yaml
(ignores standardhelmfile.yaml
andhelmfile.d
if present and takes precendence beforeHELMFILE_PATH
)HELMFILE_PATH
- Path to an alternatehelmfile.yaml
orhelmfile.d
(ignores standardhelmfile.yaml
andhelmfile.d
if present)
For git-crypt
to work the necessary GPG private keys need to be supplied to the repo server via a volume. ArgoCD
will automatically load keys from the listed location. If public keys are used too they can be put into a ConfigMap
and the volume below needs to be changed to be a projected volume which aggregates both the ConfigMap
and the Secret
into a single directory.
apiVersion: v1
kind: Secret
metadata:
name: argocd-gpg-keys-secret
namespace: argocd
type: Opaque
data:
<hex key-id (16 characters)>: <base64 encoded GPG private key>
volumeMounts:
- name: gpg-keys
mountPath: /app/config/gpg/source
volumes:
- name: gpg-keys
secret:
secretName: argocd-gpg-keys-secret
This work is based on: