helmfile icon indicating copy to clipboard operation
helmfile copied to clipboard

Error installing helm release from remote kustomization.yaml

Open emilhdiaz opened this issue 3 years ago • 0 comments

With Kubernetes Operators becoming ubiquitous, many Helm charts now require CRDs to be pre-installed before the chart itself can be installed. For example, the aws-load-balancer-controller requires several CRDs to be installed: https://github.com/aws/eks-charts/tree/master/stable/aws-load-balancer-controller#helm-installation

The CRDs in this case are provided as a Kustomize project under a subdirectory of the github project: https://github.com/aws/eks-charts/tree/master/stable/aws-load-balancer-controller/crds

Which I am attempting to install with the following helmfile.yaml:

repositories:
  - name: eks
    url: https://aws.github.io/eks-charts

releases:
  - name: aws-load-balancer-controller-crds
    chart: git::https://github.com/aws/eks-charts.git@stable/aws-load-balancer-controller/crds
    disableValidation: true

  - name: aws-load-balancer-controller
    chart: eks/aws-load-balancer-controller
    version: ~1.3.3
    namespace: kube-system
    values:
      - values.yaml.gotmpl

However the applying the above helmfile, produces the following error coming from kustomize:

COMMAND:
  kustomize -o /var/folders/7r/rnj46l1j4dg30w3r14ljkxpr0000gn/T/chartify3744656772/aws-load-balancer-controller-crds/templates/kustomized.yaml build --load-restrictor=LoadRestrictionsNone --enable-alpha-plugins /var/folders/7r/rnj46l1j4dg30w3r14ljkxpr0000gn/T/chartify3744656772/aws-load-balancer-controller-crds

OUTPUT:
  Error: accumulating resources: accumulation err='accumulating resources from '/aws-load-balancer-controller/.helmfile/cache/aws-load-balancer-controller-crds/https_github_com_aws_eks-charts_git/stable/aws-load-balancer-controller/crds': read /aws-load-balancer-controller/.helmfile/cache/aws-load-balancer-controller-crds/https_github_com_aws_eks-charts_git/stable/aws-load-balancer-controller/crds: is a directory': git cmd = '/usr/local/bin/git fetch --depth=1 origin HEAD': exit status 128]

NOTE:

  • Kustomize is supported as per: https://github.com/roboll/helmfile/pull/673
  • the syntax for the remote https git repo comes from this suggestion: https://github.com/roboll/helmfile/issues/1720#issuecomment-816202472
  • the remote kustomization.yaml and crds.yaml files are in a folder as suggested by: https://github.com/roboll/helmfile/issues/1757
  • replicating the remote Kustomize project structure locally and pointing to that local copy in the helmfile.yaml works correctly.

emilhdiaz avatar Jan 27 '22 01:01 emilhdiaz