运行时(在 GCP 上):
$ helm upgrade \
--values ./values.yaml \
--install \
--namespace "weaviate" \
"weaviate" \
weaviate.tgz
它返回;
UPGRADE FAILED
Error: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list resource "configmaps" in API group "" in the namespace "ku
be-system"
Error: UPGRADE FAILED: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list resource "configmaps" in API group "" in t
he namespace "kube-system"
更新:基于解决方案
$ vim rbac-config.yaml
添加到文件:
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
Run:
$ kubectl create -f rbac-config.yaml
$ helm init --service-account tiller --upgrade
注意:基于 Helm v2。
tl;dr:使用适合您集群的授权设置来设置 Helm,请参阅https://v2.helm.sh/docs/using_helm/#role-based-access-control https://v2.helm.sh/docs/using_helm/#role-based-access-control
长答案
您的体验并非特定于 Weaviate Helm 图表,而是看起来 Helm 未根据集群授权设置进行设置。其他 Helm 命令应该会失败并出现相同或类似的错误。
出现以下错误
Error: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list resource "configmaps" in API group "" in the namespace "ku
be-system"
表示默认服务帐户kube-system
命名空间缺少权限。我假设你已经安装了 Helm/Tillerkube-system
名称空间,因为如果没有指定其他参数,则这是默认值helm init
。由于您尚未创建特定的服务帐户供 Tiller 使用,因此默认为default
服务帐户。
既然您提到您正在 GCP 上运行,我认为这意味着您正在使用 GKE。 GKE 默认有角色授权 https://kubernetes.io/docs/reference/access-authn-authz/rbac/已启用。在 RBAC 设置中,默认情况下没有人拥有任何权限,所有权限都需要明确授予。
helm 文档列出了有关如何制作的几个选项Helm/Tiller 在启用 RBAC 的设置中工作 https://v2.helm.sh/docs/using_helm/#role-based-access-control。如果集群的唯一目的是运行 Weaviate,您可以选择最简单的选项:具有 cluster-admin 角色的服务帐户 https://v2.helm.sh/docs/using_helm/#example-service-account-with-cluster-admin-role。这里描述的过程本质上是为 Tiller 创建一个专用服务帐户,并添加所需的ClusterRoleBinding
到现有的cluster-admin
ClusterRole
。请注意,这实际上使 Helm/Tiller 成为整个集群的管理员。
如果您正在运行多租户集群和/或想要将 Tiller 权限限制到特定命名空间,则需要选择其中一种替代方案。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)