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

kustomize + helmCharts: + oci registry not working #21257

Open
3 tasks done
marc-cenon opened this issue Dec 19, 2024 · 4 comments
Open
3 tasks done

kustomize + helmCharts: + oci registry not working #21257

marc-cenon opened this issue Dec 19, 2024 · 4 comments
Labels
bug Something isn't working component:config-management Tools specific issues (helm, kustomize etc) version:2.13 Latest confirmed affected version is 2.13

Comments

@marc-cenon
Copy link

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug
Using kustomize with helmCharts and oci registry to deploy an application is not working
It seems that the registry url or format is not recognized.

To Reproduce

  • make sure that kustomize with helm support is activated in argocd-cm
  kustomize.buildOptions: --enable-alpha-plugins --enable-helm --enable-exec --load-restrictor
  • create a kustomization.yaml file to pull redis from bitnami with oci registry
helmCharts:
  - name: redis
    releaseName: redis
    version: 20.6.0
    repo: oci://registry-1.docker.io/bitnamicharts
    namespace: redis
    includeCRDs: true
  • test to build with kustomize
kustomize build --enable-helm .
  • the helm chart is correctly generated.
  • create the secret in argo for the oci registry and check it is connected correctly
apiVersion: v1
kind: Secret
metadata:
  labels:
    argocd.argoproj.io/secret-type: repository
  name: docker-io-helm-oci
  namespace: argocd
stringData:
  url: registry-1.docker.io/bitnamicharts
  name: bitnamicharts
  type: helm
  enableOCI: "true"
  • now create an application in argocd to pull that repo
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: redis
  namespace: argocd
spec:
  destination:
    namespace: redis
    server: {{ .Values.k8s_cluster }}
  project: redis
  source:
    path: applications/overlays/{{ .Values.k8s_target }}/redis
    repoURL: {{ .Values.git_url }}
    targetRevision: {{ .Values.git_target }}
  syncPolicy:
    automated:
      allowEmpty: true
      selfHeal: false
    syncOptions:
      - CreateNamespace=true
  • deploy this result in an error

Expected behavior

  • the application should be deployed correctly

Version

-> % argocd version
argocd: v2.13.1+af54ef8
  BuildDate: 2024-11-20T18:35:51Z
  GitCommit: af54ef8db5adfa77a08d4d05b1318a2198084c22
  GitTreeState: clean
  GoVersion: go1.23.3
  Compiler: gc
  Platform: darwin/arm64
argocd-server: v2.12.3+6b9cd82
  BuildDate: 2024-08-27T11:57:48Z
  GitCommit: 6b9cd828c6e9807398869ad5ac44efd2c28422d6
  GitTreeState: clean
  GoVersion: go1.22.4
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.4.2 2024-05-22T15:19:38Z
  Helm Version: v3.15.2+g1a500d5
  Kubectl Version: v0.29.6
  Jsonnet Version: v0.20.0

Logs

Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = Manifest generation error (cached): `kustomize build <path to cached source>/applications/overlays/redis/--enable-alpha-plugins --enable-helm --enable-exec --load-restrictor LoadRestrictionsNone` failed exit status 1: Error: accumulating resources: accumulation err='accumulating resources from './../../../base/redis': read <path to cached source>/applications/overlays/base/redis: is a directory': recursed accumulation of path '<path to cached source>/applications/overlays/base/redis': Error: looks like "oci://registry-1.docker.io/bitnamicharts" is not a valid chart repository or cannot be reached: object required : unable to run: 'helm pull --untar --untardir <path to cached source>/applications/overlays/base/redis/charts --repo oci://registry-1.docker.io/bitnamicharts redis --version 20.6.0' with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-933243091/helm HELM_CACHE_HOME=/tmp/kustomize-helm-933243091/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-933243091/helm/.data] (is 'helm' installed?)
@marc-cenon marc-cenon added the bug Something isn't working label Dec 19, 2024
@reggie-k
Copy link
Member

reggie-k commented Dec 19, 2024

Can one of the solutions listed here help?
#10823

@marc-cenon
Copy link
Author

Hi,
No, There are some simillar elements but nothing works.
What is confusing to me is that locally, when i triend to build the helm chart with kustomize it is working using the command:

kustomize build --enable-helm .

What is strange in the log I see that it is trying to do the following command:

helm pull --untar --untardir <path to cached source>/applications/overlays/base/redis/charts --repo oci://registry-1.docker.io/bitnamicharts redis --version 20.6.0

Using oci, this command will no work. I am able to pull the image with this command instead:

helm pull oci://registry-1.docker.io/bitnamicharts/redis --version 20.6.0

I also tried to setup a sidecar for CMP in the repo container with the following configuration in my argocd helm chart :

cmp:
    create: true
    plugins:
      kusto-helm:
        generate:
          command: [ "sh", "-c" ]
          args: [ "kustomize build --enable-alpha-plugins --enable-helm --enable-exec" ]

And the I call the plugin correctly but it is not working either. The error message the same:

ailed to load target state: failed to generate manifest for source 1 of 1: 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 "kustomize build --enable-alpha-plugins --enable-helm --enable-exec"` failed exit status 1: Error: accumulating resources: accumulation err='accumulating resources from './../../../base/redis': '/tmp/_cmp_server/29eb882c-4131-45bf-a45f-cabc6ffaf7c0/applications/overlays/base/redis' must resolve to a file': recursed accumulation of path '/tmp/_cmp_server/29eb882c-4131-45bf-a45f-cabc6ffaf7c0/applications/overlays/base/redis': Error: looks like "oci://registry-1.docker.io/bitnamicharts" is not a valid chart repository or cannot be reached: object required : unable to run: 'helm pull --untar --untardir /tmp/_cmp_server/29eb882c-4131-45bf-a45f-cabc6ffaf7c0/applications/overlays/base/redis/charts --repo oci://registry-1.docker.io/bitnamicharts redis --version 20.6.0' with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-3484055696/helm HELM_CACHE_HOME=/tmp/kustomize-helm-3484055696/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-3484055696/helm/.data] (is 'helm' installed?)

@marc-cenon
Copy link
Author

also I just found out something weird:

argocd repo get registry-1.docker.io/bitnamicharts
TYPE  NAME           REPO                                INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
helm  bitnamicharts  registry-1.docker.io/bitnamicharts  false     false  false  false  Successful           infra

argocd repo list
TYPE  NAME           REPO                                INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
helm  bitnamicharts  registry-1.docker.io/bitnamicharts false     true   false  false  Successful           infra

Why the OCI parameter can be true and false at the same time ?

@andrii-korotkov-verkada andrii-korotkov-verkada added component:config-management Tools specific issues (helm, kustomize etc) version:2.13 Latest confirmed affected version is 2.13 labels Dec 22, 2024
@marc-cenon
Copy link
Author

hello,
I haven't yet found out why kustomize + helmCharts: + oci registry is not working
If someone can look into it
thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:config-management Tools specific issues (helm, kustomize etc) version:2.13 Latest confirmed affected version is 2.13
Projects
None yet
Development

No branches or pull requests

3 participants