在kubernates中安装头盔图表时出错

时间:2019-09-24 10:26:27

标签: kubernetes kubernetes-helm kubectl kubeadm

我正在尝试在kubernates集群上安装头盔图表。当我尝试使用init命令初始化头盔时,它会抛出错误,"error installing: the server could not find the requested resource"

provider.helm v2.14.3

provider.kubernetes v1.16

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
$ helm version
Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Error: could not find tiller
$ helm init
Creating /home/cloud_admin/.helm
Creating /home/cloud_admin/.helm/repository
Creating /home/cloud_admin/.helm/repository/cache
Creating /home/cloud_admin/.helm/repository/local
Creating /home/cloud_admin/.helm/plugins
Creating /home/cloud_admin/.helm/starters
Creating /home/cloud_admin/.helm/cache/archive
Creating /home/cloud_admin/.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 /home/cloud_admin/.helm.
Error: error installing: the server could not find the requested resource
$ kubectl get node -n kube-system
NAME               STATUS   ROLES    AGE     VERSION
openamvmimsload0   Ready    master   5h11m   v1.16.0
openamvmimsload1   Ready    <none>   5h1m    v1.16.0
$ kubectl config get-clusters
NAME
kubernetes
$ kubectl cluster-info
Kubernetes master is running at https://172.16.128.40:6443
KubeDNS is running at https://172.16.128.40:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
$ kubectl get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   5h15m

1 个答案:

答案 0 :(得分:4)

这似乎是Helm 2.14.3(及更高版本)和Kubernetes 1.16 Helm init fails on Kubernetes 1.16.0 bug report on GitHub的错误。

故障单列出了一些解决方法-最简单的方法是:

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 -

或启用了RBAC且拥有tiller服务帐户:

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 -
相关问题