feat: move kubectl config setup to init-container
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good

This commit is contained in:
Stefan Reimer 2025-06-23 11:16:41 +00:00
parent 73e0319591
commit 4b45b05e8e
2 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
FROM quay.io/argoproj/argocd:v3.0.6
FROM quay.io/argoproj/argocd:v3.0.9
# renovate: datasource=github-releases depName=sops packageName=getsops/sops
ARG SOPS_VERSION=v3.10.2
@ -17,7 +17,7 @@ ENV HELM_SECRETS_BACKEND="vals" \
HELM_SECRETS_VALUES_ALLOW_ABSOLUTE_PATH=true \
HELM_SECRETS_VALUES_ALLOW_PATH_TRAVERSAL=false \
HELM_SECRETS_WRAPPER_ENABLED=true \
KUBECONFIG=/tmp/kubectl.config
KUBECONFIG=/home/argocd/cmp-server/plugins/kubectl.config
# Optionally, set default gpg key for sops files
# ENV HELM_SECRETS_LOAD_GPG_KEYS=/path/to/gpg.key
@ -44,11 +44,10 @@ RUN mkdir -p /home/argocd/.local/share/helm/plugins && \
| tar -C /home/argocd/.local/share/helm/plugins -xzf- && \
chown -R root: /home/argocd/.local/share/helm && \
ln -sf /home/argocd/.local/share/helm/plugins/helm-secrets/scripts/wrapper/helm.sh /usr/local/sbin/helm && \
sed -i -e 's/secrets/secrets --evaluate-templates/' /home/argocd/.local/share/helm/plugins/helm-secrets/scripts/wrapper/helm.sh && \
rm -f /usr/local/bin/argocd-cmp-server
sed -i -e 's/secrets/secrets --evaluate-templates/' /home/argocd/.local/share/helm/plugins/helm-secrets/scripts/wrapper/helm.sh
# replace argocd-cmp-server with wrapper to install kubectl config
ADD argocd-cmp-server-wrapper.sh /usr/local/bin/argocd-cmp-server
# Add tools scripts for the init-container
ADD create-kubectl-config.sh /usr/local/bin/create-kubectl-config.sh
# register vals "cmp plugin"
ADD plugin.yaml /home/argocd/cmp-server/config/plugin.yaml

View File

@ -1,6 +1,6 @@
#!/bin/sh
KUBECONFIG=/tmp/kubectl.config
KUBECONFIG=/home/argocd/cmp-server/plugins/kubectl.config
SA_NAME=argo-argocd-repo-server
CA64=$(cat /run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -w0)
@ -28,4 +28,4 @@ EOF
chmod 600 $KUBECONFIG
ARGOCD_BINARY_NAME=argocd-cmp-server /usr/local/bin/argocd $@
# ARGOCD_BINARY_NAME=argocd-cmp-server /usr/local/bin/argocd $@