Home > Net >  Helm looks in a different repository then the one I specify with a --repo flag
Helm looks in a different repository then the one I specify with a --repo flag

Time:10-14

If I perform the following command it looks in "https://github.com/grafana/" instead of the one I specified - "https://grafana.github.io/helm-charts"

Here is what I run and the results:

helm3 upgrade --install grafana grafana --dry-run --repo https://grafana.github.io/helm-charts --wait

Release "grafana" does not exist. Installing it now.

Error: failed to download "https://github.com/grafana/helm-charts/releases/download/grafana-6.16.14/grafana-6.16.14.tgz"

Why is it looking in "github.com/grafana" instead of where I told it to look with the repo flag - "grafana.github.io"?

My co worker runs the same command and it works. I list the repositories and grafana is not there so I would assume that would force this to work?

helm3 repo list
NAME                            URL                                                              
stable                          https://charts.helm.sh/stable                                    
local                           http://127.0.0.1:8879/charts                                     
eks                             https://aws.github.io/eks-charts                                 
bitnami                         https://charts.bitnami.com/bitnami                               
cluster-autoscaler              https://kubernetes.github.io/autoscaler                          
kube-dns-autoscaler             https://kubernetes-sigs.github.io/cluster-proportional-autoscaler
cluster-proportional-autoscaler https://kubernetes-sigs.github.io/cluster-proportional-autoscaler
external-dns                    https://charts.bitnami.com/bitnami                               
kube2iam                        https://jtblin.github.io/kube2iam/                               
kubernetes-dashboard            https://kubernetes.github.io/dashboard/                          
incubator                       https://charts.helm.sh/incubator

My coworker has the same repo list output as above.

The below commands will work in my system however I want to know why for me it will not work when I use the --repo flag as in the above example (all of our code has that flag in it and they do not want to change it) :

helm3 repo add grafana https://grafana.github.io/helm-charts
"grafana" has been added to your repositories

 kconfig_et helm3 upgrade --install grafana grafana/grafana --dry-run --wait 

CodePudding user response:

I executed your Helm command but with --debug flag to get this error:

helm upgrade --install grafana grafana --dry-run --repo https://grafana.github.io/helm-charts --wait --debug
history.go:56: [debug] getting history for release grafana
Release "grafana" does not exist. Installing it now.
install.go:178: [debug] Original chart version: ""
Error: no cached repo found. (try 'helm repo update')

Then I simply executed helm repo update as suggested. I then retried the same helm upgrade command and it successfully installed the chart.

You coworker did not encounter the error because at some point he/she has executed helm repo update at least once. (Mine was a freshly installed Helm)

CodePudding user response:

I solved it - I added "--debug" to the command and saw this -

Error: no cached repo found. (try 'helm repo update'): open /Users/mysystem/Library/Caches/helm/repository/local-index.yaml: no such file or directory

I next copied the one in .helm over to the location in the debug message -

cp ~/.helm/repository/local/index.yaml /Users/mysystem/Library/Caches/helm/repository/local-index.yaml

All worked after this!

  • Related