kapp-controller icon indicating copy to clipboard operation
kapp-controller copied to clipboard

Kapp deploy with helm chart fetch throws "helm chart pull" error

Open troll-warlord opened this issue 1 year ago • 5 comments

I am getting helm error on running the command kapp deploy -a metrics-collection -f pasx/package-install-metrics-collection.yaml -y Here is my package CRD

apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
  name: metrics.azure.io.1.2.0
spec:
  refName: metrics.azure.io
  version: 1.2.0
  releaseNotes: |
    Initial release of the metrics package
  valuesSchema:
    openAPIv3:
      nullable: true
      default: null
  template:
    spec:
      fetch:
      - helmChart:
          name: metrics
          version: 1.2.0
          repository:
            url: oci://<registry-host-name>/apps/
            secretRef:
              name: carvel-pull-secret
        path: metrics
      template:
      - helmTemplate:
          path: metrics/
          name: metrics
          namespace: metrics
      - kbld:
          paths:
          - metrics/.imgpkg/images.yml
          - '-'
      deploy:
      - kapp: {}

Error:

kapp: Error: waiting on reconcile packageinstall/metrics (packaging.carvel.dev/v1alpha1) namespace: default:
  Finished unsuccessfully (Reconcile failed:  (message: vendir: Error: Syncing directory '0':
  Syncing directory '.' with helm chart contents:
    Helm chart pull: exit status 1 (stderr: Error: unknown command "chart" for "helm"
Run 'helm --help' for usage.
)
))

The error is because helm chart pull command was deprecated in helm version 3.7.0 and replaced it with helm pull as per https://github.com/helm/helm/releases/tag/v3.7.0 image

Application versions:

troll-warlord:carvel-demo$ kapp version
kapp version 0.62.1

Succeeded
troll-warlord:carvel-demo$ vendir version
vendir version 0.40.2

Succeeded
troll-warlord:carvel-demo$ kctrl version
kctrl version 0.52.0

Succeeded
troll-warlord:carvel-demo$ ytt version
ytt version 0.49.1
troll-warlord:carvel-demo$ helm version
version.BuildInfo{Version:"v3.14.4", GitCommit:"81c902a123462fd4052bc5e9aa9c513c4c8fc142", GitTreeState:"clean", GoVersion:"go1.21.9"}

troll-warlord avatar Jul 01 '24 09:07 troll-warlord

You are facing this issue because you are using helm oci chart. The oci feature graduated in v3.8.0 and was experimental before that and we don't support it yet. You should be able to use imgpkg to fetch it. cc @joaopapereira

praveenrewar avatar Jul 04 '24 03:07 praveenrewar

That is true unless the chart retrieves other charts. Vendir itself will execute helm pull, so I am not 100% sure where this error is coming from.

joaopapereira avatar Jul 05 '24 14:07 joaopapereira

Ah, my bad, I didn't notice that we support oci sources as well.

That is true unless the chart retrieves other charts.

@troll-warlord Could you check this?

praveenrewar avatar Jul 12 '24 06:07 praveenrewar

I didn't face this issue using vendir sync command for the same chart

troll-warlord avatar Jul 12 '24 06:07 troll-warlord

What version of kapp-controller are you using?

joaopapereira avatar Jul 16 '24 14:07 joaopapereira