【问题标题】:Tiller install on AWS eks cluster not working (permissions issue)在 AWS eks 集群上安装 Tiller 无法正常工作(权限问题)
【发布时间】:2021-03-19 07:40:25
【问题描述】:

我正在从客户端机器上将分蘖安装到 EKS 集群上。目标是通过 helm 将应用程序 JupyterHub 安装到 EKS kubernetes 集群上。

我按照以下步骤(我们的测试集群)将它安装在一个集群上就好了。

现在,在我们的 prod 集群上,它不起作用。详情如下

将 kubectl 连接到集群

aws eks update-kubeconfig --name my_cluster

创建服务帐号

kubectl --namespace kube-system create serviceaccount tiller
serviceaccount/tiller created

创建集群角色绑定

kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created

初始化分蘖

helm init --service-account tiller --wait
# ... wait a bit ...
helm version
Client: &version.Version{SemVer:"v2.16.7", GitCommit:"5f2584fd3d35552c4af26036f0c464191287986b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.7", GitCommit:"5f2584fd3d35552c4af26036f0c464191287986b", GitTreeState:"clean"}

安装应用程序 (JupyterHub)

helm upgrade --install jhub jupyterhub/jupyterhub --namespace jhub --version=2.0.1605648253 --values jhub.config.yaml
UPGRADE FAILED
Error: configmaps is forbidden: User "system:serviceaccount:kube-system:tiller" cannot list resource "configmaps" in API group "" in the namespace "kube-system"
Error: UPGRADE FAILED: configmaps is forbidden: User "system:serviceaccount:kube-system:tiller" cannot list resource "configmaps" in API group "" in the namespace "kube-system"

查看日志

kubectl get event --namespace kube-system
LAST SEEN   TYPE      REASON        OBJECT                               MESSAGE
10s         Warning   FailedMount   pod/tiller-deploy-59bfffd84b-l7lvq   MountVolume.SetUp failed for volume "tiller-token-8bcns" : secret "tiller-token-XXXXX" not found

乍一看,这似乎是应用程序 (JupyterHub) 的问题,但我认为不是,因为我们还做了一个额外的步骤,即运行一个命令,通过允许 tiller 监听来保护我们的集群仅来自 localhost 的命令,这也没有按预期工作,并且根本不依赖于 jupyterhub 应用程序,所以它让我相信这是 kubernetes、helm 或 tiller 的问题

kubectl patch deployment tiller-deploy --namespace=kube-system --type=json --patch=\'[{"op": "add", "path": "/spec/template/spec/containers/0/command", "value": ["/tiller", "--listen=localhost:44134"]}]'
Tiller does not have permission --> this error message is not the exact wording, I neglected to copy the exact message, but IIRC it was short and simple and said tiller does not have permission (I'm currently in the process of deleting and re-creating the cluster. I will update this when I have the actual message)

【问题讨论】:

  • 如果是新集群,是否有特定的理由需要旧版本的 Helm? Helm 3 不使用 Tiller(不需要管理它是一个巨大的改进)。
  • @DavidMaze 没有什么特别的原因,只是在我们用来通过 kubectl 管理集群的标准操作系统映像上更新 helm 版本需要一些努力,但出于这个原因,这可能是值得的你提到的(不需要分蘖)

标签: amazon-web-services kubernetes kubernetes-helm amazon-ebs


【解决方案1】:

好的,完全销毁集群并重新创建它似乎已经解决了这个问题。不知道原因是什么,但是这个 kubernetes 事件消息(如下)可能是一个线索。根据我的经验,EBS 可能是出了名的不稳定,可能是因为它是一个硬件接口

kubernetes 事件消息:

kubectl get event --namespace kube-system
LAST SEEN   TYPE      REASON        OBJECT                               MESSAGE
10s         Warning   FailedMount   pod/tiller-deploy-59bfffd84b-l7lvq   MountVolume.SetUp failed for volume "tiller-token-8bcns" : secret "tiller-token-XXXXX" not found

【讨论】:

    猜你喜欢
    • 2019-07-09
    • 2021-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-09
    • 1970-01-01
    • 2010-11-07
    相关资源
    最近更新 更多