kubernetes - 在Minikube服务器(1.6.2)上安装helm 2.13.0找不到tiller

标签 kubernetes kubernetes-helm

嘿,我正在安装新的 minikube 并尝试在 3.x.x 版本中初始化 helm,但在 2.13.0 版本中。

$ minikube start
😄  minikube v1.6.2 on Darwin 10.14.6
✨  Automatically selected the 'hyperkit' driver (alternates: [virtualbox])
🔥  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...
🚜  Pulling images ...
🚀  Launching Kubernetes ...
⌛  Waiting for cluster to come online ...
🏄  Done! kubectl is now configured to use "minikube"

$ kubectl -n kube-system create serviceaccount tiller
serviceaccount/tiller created

$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created

$ helm init --service-account tiller
$HELM_HOME has been configured at /Users/<user>/.helm.
Error: error installing: the server could not find the requested resource

$ helm init --service-account tiller --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -

deployment.apps/tiller-deploy created
service/tiller-deploy created

$ helm init --service-account tiller
 59 ### ALIASES
$HELM_HOME has been configured at /Users/<user>/.helm.
Error: error installing: the server could not find the requested resource

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Error: could not find tiller

我尝试在一些随机的其他 ns 上执行相同的操作,但没有结果:

$ kubectl create ns deployment-stuff
namespace/deployment-stuff created

$ kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin \
        --user=$(gcloud config get-value account)

clusterrolebinding.rbac.authorization.k8s.io/cluster-admin-binding created

$ kubectl create serviceaccount tiller --namespace deployment-stuff
kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin \
    --serviceaccount=deployment-stuff:tiller

serviceaccount/tiller created
clusterrolebinding.rbac.authorization.k8s.io/tiller-admin-binding created

$ helm init --service-account=tiller --tiller-namespace=deployment-stuff

Creating /Users/<user>/.helm
Creating /Users/<user>/.helm/repository
Creating /Users/<user>/.helm/repository/cache
Creating /Users/<user>/.helm/repository/local
Creating /Users/<user>/.helm/plugins
Creating /Users/<user>/.helm/starters
Creating /Users/<user>/.helm/cache/archive
Creating /Users/<user>/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /Users/<user>/.helm.
Error: error installing: the server could not find the requested resource

$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈ Happy Helming!⎈

$ helm list
Error: could not find tiller

$ helm list --tiller-namespace=kube-system
Error: could not find tiller

$ helm list --tiller-namespace=deployment-stuff
Error: could not find tiller

到处都是同样的错误错误:安装错误:服务器找不到请求的资源有什么想法如何解决吗?

我使用这些命令安装了 helm,并且与我的 gcp 集群配合良好,helm list 返回了完整的 helm 列表。

wget -c https://get.helm.sh/helm-v2.13.0-darwin-amd64.tar.gz
tar -zxvf helm-v2.13.0-darwin-amd64.tar.gz
mv darwin-amd64/helm /usr/local/bin/helm

说实话,我不知道发生了什么,有时它在 minikube 上运行良好,有时我会收到这些错误。

最佳答案

可以通过删除tiller 部署服务并在第一个helm之后重新运行helm init --override命令来解决此问题初始化

因此,运行您列出的命令后:

$ kubectl -n kube-system create serviceaccount tiller
serviceaccount/tiller created

$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created

$ helm init --service-account tiller

然后发现找不到tiller。

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Error: could not find tiller

运行以下命令:

1.

$ kubectl delete service tiller-deploy -n kube-system

2.

$ kubectl delete deployment tiller-deploy -n kube-system

3.

helm init --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -

之后您可以验证它是否适用于:

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Error: could not find a ready tiller pod

这个需要更多时间,给它几秒钟。

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}

告诉我它是否有效。

关于kubernetes - 在Minikube服务器(1.6.2)上安装helm 2.13.0找不到tiller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59735045/

相关文章:

azure - AKS : Logging into worker nodes and get Permission denied (publickey)

logging - 限制kubernetes中的日志

kubernetes - 使用 LoadBalancer 服务在 Kubernetes 中公开 Kafka 集群

kubernetes-helm - 从 helm 命令行设置嵌套数据结构?

kubernetes - 如何知道Kubernetes是否发生过自动缩放

kubernetes - Helm 安装失败并显示 "rendered manifests contain a resource that already exists"(ClusterRole)

Git 命令在 init 容器中不起作用

networking - 如何使一个Pod与Kubernetes中的另一个Pod联网? (简单)

ssl - Helm : x509: certificate signed by unknown authority

kubernetes - `helm init`说,分till已经在集群上了,不是吗?