apiVersion: apps/v1 kind: Deployment metadata: name: argocd-repo-server namespace: argocd spec: template: spec: # 1. Define an emptyDir volume which will hold the custom binaries volumes: - name: custom-tools emptyDir: {} # 2. Use an init container to download/copy custom binaries into the emptyDir initContainers: - name: install-ksops # Match Argo CD Go version image: viaductoss/ksops:v2.1.1-go-1.14 command: ["/bin/sh", "-c"] args: - echo "Installing KSOPS..."; export PKG_NAME=ksops; mv ${PKG_NAME}.so /custom-tools/; mv $GOPATH/bin/kustomize /custom-tools/; echo "Done."; volumeMounts: - mountPath: /custom-tools name: custom-tools # 3. Volume mount the custom binary to the bin directory (overriding the existing version) serviceAccountName: gke-argocd-demo containers: - name: argocd-repo-server volumeMounts: - mountPath: /usr/local/bin/kustomize name: custom-tools subPath: kustomize # Verify this matches a XDG_CONFIG_HOME=/.config env variable - mountPath: /.config/kustomize/plugin/viaduct.ai/v1/ksops/ksops.so name: custom-tools subPath: ksops.so # 4. Set the XDG_CONFIG_HOME env variable to allow kustomize to detect the plugin env: - name: XDG_CONFIG_HOME value: /.config