gpt4 book ai didi

kubernetes - 在 kubernetes 中安装 helm chart 时出错

转载 作者:行者123 更新时间:2023-12-02 11:35:18 25 4
gpt4 key购买 nike

我正在尝试在 kubernates 集群上安装 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

最佳答案

这似乎是 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 -

关于kubernetes - 在 kubernetes 中安装 helm chart 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58078198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com