gpt4 book ai didi

kubernetes - Helm 错误 : Error: the server has asked for the client to provide credentials

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

我已经安装了 Rancher 2 并创建了一个内部虚拟机的 kubernetes 集群(没有 AWS/gcloud)。

集群已启动并正在运行。

我登录到其中一个节点。

1) 安装 Kubectl 并执行 kubectl cluster-info 。它正确列出了我的集群信息。

2) 安装的 Helm

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh

root@lnmymachine # helm version
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}

3) 配置 helm 引用 Rancher Helm Init
kubectl -n kube-system create serviceaccount tiller

kubectl create clusterrolebinding tiller \
--clusterrole cluster-admin \
--serviceaccount=kube-system:tiller

helm init --service-account tiller

尝试通过 helm 安装 Jenkins
root@lnmymachine # helm ls
Error: Unauthorized
root@lnmymachine # helm install --name initial stable/jenkins
Error: the server has asked for the client to provide credentials

浏览了类似的问题,其中很少是由于多个集群造成的。我只有一个集群。 kubectl 正确提供所有信息。

任何想法发生了什么。

最佳答案

创建 ClusterRoleBinding 时似乎有错误:

而不是 --clusterrole cluster-admin ,你应该有 --clusterrole=cluster-admin
您可以通过验证是否正确创建了 ServiceAccount、ClustrerRoleBinding 来检查是否是这种情况。
kubectl describe -n kube-system sa tillerkubectl describe clusterrolebinding tiller
似乎他们已经在 Rancher Helm Init 上解决了这个问题页。

关于kubernetes - Helm 错误 : Error: the server has asked for the client to provide credentials,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54683563/

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