Compare commits

..

15 Commits

Author SHA1 Message Date
5be7f87475 fix: workaround for yaml NOT ending with CR/LF
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
2025-04-11 19:03:23 +00:00
92e7eb3fe8 feat: add kubezero-git-sync cmp plugin supporting vals
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
2025-04-11 14:26:05 +00:00
e87f9d1a7a feat: integrate kubectl config script into repo-server wrapper
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
2025-04-09 22:25:52 +00:00
24a3d6ff95 Merge pull request 'chore(deps): update all non-major dependencies' (#8) from renovate/all-minor-patch into main
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
Reviewed-on: #8
2025-04-09 22:00:02 +00:00
a34c6ed529 chore(deps): update all non-major dependencies
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/pr-main This commit looks good
2025-04-03 03:05:02 +00:00
e2b67b72a5 Revert "feat: remove sa2kubeconfig.sh aas vals support inCluster now"
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
This reverts commit 1a7f4722dfa91f496c5c43d3385e4283c7c917c5.
2025-03-20 19:43:23 +00:00
66f6ef4548 Merge pull request 'chore(deps): update all non-major dependencies' (#7) from renovate/all-minor-patch into main
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
Reviewed-on: #7
2025-03-20 18:11:48 +00:00
c08a71b4a2 chore(deps): update all non-major dependencies
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/pr-main This commit looks good
2025-03-20 03:03:56 +00:00
1a7f4722df feat: remove sa2kubeconfig.sh aas vals support inCluster now
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
2025-03-13 21:35:41 +00:00
ec91bd22ab Merge pull request 'chore(deps): update quay.io/argoproj/argocd docker tag to v2.14.5' (#6) from renovate/all-minor-patch into main
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
Reviewed-on: #6
2025-03-12 14:24:46 +00:00
6b83b07beb chore(deps): update quay.io/argoproj/argocd docker tag to v2.14.5 2025-03-12 03:03:20 +00:00
80f2a21ee7 Merge pull request 'chore(deps): update all non-major dependencies' (#5) from renovate/all-minor-patch into main
Reviewed-on: #5
2025-03-11 18:18:11 +00:00
93b3feebf9 chore(deps): update all non-major dependencies 2025-03-05 03:03:53 +00:00
f25689faca Merge pull request 'chore(deps): update all non-major dependencies' (#4) from renovate/all-minor-patch into main
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
Reviewed-on: #4
2025-02-14 17:37:09 +00:00
f172103ecb chore(deps): update all non-major dependencies
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/pr-main This commit looks good
2025-02-12 03:08:18 +00:00
4 changed files with 36 additions and 14 deletions

View File

@ -1,11 +1,11 @@
FROM quay.io/argoproj/argocd:v2.13.1 FROM quay.io/argoproj/argocd:v2.14.9
# renovate: datasource=github-releases depName=sops packageName=getsops/sops # renovate: datasource=github-releases depName=sops packageName=getsops/sops
ARG SOPS_VERSION=v3.9.2 ARG SOPS_VERSION=v3.10.1
# renovate: datasource=github-releases depName=vals packageName=helmfile/vals # renovate: datasource=github-releases depName=vals packageName=helmfile/vals
ARG VALS_VERSION=v0.38.0 ARG VALS_VERSION=v0.40.1
# renovate: datasource=github-releases depName=helm-secrets packageName=jkroepke/helm-secrets # renovate: datasource=github-releases depName=helm-secrets packageName=jkroepke/helm-secrets
ARG HELM_SECRETS_VERSION=v4.6.2 ARG HELM_SECRETS_VERSION=v4.6.3
ARG ARGOCD_USER_ID="999" ARG ARGOCD_USER_ID="999"
@ -16,7 +16,8 @@ ENV HELM_SECRETS_BACKEND="vals" \
HELM_SECRETS_VALUES_ALLOW_SYMLINKS=false \ HELM_SECRETS_VALUES_ALLOW_SYMLINKS=false \
HELM_SECRETS_VALUES_ALLOW_ABSOLUTE_PATH=true \ HELM_SECRETS_VALUES_ALLOW_ABSOLUTE_PATH=true \
HELM_SECRETS_VALUES_ALLOW_PATH_TRAVERSAL=false \ HELM_SECRETS_VALUES_ALLOW_PATH_TRAVERSAL=false \
HELM_SECRETS_WRAPPER_ENABLED=true HELM_SECRETS_WRAPPER_ENABLED=true \
KUBECONFIG=/tmp/kubectl.config
# Optionally, set default gpg key for sops files # Optionally, set default gpg key for sops files
# ENV HELM_SECRETS_LOAD_GPG_KEYS=/path/to/gpg.key # ENV HELM_SECRETS_LOAD_GPG_KEYS=/path/to/gpg.key
@ -37,12 +38,21 @@ RUN curl -fsSL https://github.com/helmfile/vals/releases/download/${VALS_VERSION
| tar xzf - -C /usr/local/bin/ vals \ | tar xzf - -C /usr/local/bin/ vals \
&& chmod +x /usr/local/bin/vals && chmod +x /usr/local/bin/vals
RUN ln -sf "$(helm env HELM_PLUGINS)/helm-secrets/scripts/wrapper/helm.sh" /usr/local/sbin/helm # helm-secrets
RUN mkdir -p /home/argocd/.local/share/helm/plugins && \
curl -fsSL https://github.com/jkroepke/helm-secrets/releases/download/${HELM_SECRETS_VERSION}/helm-secrets.tar.gz \
| 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-repo-server
# Add init script to convert SA token into kubeconfig for vals
ADD sa2kubeconfig.sh /usr/local/bin/sa2kubeconfig.sh
# replace argocd-repo-server with wrapper to install kubectl config
ADD argocd-repo-server-wrapper.sh /usr/local/bin/argocd-repo-server
# register vals "cmp plugin"
ADD plugin.yaml /home/argocd/cmp-server/config/plugin.yaml
USER ${ARGOCD_USER_ID} USER ${ARGOCD_USER_ID}
RUN helm plugin install --version ${HELM_SECRETS_VERSION#v} https://github.com/jkroepke/helm-secrets
RUN mkdir -p /home/argocd/.kube && sed -i -e 's/secrets/secrets --evaluate-templates/' "$(helm env HELM_PLUGINS)/helm-secrets/scripts/wrapper/helm.sh"

View File

@ -5,7 +5,7 @@ Customized ArgoCD image for KubeZero
## Changes ## Changes
- added sops, helm-secrets and vals binaries - added sops, helm-secrets and vals binaries
- configured helm-secrets to use vals backend - configured helm-secrets to use vals backend
- init script to allow vals to access the local cluster Kube API using Argo's SA account to eg. lookup values from a central secret - argocd-repo-server wrapper script to allow vals to access the local cluster Kube API using Argo's SA account to eg. lookup values from a central secret
## Credits: ## Credits:
- https://github.com/jkroepke/helm-secrets/wiki/ArgoCD-Integration#option-1-custom-docker-image - https://github.com/jkroepke/helm-secrets/wiki/ArgoCD-Integration#option-1-custom-docker-image

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh
KUBECONFIG=$1 KUBECONFIG=/tmp/kubectl.config
SA_NAME=argo-argocd-repo-server SA_NAME=argo-argocd-repo-server
CA64=$(cat /run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -w0) CA64=$(cat /run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -w0)
@ -27,3 +27,5 @@ current-context: ${SA_NAME}_context
EOF EOF
chmod 600 $KUBECONFIG chmod 600 $KUBECONFIG
ARGOCD_BINARY_NAME=argocd-repo-server /usr/local/bin/argocd $@

10
plugin.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
name: kubezero-git-sync
spec:
generate:
command: [sh, -c, 'find . -name "*.yaml" -o -name "*.yml" | while read f; do cat $f; echo; echo "---"; done | vals eval -f -']
# discover:
# find:
# command: [sh, -c, find . -name "*.yaml"]