【发布时间】:2019-08-24 17:15:01
【问题描述】:
我现在已经尝试了很多次在 Azure devops 中设置此管道,我想在其中部署 AKS 集群并将 istio 放在上面。
使用 Terraform 部署 AKS 效果很好。
在此之后我尝试使用 helm 安装 istio,但我使用的命令给出了禁止错误。
helm.exe install --namespace istio-system --name istio-init --wait C:\Istio\install\kubernetes\helm\istio
我使用本地路径,因为这是我能找到的唯一好方法,让 helm 找到我在构建代理上拥有的 istio 图表。
错误信息
Error: release istio-init failed: clusterroles.rbac.authorization.k8s.io "istio-galley-istio-system" is forbidden: attempt to grant extra privileges: [{[*] [admissionregistration.k8s.io] [validatingwebhookconfigurations] [] []} {[get] [config.istio.io] [*] [] []} {[list] [config.istio.io] [*] [] []} {[watch] [config.istio.io] [*] [] []} {[get] [*] [deployments] [istio-galley] []} {[get] [*] [endpoints] [istio-galley] []}] user=&{system:serviceaccount:kube-system:tillerserviceaccount 56632fa4-55e7-11e9-a4a1-9af49f3bf03a [system:serviceaccounts system:serviceaccounts:kube-system system:authenticated] map[]} ownerrules=[] ruleResolutionErrors=[[clusterroles.rbac.authorization.k8s.io "cluster-admin" not found, clusterroles.rbac.authorization.k8s.io "system:discovery" not found, clusterroles.rbac.authorization.k8s.io "cluster-admin" not found, clusterroles.rbac.authorization.k8s.io "system:discovery" not found, clusterroles.rbac.authorization.k8s.io "system:discovery" not found, clusterroles.rbac.authorization.k8s.io "cluster-admin" not found]]
我使用的服务帐户(系统:服务帐户:kube-system:tillerserviceaccount,如您在错误消息中看到的)是使用此 rbac 配置配置的:
apiVersion: v1
kind: ServiceAccount
metadata:
name: tillerserviceaccount
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tillerbinding
roleRef:
apiGroup: ""
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tillerserviceaccount
namespace: kube-system
错误消息在 ruleResolutionErrors 中仍然显示它正在查找 cluster-admin 但未找到。
我什至尝试了极端,将所有服务帐户设置为集群管理员进行测试:
kubectl create clusterrolebinding serviceaccounts-admins --clusterrole=cluster-admin --group=system:serviceaccounts
但即使在那之后,我也会遇到同样的错误,使用相同的 ruleResolutionErrors。
我被困住了,并感谢任何我可以做不同的帮助。
【问题讨论】:
-
很确定你需要先运行 istio init,而不是只运行 istio 并称之为 istio init
-
我对此很陌生。当我下载 istio 的安装包时,我得到了 istio 图表和 istio-remote 图表。没有初始化。或者你的意思是任何其他类型的初始化。我像 helm init 一样运行来设置服务帐户等。
-
在 github 文档上阅读 istio 图表说:“在安装 istio 图表之前,必须运行 istio-init 图表完成。”所以我从那里下载初始化图表并先运行它。
-
是的,它与 istio 在同一个文件夹中,但称为 istio-init:
C:\Istio\install\kubernetes\helm\istio-init- 应该在这里。你应该使用 1.1+ -
现在尝试了 istio-init,但仍然出现了 forbidder 错误。 “clusterroles.rbac.authorization.k8s.io “istio-init-istio-system” 被禁止...”如果需要,我可以用完整的错误更新问题。
标签: kubernetes kubernetes-helm istio azure-aks