Helm looks in a different repository then the one I specify with a --repo flag - kubernetes

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

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)

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

dask-getway on K8s using helm3: Error: failed to install CRD crds/daskclusters.yaml

I'm following the instructions to setup Dask on K8s Cluster. I'm on MacOS, have K8s running on Docker Desktop, kubectl version 1.22.5 and helm version 3.8.0. After adding the repository, downloading default configuration, installing helm chart using command
RELEASE=my-dask-gateway
NAMESPACE=dask-gateway
VERSION=0.9.0
helm upgrade --install \
--namespace $NAMESPACE \
--version $VERSION \
--values path/to/your/config.yaml \
$RELEASE \
dask/dask-gateway
generates following output/error
"dask" already exists with the same configuration, skipping
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "dmwm-bigdata" chart repository
...Successfully got an update from the "dask" chart repository
Update Complete. ⎈Happy Helming!⎈
Release "my-dask-gateway" does not exist. Installing it now.
Error: failed to install CRD crds/daskclusters.yaml: unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
An older post suggests to either update the manifest or use older version of kubernetes. Does that mean dask is not compatible with recent versions of kubernetes?
Posting community wiki answer for better visibility:
This is fixed in the repo main. You could grab the CRDs from there, or wait for a release, which we are hoping to do soon. Otherwise, yes, you would need an older version of kubernetes for dask-gateway to work.

Failed to download JupyterHub via helm

I am trying to download/install the jupyterhub helm chart.
> helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
"jupyterhub" has been added to your repositories
> helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "jupyterhub" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈ Happy Helming!⎈
> helm upgrade --install jhub jupyterhub/jupyterhub --namespace jhub --version=0.8.2 --values config.yaml
Error: failed to download "jupyterhub/jupyterhub" (hint: running `helm repo update` may help)
(trying helm repo update again does not work)
When I look at my repos, I can see jupyterhub:
> helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
jupyterhub https://jupyterhub.github.io/helm-chart/
what am i missing? could it be upstream repo server issue?
Wow. The problem was that I had quotes around the version. it did not accept that. This works:
helm upgrade --install jhub jupyterhub/jupyterhub --namespace jhub --version=0.8.2 --values config.yaml

How to upgrade helm from 2 to 3 version in jenkinsx installed in okd environment

I want to upgrade helm version from 2 version to 3 version since I am facing "Could not find tiller" issue in while using "helm delete --purge " in JenkinsX.
So upgrade does not depend on tiller and makes my job easy. Please help me to resolve this.
jx step helm build
WARNING: No $CHART_REPOSITORY defined so using the default value of: http://jenkins-x-chartmuseum:8080
Adding missing Helm repo: storage.googleapis.com https://storage.googleapis.com/chartmuseum.jenkins-x.io
Successfully added Helm repository storage.googleapis.com.
Adding missing Helm repo: jenkins-x-chartmuseum http://jenkins-x-chartmuseum:8080
Successfully added Helm repository jenkins-x-chartmuseum.
WARNING: No $CHART_REPOSITORY defined so using the default value of: http://jenkins-x-chartmuseum:8080
Adding missing Helm repo: chartmuseum.jenkins-x.io http://chartmuseum.jenkins-x.io
Successfully added Helm repository chartmuseum.jenkins-x.io.
EXITCODE 0[Pipeline] sh
[preview] Running shell script
+ make delete
helm version
Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Error: could not find tiller
use the command choco upgrade kubernetes-helm
first install chococo/brew then use above for choco cmd or brew upgrade helm.
The latest Helm 3 won't need tiller pod.

does helm have feature of print?

As we knew, helm charts are made by templates with variables and reference values from values.yml. I'd like to review the final heml chart, but there is no print or output feature.
For example, in serverless framework, I can run sls print to get the final serverless.yml
But I can't find the similar command in heml, such as
helm print <chart_name> -f values.yml
Make use of --debug and --dry-run option.
helm install ./mychart --debug --dry-run
Quoting statement from this official doc.
When you want to test the template rendering, but not actually install
anything, you can use helm install ./mychart --debug --dry-run. This
will send the chart to the Tiller server, which will render the
templates. But instead of installing the chart, it will return the
rendered template to you so you can see the output.
There is another way to do this without need of connection to tiller.
helm template ./mychart
Hope this helps.
Update:
Printing rendered contents of one of the stable chart (in my case airflow stable chart) would look like:
Using --debug and --dry-run option
helm install --namespace "airflow" --name "airflow" stable/airflow --debug --dry-run -f values.yaml
Using helm template
helm fetch stable/airflow
tar -xvf airflow-4.0.8.tgz
helm template --namespace "airflow" --name "airflow" ./airflow -f airflow/values.yaml
updates
Somehow, directly run helm template ./mychart doesn't work any more with below error.
For example,
$ git clone git#github.com:helm/charts.git
$ cd charts/stable/datadog
$ helm template .
Error: found in Chart.yaml, but missing in charts/ directory: kube-state-metrics
There are two new files in this folders
requirements.yaml
requirements.lock
they both mentioned a repository called https://kubernetes-charts.storage.googleapis.com/
So we need add it in helm
helm repo add common https://kubernetes-charts-incubator.storage.googleapis.com/
helm dependency update
helm template .
Now everything works as normal.
For your reference, my current helm version is v3.2.1.

Kubernetes Helm Chart Won't Update

Delete the cached archive to force a redownload:
rm -rf ~/.helm/cache/archive/cp-helm-charts-0.1.0.tgz
Do an explicit repo update
helm repo update
Do a debug/dry-run install to force a download:
helm install --debug --dry-run confluent/cp-helm-charts > /dev/null
Look at the specific file in the .tgz archive where I want to see the fix:
tar xfO ~/.helm/cache/archive/cp-helm-charts-0.1.0.tgz cp-helm-charts/charts/cp-kafka/templates/statefulset.yaml | grep -n -C10 volumes:
Compare to the latest version on github, which was modified 8 days ago:
https://github.com/confluentinc/cp-helm-charts/blob/master/charts/cp-kafka/templates/statefulset.yaml#L140
The github version has - name: datadir-0. The version Helm pulls just has - name: datadir without the trailing -0.
Why does the .tgz file that Helm pulls not have the latest fix in the master branch version on github? How do I fix this?
FYI, my relevant environment information:
helm version
Client: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567c5d103fed435be", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567c5d103fed435be", GitTreeState:"clean"}
helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
confluent https://confluentinc.github.io/cp-helm-charts/
The chart maintainer is distributing a .tgz chart that is not up to date with recent git commits. They recommend you build your own chart .tgz.