簡體   English   中英

在 AWS eks 集群上安裝 Tiller 無法正常工作(權限問題)

[英]Tiller install on AWS eks cluster not working (permissions issue)

我正在從客戶端機器上將分櫱安裝到 EKS 集群上。 目標是通過 helm 將應用程序 JupyterHub 安裝到 EKS kubernetes 集群上。

我按照以下步驟(我們的測試集群)將它安裝在一個集群上就好了。

現在,在我們的產品集群上,它不起作用。 詳情如下

將 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)的一個問題,但我認為不是,因為我們做了一個額外的步驟,即運行一個命令,通過允許分櫱偵聽來自的命令來保護我們的集群僅限本地主機,而且也沒有按預期工作,並且根本不依賴於 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)

好的,所以完全破壞集群並重新創建它似乎已經解決了這個問題。 不知道原因是什么,但這個 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM