首页 文章

Helm:错误:找不到可用的版本名称

提问于
浏览
24

我在Helm遇到了一些错误,我无法在其他地方找到解释 . 这两个错误如下 .

Error: no available release name found
Error: the server does not allow access to the requested resource (get configmaps)

这两个错误的进一步细节在下面的代码块中 .

我在Ubuntu 16.04上安装了Kubernetes集群 . 我有一个Master(K8SMST01)和两个节点(K8SN01和K8SN02) .

这是使用kubeadm使用Weave网络创建的1.6 .

就部署,服务,Pod等而言,一切似乎运行良好...... DNS似乎工作正常,这意味着pod可以使用DNS名称(myservicename.default)访问服务 .

使用“helm create”和“helm search”工作,但与分蘖部署交互似乎不起作用 . 根据Helm安装文档安装并运行Tiller .

root@K8SMST01:/home/blah/charts# helm version

Client: &version.Version{SemVer:"v2.3.0", 
GitCommit:"d83c245fc324117885ed83afc90ac74afed271b4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.3.0", GitCommit:"d83c245fc324117885ed83afc90ac74afed271b4", GitTreeState:"clean"}

root@K8SMST01:/home/blah/charts# helm install ./mychart

Error: no available release name found

root@K8SMST01:/home/blah/charts# helm ls

Error: the server does not allow access to the requested resource (get configmaps)

以下是正在运行的播客:

root@K8SMST01:/home/blah/charts# kubectl get pods -n kube-system -o wide
NAME                                      READY     STATUS    RESTARTS   AGE       IP             NODE
etcd-k8smst01                             1/1       Running   4          1d        10.139.75.19   k8smst01
kube-apiserver-k8smst01                   1/1       Running   3          19h       10.139.75.19   k8smst01
kube-controller-manager-k8smst01          1/1       Running   2          1d        10.139.75.19   k8smst01
kube-dns-3913472980-dm661                 3/3       Running   6          1d        10.32.0.2      k8smst01
kube-proxy-56nzd                          1/1       Running   2          1d        10.139.75.19   k8smst01
kube-proxy-7hflb                          1/1       Running   1          1d        10.139.75.20   k8sn01
kube-proxy-nbc4c                          1/1       Running   1          1d        10.139.75.21   k8sn02
kube-scheduler-k8smst01                   1/1       Running   3          1d        10.139.75.19   k8smst01
tiller-deploy-1172528075-x3d82            1/1       Running   0          22m       10.44.0.3      k8sn01
weave-net-45335                           2/2       Running   2          1d        10.139.75.21   k8sn02
weave-net-7j45p                           2/2       Running   2          1d        10.139.75.20   k8sn01
weave-net-h279l                           2/2       Running   5          1d        10.139.75.19   k8smst01

6 回答

  • 2

    我认为这是一个RBAC问题 . 似乎掌舵还没有为1.6.1的RBAC做好准备 .

    在Helm的Github上存在一个问题 .

    https://github.com/kubernetes/helm/issues/2224

    “使用kubeadm v1.6.1首次安装集群时,初始化默认设置为RBAC控制访问,这会影响Tiller进行安装所需的权限,扫描已安装的组件等等.helm init无需工作问题,但是helm list,helm install等等都没有用,引用了一些遗漏的权限 . “

    一项临时工作建议:

    “我们”使用命令kubectl create clusterrolebinding permissive-binding --clusterrole = cluster-admin --user = admin --user = kubelet --group = system:serviceaccounts;“”禁用“RBAC”

    但我不能说它的有效性 . 好消息是,这是一个已知问题,正在努力解决这个问题 . 希望这可以帮助 .

  • 7

    由kujenga从github问题给出的解决方案,它没有任何其他更改 .

    kubectl create serviceaccount --namespace kube-system tiller
    kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
    kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
    
  • 18

    我对CentOS 7上的kubeadm设置有同样的问题 .

    当你“helm init”并且默认的没有从配置映射中读取的权限时,Helm不会创建服务帐户 - 因此它将无法运行检查以查看它想要的部署名称使用是独一无二的

    这让我超越了它:

    kubectl create clusterrolebinding add-on-cluster-admin \
        --clusterrole=cluster-admin \
        --serviceaccount=kube-system:default
    

    但是,这给了默认帐户大量的权力,我只是这样做,所以我可以继续我的工作 . Helm需要将自己的服务帐户创建添加到“helm init”代码中 .

  • 41

    https://github.com/kubernetes/helm/issues/2224#issuecomment-356344286,以下命令也为我解决了错误:

    kubectl create serviceaccount --namespace kube-system tiller
    kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
    kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
    
  • 2

    https://github.com/kubernetes/helm/issues/3055

    helm init --service-account default

    当RBAC(serviceaccount)命令没有时,这对我有用 .

  • 2

    All addons in the kubernetes use the "defaults" service account. So Helm也使用"default"服务帐户运行 . 您应该为它提供权限 . 为其分配角色绑定 .

    For read-only permissions:

    kubectl create rolebinding default-view --clusterrole = view \ --serviceaccount = kube-system:default --namespace = kube-system

    For admin access: Eg: to install packages.

    kubectl create clusterrolebinding add-on-cluster-admin \ --clusterrole = cluster-admin \ --serviceaccount = kube-system:default

    您还可以使用以下命令在不同的命名空间中安装分蘖服务器 .

    • 首先创建namesapce

    • 为命名空间创建serviceaccount

    • 使用以下命令在此相应的命名空间中安装分蘖 .

    helm init --tiller-namespace test-namespace

相关问题