在 kubernetes 中安装 Helm Chart 时出错

问题描述 投票:0回答:2

我正在尝试在 Kubernetes 集群上安装 Helm Chart。当我尝试使用 init 命令初始化 helm 时,它会抛出错误

"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
kubernetes kubernetes-helm kubectl kubeadm
2个回答
6
投票

这似乎是 Helm 2.14.3(及之前版本)和 Kubernetes 1.16 的错误Helm init 在 GitHub 上的 Kubernetes 1.16.0 错误报告中失败

票证列出了一些解决方法 - 最简单的一个是:

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 -

1
投票

如果你使用这个命令就会起作用:

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 -```
© www.soinside.com 2019 - 2024. All rights reserved.