使用 terraform+helm 设置 kubernetes+istio 的发布管道会给出禁止的错误



我已经尝试了很多次在 Azure DevOps 中设置此管道,我想在其中部署 AKS 集群并将 istio 放在顶部。

使用 Terraform 部署 AKS 效果很好。

在此之后,我尝试使用 helm 安装 istio,但我使用的命令给出了禁止的错误。

helm.exe install --namespace istio-system --name istio-init --wait C:Istioinstallkuberneteshelmistio

我使用了本地路径,因为这是我能找到的唯一好方法,让我在构建代理上找到 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:tiller服务帐户,如您在错误消息中看到的那样)是使用以下 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

仍然在规则解决错误中显示错误消息,它查找群集管理员,但未找到。

我什至尝试了极端方法,并将所有服务帐户设置为群集管理员进行测试:

kubectl create clusterrolebinding serviceaccounts-admins --clusterrole=cluster-admin --group=system:serviceaccounts

但即使在那之后,我也得到了相同的错误与相同的规则解决错误。

我被困住了,并感谢任何帮助,我可以做不同的事情。

这是我们在开发群集中使用的角色绑定:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tillerbinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tillerserviceaccount
namespace: kube-system

编辑:在本例中,错误是由于在没有 RBAC 的情况下创建的 AKS。

相关内容

最新更新