feat(argocd): Copying necessary binaries from main ArgoCD image for use in kustomize-with-helm plugin

This enables us to use a slimmer image for the plugin instead of creating a separate image with all the tools we need.
It also enables us to keep the plugin image tools in sync with the ArgoCD version.
This commit is contained in:
Vegard Hagen
2023-09-05 19:26:11 +02:00
parent 43d1cdce08
commit 8cead343da
4 changed files with 37 additions and 17 deletions

View File

@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-plugin-config
name: argocd-cm-cmp-kustomize-build-with-helm
data:
plugin.yaml: |
kustomize-build-with-helm.yaml: |
apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:

View File

@@ -6,13 +6,14 @@ resources:
- namespace.yaml
- https://raw.githubusercontent.com/argoproj/argo-cd/v2.8.2/manifests/install.yaml
- ingress.yaml
- cm-argocd-plugin.yaml
- argocd-cm-cmp-kustomize-build-with-helm.yaml
patchesStrategicMerge:
patches:
# Copy binaries from ArgoCD-image
- path: patches/argocd-repo-copyutil-patch.yaml
# Plugin to enable Kustomize with Helm
- patches/argocd-repo-server-plugin-sidecar.yaml
- path: patches/argocd-repo-server-plugin-sidecar-patch.yaml
# Ignore CiliumIdentity CRDs
- patches/argocd-cm-resource-exclusion-cilium-identity-patch.yaml
# Let Traefik manage TLS-termination
- patches/argocd-cmd-params-cm-server-insecure-patch.yaml
- path: patches/argocd-cm-resource-exclusion-cilium-identity-patch.yaml
# Traefik handles TLS
- path: patches/argocd-cmd-params-cm-server-insecure-patch.yaml

View File

@@ -0,0 +1,16 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-repo-server
spec:
template:
spec:
initContainers:
- name: copyutil
command: [ /bin/bash ]
args:
- -c
- >-
/bin/cp -n /usr/local/bin/argocd /var/run/argocd/argocd-cmp-server &&
/bin/cp -n /usr/local/bin/kustomize /var/run/argocd/kustomize &&
/bin/cp -n /usr/local/bin/helm /var/run/argocd/helm

View File

@@ -3,13 +3,16 @@ kind: Deployment
metadata:
name: argocd-repo-server
spec:
selector: {}
template:
spec:
containers:
- name: kustomize-build-with-helm
command: [/var/run/argocd/argocd-cmp-server]
image: quay.io/argoproj/argocd:v2.8.2
env:
- name: PATH
value: "/var/run/argocd:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
command:
- argocd-cmp-server
image: alpine/git:2.40.1
securityContext:
runAsNonRoot: true
runAsUser: 999
@@ -18,14 +21,14 @@ spec:
mountPath: /var/run/argocd
- name: plugins
mountPath: /home/argocd/cmp-server/plugins
- name: argocd-plugin-config
- name: cmp-kustomize-build-with-helm
mountPath: /home/argocd/cmp-server/config/plugin.yaml
subPath: plugin.yaml
subPath: kustomize-build-with-helm.yaml
- mountPath: /tmp
name: cmp-tmp
volumes:
- name: argocd-plugin-config
- name: cmp-kustomize-build-with-helm
configMap:
name: argocd-plugin-config
name: argocd-cm-cmp-kustomize-build-with-helm
- name: cmp-tmp
emptyDir: {}
emptyDir: { }