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

Private helm repository - 401 Unauthorized #613

Open
jirimedved opened this issue Mar 8, 2024 · 2 comments
Open

Private helm repository - 401 Unauthorized #613

jirimedved opened this issue Mar 8, 2024 · 2 comments

Comments

@jirimedved
Copy link

Hello,
I have a problem with vault-plugin, if I use helm chart from private repository. I have the private repository set in ArgoCD including credentials.

% argocd repo list
TYPE  NAME                 REPO                                                  INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
helm  dockerhub-powerflow  https://dockerhub.xxxxx.cloud/chartrepo/powerflow     false     false  false  true   Successful

I use a plugin as a sidecar ( avp - v0.17.0, argocd 2.4.17 ).

My settings for avp plugin:

apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
  name: argocd-vault-plugin-helm
spec:
  allowConcurrency: true

   # Note: this command is run _before_ any Helm templating is done, therefore the logic is to check
  # if this looks like a Helm chart
  discover:
    find:
      command:
        - sh
        - "-c"
        - "find . -name 'Chart.yaml' && find . -name 'values.yaml'"
  init:
    command:
      - sh
      - "-c"
      - "helm dependency build"
  generate:
    command:
      - sh
      - "-c"
      - |
        helm template $ARGOCD_APP_NAME -n $ARGOCD_APP_NAMESPACE ${ARGOCD_ENV_HELM_ARGS} . |
        argocd-vault-plugin generate -s argocd-system:vault-configuration -
  lockRepo: false

Part of the deployment argocd-repo-server

containers:
- command:
  - /var/run/argocd/argocd-cmp-server
  image: quay.io/argoproj/argocd:v2.4.17
  name: avp-helm
  securityContext:
    runAsNonRoot: true
    runAsUser: 999
  volumeMounts:
  - mountPath: /var/run/argocd
    name: var-files
  - mountPath: /home/argocd/cmp-server/plugins
    name: plugins
  - mountPath: /tmp
    name: tmp
  - mountPath: /home/argocd/cmp-server/config/plugin.yaml
    name: cmp-plugin
    subPath: avp-helm.yaml
  - mountPath: /usr/local/bin/argocd-vault-plugin
    name: custom-tools
    subPath: argocd-vault-plugin

I get this error when refreshing or syncing

ComparisonError: rpc error: code = Unknown desc = Manifest generation error (cached): plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: `sh -c helm dependency build` failed exit status 1: Error: no cached repository for helm-manager-af8c372997109c698e4340e7b89856ada47975c4a7e047bb9ed5665cb2fb2d86 found. (try 'helm repo update'): open /home/argocd/.cache/helm/repository/helm-manager-af8c372997109c698e4340e7b89856ada47975c4a7e047bb9ed5665cb2fb2d86-index.yaml: no such file or directory
rpc error: code = Unknown desc = plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: `sh -c helm dependency build` failed exit status 1: Error: could not find : chart artemismq not found in
https://dockerhub.xxxxx.cloud/chartrepo/powerflow:
looks like "
[https://dockerhub.xxxxx.cloud/chartrepo/powerflow"](https://dockerhub.xxxxx.cloud/chartrepo/powerflow%22)
is not a valid chart repository or cannot be reached: failed to fetch
https://dockerhub.xxxxx.cloud/chartrepo/powerflow/index.yaml
: 401 Unauthorized
@jirimedved
Copy link
Author

Can you help me? How to use private repositories?

@ebuildy
Copy link

ebuildy commented Sep 9, 2024

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

2 participants