Skip to content

Commit 23f3466

Browse files
committed
feat: enable helm-secrets for argocd
1 parent 8481799 commit 23f3466

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

gitops/base-install/argocd/overlays/argo-cd-repo-server-ksops-patch.yaml

+65-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
# 2. Use an init container to download/copy custom binaries into the emptyDir
1919
initContainers:
2020
- name: install-ksops
21-
image: viaductoss/ksops:v4.1.1
21+
image: viaductoss/ksops:v4.3.3
2222
command: ["/bin/sh", "-c"]
2323
args:
2424
- echo "Installing KSOPS...";
@@ -28,6 +28,37 @@ spec:
2828
volumeMounts:
2929
- mountPath: /custom-tools
3030
name: custom-tools
31+
- name: install-custom-tools
32+
image: alpine:latest
33+
imagePullPolicy: IfNotPresent
34+
command: [sh, -ec]
35+
env:
36+
- name: HELM_SECRETS_VERSION
37+
value: "4.6.3"
38+
- name: KUBECTL_VERSION
39+
value: "1.30.2"
40+
- name: VALS_VERSION
41+
value: "0.39.3"
42+
- name: SOPS_VERSION
43+
value: "3.9.4"
44+
args:
45+
- |
46+
mkdir -p /custom-tools/helm-plugins
47+
48+
GO_ARCH=$(uname -m | sed -e 's/x86_64/amd64/')
49+
wget -qO /custom-tools/curl https://github.com/moparisthebest/static-curl/releases/latest/download/curl-${GO_ARCH}
50+
51+
GO_ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/') && \
52+
wget -qO /custom-tools/kubectl https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${GO_ARCH}/kubectl
53+
wget -qO /custom-tools/sops https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.${GO_ARCH}
54+
wget -qO- https://github.com/helmfile/vals/releases/download/v${VALS_VERSION}/vals_${VALS_VERSION}_linux_${GO_ARCH}.tar.gz | tar zxv -C /custom-tools vals
55+
wget -qO- https://github.com/jkroepke/helm-secrets/releases/download/v${HELM_SECRETS_VERSION}/helm-secrets.tar.gz | tar -C /custom-tools/helm-plugins -xzf-
56+
57+
chmod +x /custom-tools/*
58+
cp /custom-tools/helm-plugins/helm-secrets/scripts/wrapper/helm.sh /custom-tools/helm
59+
volumeMounts:
60+
- mountPath: /custom-tools
61+
name: custom-tools
3162
# Import the private gpg key from the secret into argocd
3263
- name: import-gpg-key
3364
image: argoproj/argocd:v2.5.0
@@ -49,7 +80,40 @@ spec:
4980
- secretRef:
5081
name: "sops-age"
5182
optional: true
83+
env:
84+
- name: HELM_PLUGINS
85+
value: /custom-tools/helm-plugins/
86+
- name: HELM_SECRETS_CURL_PATH
87+
value: /custom-tools/curl
88+
- name: HELM_SECRETS_SOPS_PATH
89+
value: /custom-tools/sops
90+
- name: HELM_SECRETS_VALS_PATH
91+
value: /custom-tools/vals
92+
- name: HELM_SECRETS_KUBECTL_PATH
93+
value: /custom-tools/kubectl
94+
- name: HELM_SECRETS_BACKEND
95+
value: sops
96+
# https://github.com/jkroepke/helm-secrets/wiki/Security-in-shared-environments
97+
- name: HELM_SECRETS_VALUES_ALLOW_SYMLINKS
98+
value: "false"
99+
- name: HELM_SECRETS_VALUES_ALLOW_ABSOLUTE_PATH
100+
value: "true"
101+
- name: HELM_SECRETS_VALUES_ALLOW_PATH_TRAVERSAL
102+
value: "false"
103+
- name: HELM_SECRETS_WRAPPER_ENABLED
104+
value: "true"
105+
- name: HELM_SECRETS_DECRYPT_SECRETS_IN_TMP_DIR
106+
value: "true"
107+
- name: HELM_SECRETS_HELM_PATH
108+
value: /usr/local/bin/helm
109+
- name: HELM_SECRETS_LOAD_GPG_KEYS
110+
value: /sops-gpg/sops.asc
52111
volumeMounts:
112+
- mountPath: /custom-tools
113+
name: custom-tools
114+
- mountPath: /usr/local/sbin/helm
115+
subPath: helm
116+
name: custom-tools
53117
- mountPath: /usr/local/bin/kustomize
54118
name: custom-tools
55119
subPath: kustomize

gitops/base-install/argocd/overlays/argocd-cm-patch.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ data:
1313
resource.customizations.ignoreDifferences.admissionregistration.k8s.io_ValidatingWebhookConfiguration: |
1414
jqPathExpressions:
1515
- '.webhooks[]?.clientConfig.caBundle'
16+
helm.valuesFileSchemes: >-
17+
secrets+gpg-import, secrets+gpg-import-kubernetes,
18+
secrets+age-import, secrets+age-import-kubernetes,
19+
secrets,secrets+literal,
20+
https

0 commit comments

Comments
 (0)