Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with argocd multiple sources #458

Open
ilya251188 opened this issue Jan 27, 2023 · 17 comments
Open

Does not work with argocd multiple sources #458

ilya251188 opened this issue Jan 27, 2023 · 17 comments

Comments

@ilya251188
Copy link

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)

@mircyb
Copy link

mircyb commented Feb 14, 2023

i have same issue, anyone have solution?

@Hax7
Copy link

Hax7 commented Feb 15, 2023

remove plugin part and try again as it's not required with sidecar method anymore

@ilya251188
Copy link
Author

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

@jete-vian
Copy link

Seems the issue is with ArgoCD.
argoproj/argo-cd#12476

@werne2j
Copy link
Member

werne2j commented Mar 22, 2023

@ilya251188 was the Argo CD issue linked above able to help your issue?

@alekseydemidov
Copy link

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.

@olzemal
Copy link

olzemal commented Jun 21, 2023

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'

@alekseydemidov
Copy link

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 :(

@volver-13
Copy link

Are there any plans to fix this in future? I'm facing the same issue and it's quite disturbing

@Diliz
Copy link

Diliz commented Jun 30, 2023

Same here, currently can't use the multiple sources with a custom plugin :/

@subigre
Copy link

subigre commented Jul 24, 2023

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.

@kartik-moolya
Copy link

kartik-moolya commented Sep 13, 2023

Any update on this one ? Has anyone managed to get this working?
Plugins with multi-sourced apps

@welcomeboredom
Copy link

welcomeboredom commented Sep 26, 2023

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.

@andrewkaczynski
Copy link

Help please :) I have the same issue!

@werne2j
Copy link
Member

werne2j commented Nov 2, 2023

As linked above this is an issue with ArgoCD. argoproj/argo-cd#12476 We have no control over how ArgoCD works AVP is just a custom plugin.

@jaythamke
Copy link

The dirty workaround might be to clone the git repository with values files explicitly during init phase 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

@zeusal
Copy link

zeusal commented Dec 5, 2023

I have the same issue when I generate resources by kustomize!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests