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

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.

Related

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

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!

unable to build kubernetes objects from release manifest on install stable/rabbitmq-ha

When trying to install "rabbitmq-ha" I have an error:
$ helm install rabbitmq stable/rabbitmq-ha
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "PrometheusRule" in version "monitoring.coreos.com/v1"
Version of Helm and Kubernetes:
Version of Helm : "v3.2.1"
Version of Kubernetes : "v1.17.5-0"
I solved the problem by using this command to install RabbitMQ:
helm install --set replicaCount=2 \
--set rabbitmqUsername=yourUSERNAME \
--set rabbitmqPassword=yourPASSWORD \
--set prometheus.operator.enabled=false \
ha-rabbitmq stable/rabbitmq-ha
but I opened the issue on Github for helm-chart and a contributor on the project say:
Confirming the bug too. This is caused by the following PR: #21274
(comment)
The regression was released in rabbitmq-ha chart version 1.44.2.
1.44.1 works OK.
I am using this flag for the RabbitMQ helm deployment. It worked for me.
--set prometheus.operator.enabled=false

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.

Helm 3.0.2 dry-run + stable/prometheus-operator? Is this supposed to work?

With Helm v3.0.2 + a new Kubernetes v1.14.9 cluster.
fyi, I've already added the stable repo:
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm install \
--namespace prometheus \
prom-dry-run \
stable/prometheus-operator \
--dry-run
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
Error: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "Alertmanager" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "PrometheusRule" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"]
I thought Helm 3 was backward-compatible with existing charts? Is this an exception?
Is prometheus-operator not compatible with Helm 3? Do I have to use Helm 2? Or is there a backward-compatibility option?
The stable repo is scheduled to be deprecated and probably not updated with latest charts.The canonical source for Helm charts is the Helm Hub. Use below command to add repo and install prometheus operator from Helm Hub using helm 3 or helm 2.
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-prom-release bitnami/prometheus-operator
There is a detailed guide for migrating from helm 2 to helm 3
In helm 3 during a dry run, CRDs are not installed but the Kubernetes validation happens against the output of the chart. So any CR that uses a CRD that is installed by the chart will fail validation during dry run.
Current work-arounds:
1.Use helm template instead of dry run
2.Don't reference CRs in the same chart that has the CRDs
3.Install the CRD separately before running the dry run
CRDs were an exception to the Helm v3 chart compatibility, sadly.
The problem is that --dry-run can't generate resources using the CRDs, because the CRDs aren't installed by the dry run. This is apparently a "documented behaviour" although it was documented in the implementation pull-request, not in the Helm Documentation.
Edit: I forgot to mention the best current workaround is to install the CRDs by hand. Then --dry-run will work. Helm v3 ignores CRDs that are already installed, so you can just leave them there once you're happy with your configuration and do the install for real.
Upgrading CRDs in Helm is a whole different (not yet resolved) issue.
stable/prometheus-operator gained support to Helm v3 in 8.2.0 in mid-November 2019 so that's not the issue here.
bitnami/prometheus-operator gained support in 0.3.0 only a couple of days earlier.
Both appear to be actively maintained at the time of writing (March 2020).
In case anyone comes looking and is confused that the above two chart names are not links: Both have been renamed, and one has moved.
They are now prometheus-community/kube-prometheus-stack (replaces stable/prometheus-operator) and bitnami/kube-prometheus respectively.

helm install "unknown flag: --output"

helm install myChart-0.0.1.tgz --output json results in Error: unknown flag: --output
I use helm version v2.14.3. According to the docs https://helm.sh/docs/helm/#helm-install this should work. Other flags seem to work fine. E.g. helm install myChart-0.0.1.tgz --namespace test-ns --set random.variable="debug" --name mychart
The documentation also states the schema helm install [CHART] [flags],
while its examples suggest the schema helm install [flags] [CHART] in my tests both seem to work but non accepts the output flag.
The output flag was added with commit a52d6de9e17fc4dda4928f0029362e9be075aa24 which is only present in the release-2.15 branch. The documentation is generated from master, so it already has the option, but your version does not yet.
Your current version doesn't support the --output flag, to use it upgrade your helm version to v2.15.0.
From: V2.15.0 Changelog
Introduced --output to helm repo list, helm search, and helm install