argocd-vault-plugin
argocd-vault-plugin copied to clipboard
Does not work with argocd multiple sources
argo-vault-plugin version 1.13.1 installed as sidecar container Tried add this manifest
project: myProject
source:
repoURL: 'https://gitlab.local/k8s/testproject/testapp.git'
path: ./
targetRevision: HEAD
destination:
server: 'https://kubernetes.default.svc'
namespace: test
sources:
- repoURL: 'https://gitlab.local/k8s/testproject/testapp.git'
path: ./
targetRevision: master
plugin:
name: argocd-vault-plugin-helm
env:
- name: HELM_ARGS
value: -f $app_values/global/values.yaml
- repoURL: 'https://git.local/k8s/testproject/env.git'
targetRevision: feature/argocd
ref: app_values
And I get an error:
Unable to save changes: application spec for testapp is invalid: InvalidSpecError: Unable to generate manifests in ./: rpc error: code = Unknown desc = plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: `sh -c helm template $ARGOCD_APP_NAME -n $ARGOCD_APP_NAMESPACE ${ARGOCD_ENV_HELM_ARGS} . | argocd-vault-plugin generate - ` failed exit status 126: sh: 2: argocd-vault-plugin: Exec format error Error: open /global/values.yaml: no such file or directory
Maybe I'm doing something wrong)
i have same issue, anyone have solution?
remove plugin part and try again as it's not required with sidecar method anymore
remove plugin part and try again as it's not required with sidecar method anymore
If I understand correctly, the same error
sources:
- path: ./
repoURL: 'https://gitlab.local/k8s/testproject/testapp.git'
targetRevision: master
plugin:
env:
- name: HELM_ARGS
value: '-f $app_values/global/values.yaml'
- repoURL: 'https://git.local/k8s/testproject/env.git'
targetRevision: feature/argocd
ref: app_values
Unable to create application: application spec for testapp is invalid: InvalidSpecError: Unable to generate manifests in ./: rpc error: code = Unknown desc = plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: `sh -c helm template $ARGOCD_APP_NAME -n $ARGOCD_APP_NAMESPACE ${ARGOCD_ENV_HELM_ARGS} . | argocd-vault-plugin generate - ` failed exit status 126: sh: 2: argocd-vault-plugin: Exec format error Error: open /global/values.yaml: no such file or directory
Seems the issue is with ArgoCD. https://github.com/argoproj/argo-cd/issues/12476
@ilya251188 was the Argo CD issue linked above able to help your issue?
Does somebody have any updates? Can we hope multiple sources will be supported? Currently, we have to use single source with helm dependency like as workaround.
Our current workaround is to pull and store the helm chart into the same git repo we store the values in.
repo
|- chart-1.0
|- Chart.yaml
|- ...
|- our-values.yaml
So the app would look something like that
...
source:
repoURL: 'https://our-git/our-repo.git'
path: chart-1.0
targetRevision: HEAD
plugin:
name: argocd-vault-plugin-helm
env:
- name: HELM_ARGS
value: '-f our-values.yaml'
olzemal
Thanks for your advice, but in this case multiple source feature is almost useless. We use a universal chart for the deployment multiple internal applications, and I wanna to keep it in separate repo (chart or oci), and values files in the another repo. As result, I had to refuse from multi sources and backward to use helm dependancy with single ArgoCD source :(
Are there any plans to fix this in future? I'm facing the same issue and it's quite disturbing
Same here, currently can't use the multiple sources with a custom plugin :/
Except the workaround proposed by @olzemal, does someone find another alternative?
I am having the same issue and trying to find a solution for use case when Helm charts are published by an external third party such as Bitnami and I just maintain the values.<environment>.yaml in my own GitHub repos.
Any update on this one ? Has anyone managed to get this working? Plugins with multi-sourced apps
The dirty workaround might be to clone the git repository with values files explicitly during init phase of plugin. I'm attaching pseudocode example of what I have in mind. It's not tested and most likely not working out of the box:
argocd-vault-plugin-helm:
init:
command: [sh, -c]
args: ["git clone https://github.com/my-values-repo ../my-values-repo"]
generate:
command: ["bash", "-o", "pipefail", "-c"]
args: ['helm template $ARGOCD_APP_NAME --include-crds -n $ARGOCD_APP_NAMESPACE -f ../my-values-repo/values.yaml} . | argocd-vault-plugin generate -']
Git binary must be of course available inside the sidecar (if you use default argocd image it's there). The problem might be credentials so you might have to mount there SSH key from some secret or use some username/password combination. my-values-repo string can be probably replaced with $ARGOCD_APP_VALUES_REPO env varible defined in Application manifest.
Help please :) I have the same issue!
As linked above this is an issue with ArgoCD. https://github.com/argoproj/argo-cd/issues/12476 We have no control over how ArgoCD works AVP is just a custom plugin.
The dirty workaround might be to clone the git repository with values files explicitly during
initphase of plugin.
I am trying the similar solution by cloning on-premise (Github Enterprise server) repos in the plugin. However, I agree with you that it is a dirty trick. By the way did you get correct argocd-native solution for deploying Application (helm workload) using multiple sources (values.yaml)? Thanks
I have the same issue when I generate resources by kustomize!