Search code examples
githubkuberneteskubernetes-helm

Use git as helm repo throws "does not appear to be a gzipped archive; got 'text/html; charset=utf-8'"


I'm exploring various options to publish charts and referred How to add helm repo from an existing github project? to achieve it. But when I tried to install the chart, I got the error Error: file '/Users/my_home/Library/Caches/helm/repository/chart-1.0.0.tgz' does not appear to be a gzipped archive; got 'text/html; charset=utf-8'

Tried chart-releaser to publish the chart to git. In this case also getting the same error.

When I tried to do wget https://github.com/repo/charts/releases/download/app-1.0.0/chart-1.0.0.tgz content-type is text/html. What's going wrong in this case? How do I fix this issue?


Solution

  • In my case, GitHub is private repo and authentication is required to pull the charts.

    What I was doing?

    helm repo index CHART_NAME --url <Full URL to chart.tgz file>
    

    But

    helm repo add --username u_name --password token <name> https://github.com/raw/ORG/charts/master
    

    will add the helm repo, but helm install <name> won't use the same git token passed in previous step.

    How to fix it?

    helm package <CHART_NAME> -u -d .deploy
    helm repo index .
    

    In this case, index.yaml will contain the relative URL to chart not absolute url.

    Same auth tokens are used to fetch .tgz file as well while running helm install