microk8s - helm3 / function "lookup" not defined - kubernetes

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

Related

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 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

Helm: Incompatible versions between client and server

After I have run helm list I got following error:
Error: incompatible versions client[v2.9.0] server[v2.8.2]
I did a helm init to install the compatible tiller version
"Warning: Tiller is already installed in the cluster.
(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)".
Any pointers?
Like the OP, I had this error:
$ helm list
Error: incompatible versions client[v2.10.0] server[v2.9.1]
Updating the server wasn't an option for me so I needed to brew install a previous version of the client. I hadn't previously installed client[v2.9.1] (or any previous client version) and thus couldn't just brew switch kubernetes-helm 2.9.1. I ended up having to follow the steps in this SO answer: https://stackoverflow.com/a/17757092/2356383
Which basically says
Look on Github for the correct kubernetes-helm.rb file for the version you want (2.9.1 in my case): https://github.com/Homebrew/homebrew-core/search?q=kubernetes-helm&type=Commits
Click the commit hash (78d6425 in my case)
Click the "View" button to see the whole file
Click the "Raw" button
And copy the url: https://raw.githubusercontent.com/Homebrew/homebrew-core/78d64252f30a12b6f4b3ce29686ab5e262eea812/Formula/kubernetes-helm.rb
Now that I had the url for the correct kubernetes-helm.rb file, I ran the following:
$ brew unlink kubernetes-helm
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/78d64252f30a12b6f4b3ce29686ab5e262eea812/Formula/kubernetes-helm.rb
$ brew switch kubernetes-helm 2.9.1
Hope this helps someone.
To upgrade your tiller version to the same version of the client, just run helm init --upgrade
NOTE: If you're trying to downgrade the server version to match your local client version, run the following instead:
helm init --upgrade --force-upgrade
Another alternative, if changing the server version is not an option, is to use the
helm installer script
The script lets you chose a specific version like so
./get_helm.sh -v v2.13.1
Another approach to using different versions through Docker.
https://hub.docker.com/r/alpine/helm
Example: list helm packages installed
docker run -it --rm \
-v ~/.kube/config:/root/.kube/config \
-v ~/.helm:/root/.helm alpine/helm:2.9.1 \
list
This is a long command; but it can be shortened with an alias
alias helm_2_9_1="docker run -ti --rm \
-v $(pwd):/apps -v ~/.kube/config:/root/.kube/config \
-v ~/.helm:/root/.helm alpine/helm:2.9.1"
And then the command is
helm_2_9_1 list
This answer is for who want to choose(downgrade) helm client version, and the brew install is not work.You can just manually install the binary file from here.
example:
you can unlink the current helm
brew unlink kubernetes-helm
choose and download the helm version you want in github helm------v2.8.2
unzip the file and put the helm unix executable binary file into /usr/local/bin directory
go to the directory you just downloaded
cd /Users/your_name/Downloads
unzip the file
gunzip -c helm-v2.8.2-darwin-amd64.tar.gz | tar xopf -
copy to the bin directory
cp darwin-amd64/helm /usr/local/bin
now you will see the right version of helm you want
helm version
For those having installed their helm client with snap, to downgrade/upgrade it to a specific version you can simply:
Uninstall it: snap remove helm
Check the available versions: snap info helm
Install the one you want: snap install helm --channel=X.X/stable --classic
This probably isn't the most advanced answer... but my team runs kubernetes clusters that already have tiller installed. While setting up a new laptop, I wanted my helm to match the tiller version, so I found it like this:
TILLER_POD=`kubectl get pods -n kube-system | grep tiller | awk '{print $1}'`
kubectl exec -n kube-system $TILLER_POD -- /tiller -version
Then I just used the normal helm install instructions from that release number (being on Linux, its basically just curl and unzip to /usr/local/bin).
If you are windows user and installed helm through choco, firstly go its folder (mine is C:\ProgramData\chocolatey) and delete helm.exe from bin folder.
Then, corresponding heml.exe file should be downloaded. By using the above comments, decide the location where you will download exe from. For instance, I used that path: https://get.helm.sh/helm-v2.14.3-windows-amd64.tar.gz
Finally extract the helm.exe from tar and move into choco bin folder. Of course, you can directly add this exe into the path.
I experienced same issue, but in my case I wanna only to upgrade Tiller to specific version (because helm client is running remotely).
So, error was:
Error: UPGRADE FAILED: incompatible versions client[v2.11.0] server[v2.9.1]
Accordingly to documentation I've run:
$ kubectl --namespace=kube-system set image deployments/tiller-deploy tiller=gcr.io/kubernetes-helm/tiller:v2.11.0
deployment.extensions/tiller-deploy image updated
Documentation reference:
https://helm.sh/docs/install/#upgrading-tiller

Kubernetes fission setup error

There is an error during fission setup on minikube.
I went through this instruction: http://fission.io/docs/v0.2.1/install/
On this command:
helm install --namespace fission --set serviceType=NodePort https://github.com/fission/fission/releases/download/v0.2.1/fission-all-v0.2.1.tgz
There is an error:
Error: apiVersion "rbac.authorization.k8s.io/v1beta1" in fission-all/templates/deployment.yaml is not available
My env is OSX Sierra 10.12.16
kubectl version is: 1.7.
Finally I was figured out that the problem was due to installation of old minikube version: v0.16.0.
After upgrade to v0.22.1 everything works as expected