How to handle Helm’s common errors: “Error: must either provide a name or specify — generate-name” and “Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials”

Image for post
Image for post
Helm Errors

You just start with Helm Chart creation, and you are surprised to find the following error when you run a simple “helm install” command:

“install.go:172: [debug] Original chart version: “”
Error: must either provide a name or specify — generate-name
helm.go:94: [debug] must either provide a name or specify — generate-name
helm.sh/helm/v3/pkg/action.(*Install).NameAndChart
/private/tmp/helm-20200923–64956-rldbbk/pkg/action/install.go:558
main.runInstall
/private/tmp/helm-20200923–64956-rldbbk/cmd/helm/install.go:178
main.newInstallCmd.func2
/private/tmp/helm-20200923–64956-rldbbk/cmd/helm/install.go:120
github.com/spf13/cobra.(*Command).execute
/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842
github.com/spf13/cobra.(*Command).ExecuteC
/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.c”

Image for post
Image for post
Error: Error: must either provide a name or specify — generate-name

Previously, when you ran “helm install” command in Helm 2.x, the command worked without providing a default name. But as of Helm 3.x, you just need to provide a sample name or add “ — generate-name” (that is generate-name with 2 hypen/dash appended) option. So, for a dry-run, your modified command will be like:

Image for post
Image for post

where PATH_YOUR_HELM_DIRECTORY is where you created your Helm directory and TEST_NAME is the sample name you want to call your Helm

Simple enough.

However, you might encounter a different problem this time.

Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials
helm.go:94: [debug] the server has asked for the client to provide credentials
Kubernetes cluster unreachable

Image for post
Image for post
Error: Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials

So, even if you run a dry run for Helm install, you need to be logged into a Kubernetes cluster. Please follow the Youtube link below to learn how you can install Minikube, Kind, CRC, or Minishift.

Once after you launch one of the Kubernetes application then you run the command again, you should see it is working as expected.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store