头盔“错误:安装错误:找不到名称空间“ {用户名}””

时间:2019-10-21 18:34:34

标签: kubernetes kubernetes-helm minikube

我正在使用Minikube修补Helm。

我了解Helm installs tiller in the kube-system namespace by default

  

tiller安装到群集中的最简单方法是简单地运行   helm init ...   连接后,它将tiller安装到kube-system中   命名空间。

但是相反,它正在尝试将分er安装在以我命名的命名空间中:

$ ~/bin/minikube start
* minikube v1.4.0 on Ubuntu 18.04
* Tip: Use 'minikube start -p ' to create a new cluster, or 'minikube delete' to delete this one.
* Starting existing virtualbox VM for "minikube" ...
* Waiting for the host to be provisioned ...
* Preparing Kubernetes v1.16.0 on Docker 18.09.9 ...
* Relaunching Kubernetes using kubeadm ...
* Waiting for: apiserver proxy etcd scheduler controller dns
* Done! kubectl is now configured to use "minikube"
$ helm init
$HELM_HOME has been configured at /home/mcrenshaw/.helm.
Error: error installing: namespaces "mcrenshaw" not found
$

我可以指定分till名称空间,但是随后在每次使用helm时都必须指定它。

$ helm init --tiller-namespace=kube-system
$HELM_HOME has been configured at /home/mcrenshaw/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
To prevent this, run `helm init` with the --tiller-tls-verify flag.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
$ helm upgrade --install some-thing .
Error: could not find tiller
$ helm upgrade --install some-thing . --tiller-namespace=kube-system
Release "some-thing" does not exist. Installing it now.

假设在每个命令中指定名称空间是可以的。但这感觉不正确。我是否做了一些破坏我的头盔配置的事情?

更新

根据Eduardo的要求,这是我的掌舵版本:

$ helm version --tiller-namespace=kube-system
Client: &version.Version{SemVer:"v2.15.0", GitCommit:"c2440264ca6c078a06e088a838b0476d2fc14750", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.15.0", GitCommit:"c2440264ca6c078a06e088a838b0476d2fc14750", GitTreeState:"clean"}

1 个答案:

答案 0 :(得分:2)

有两种设置Tiller默认名称空间的方法:

  1. 使用--tiller-namespace标志(已在使用)。
  2. 通过设置$TILLER_NAMESPACE环境变量。

标志配置优先于环境配置。您可能已设置了此环境变量(可以使用printenv TILLER_NAMESPACE进行检查)。如果是这样,请unset和其他helm命令应正确指向kube-system命名空间。