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

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.

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.

microk8s - helm3 / function "lookup" not defined

I recently installed microk8s, and enabled helm3 and dns addons on microk8s.
Deployment from stable/chart works fine but any deployment from bitnami/chart fails.
OS: Ubuntu 20.04.1 LTS -- microk8s: 1.19/stable
microk8s.helm3 install my-release bitnami/jenkins
=> Error: parse error at (jenkins/charts/common/templates/_secrets.tpl:84): function "lookup" not defined
microk8s.helm3 install my-release bitnami/magento
=> Error: parse error at (magento/charts/elasticsearch/charts/common/templates/_secrets.tpl:84): function "lookup" not defined
There was a bug reported here and here which was caused by the conditional inclusion of lookup into the function map.
A fix for it was merged here and is now available from Helm version 3.2.0.
So, in order to fix this issue you should update your Helm to version 3.2.0 or newer.
Faced with the same issue while installing Kafka. The solution is to install a newer version of Helm 3 and use its commands with --kubeconfig specified:
microk8s config > kubeconfig.yaml
sudo snap install helm --classic
/snap/bin/helm repo add bitnami https://charts.bitnami.com/bitnami
/snap/bin/helm install --wait kafka bitnami/kafka --set metrics.jmx.enabled=true --kubeconfig kubeconfig.yaml
Try to install helm3 with snap and then link it to microk8s:
sudo snap install helm --classic
sudo mkdir /var/snap/microk8s/current/bin
sudo ln -s /snap/bin/helm /var/snap/microk8s/current/bin/helm
There seems to be some issues using helm3.0 instead of helm 3.1
thanks for all of the information
I fixed this by using the snap helm (version 3.6.3) on ubuntu
microk8s config > ~/.kube/config
chmod go-r ~/.kube/config
sudo snap install helm --classic
then doing the helm repo add, update, and install charts without errors

Error: uninstall: Release not loaded: v3.0.0-beta.3: release: not found

I have recently updated my helm version to v3.0.0-beta. I need to revert back to the helm version to 2. When i tried to switch to the helm version 2, it s spitting an error like "Error: uninstall: Release not loaded: v3.0.0-beta.3: release: not found".
Helm version:
version.BuildInfo{Version:"v3.0.0-beta.3", GitCommit:"5cb923eecbe80d1ad76399aee234717c11931d9a", GitTreeState:"clean", GoVersion:"go1.12.9"}
Command tried to uninstall : helm reset
Also tried brew uninstall helm and helm reset --force
Error:
"Error: uninstall: Release not loaded: v3.0.0-beta.3: release: not
found"
Is there anyway to downgrade Helm version from 3 to 2...?
It has been resolved.. Download the stable version from
helm v2.15.2
and then find the helm binary in the unpacked directory, and move it to its desired destination (mv linux-amd64/helm /usr/local/bin/helm.
Client: &version.Version{SemVer:"v2.15.2", GitCommit:"8dce272473e5f2a7bf58ce79bb5c3691db54c96b", GitTreeState:"clean"}
There is a command to rollback to the last successful release. You need to define target release version as 0:
helm rollback <RELEASE> 0
More details can be found under this github thread.
Please let me know if that helped.

How to set customized release name in helmchart

After creating package in Helm , I am facing difficulty in setting customized chart name I tried below commands
> helm install --name example ./mychart --set service.type=NodePort
> helm install happy-panda stable/mariadb
Also, tried commands from helm man page
> helm install -help
> --name-template string specify template used to name the release
Before setting your custom release name you've to check your Helm version . Above commands mentioned in question didn't worked in below Helm version
root#docker-slave:/home/mec/src/vmmanager/docker/vmmanager_chart# helm version
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
For Helm 2 version.
helm install --name your_customized_name chart_name
Like , helm install --name vmchart vmmanager_chart
For Helm 3 version,
helm install [--namespace ] # Per-default you need
to provide a release name
For detailed description you can refer below link.
https://lzone.de/cheat-sheet/Helm

Helm install unknown flag --name

When I try to install a chart with helm:
helm install stable/nginx-ingress --name my-nginx
I get the error:
Error: unknown flag: --name
But I see the above command format in many documentations.
Version:
version.BuildInfo{Version:"v3.0.0-beta.3",
GitCommit:"5cb923eecbe80d1ad76399aee234717c11931d9a",
GitTreeState:"clean", GoVersion:"go1.12.9"}
Platform: Windows 10 64
What could be the reason?
In Helm v3, the release name is now mandatory as part of the commmand, see helm install --help:
Usage:
helm install [NAME] [CHART] [flags]
Your command should be:
helm install my-nginx stable/nginx-ingress
Furthermore, Helm will not auto-generate names for releases anymore. If you want the "old behavior", you can use the --generate-name flag. e.g:
helm install --generate-name stable/nginx-ingress
The v3 docs are available at https://v3.helm.sh/docs/, but as it is a beta version, the docs will not be accurate for a while. It's better to rely on the CLI --help, that is auto-generated by Go/Cobra.
The --name flag is no more in version 3.
It should be
helm install my-nginx stable/nginx-ingress
Syntax:
help install [name] [chart]
I don't think the helm3 does support "--name" argument. As per the helm3 doc, the command to install a package and expected output is given down below:
$ helm install happy-panda bitnami/wordpress
NAME: happy-panda
LAST DEPLOYED: Tue Jan 26 10:27:17 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
** Please be patient while the chart is being deployed **
Here "happy-panda" is the name of the release and "bitnami/wordpress" is the name of the chart. Also you can generate name for the release by using
--generate-name flag.
As others have mentioned, there is no --name flag in version 3 of Helm. Also, Helm v3 comes without stable repository setup by default. The best way to discover a chart by searching the Artifact Hub. Once you find the repo, which hosts the chart you are looking for, you need to add the repo as:
helm repo add nginx-stable https://helm.nginx.com/stable
And then you can install chart
helm install my-nginx nginx-stable/nginx-ingress
As name was made compulsory in helm3,
if we do helm repo --help,
help install [name] [chart]
If the chart was not present,
use helm repo add <name> <url>
then use helm install