【发布时间】:2021-04-06 03:07:02
【问题描述】:
我使用客户端证书数据和客户端密钥数据添加了一个名为“hello”的新用户到 kind 集群。当我切换到它的上下文并按下命令时:
kubectl get ns development-hello
我明白了:
Error from server (Forbidden): namespaces "development-hello" is forbidden: User "hello" cannot get resource "namespaces" in API group "" in the namespace "development-hello"
我没有此用户的集群角色绑定。
这是来自 kubectl 配置视图的快照
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://127.0.0.1:33445
name: kind-kind
contexts:
- context:
cluster: kind-kind
user: hello
name: hello-kind-kind
- context:
cluster: kind-kind
user: kind-kind
name: kind-kind
current-context: hello-kind-kind
kind: Config
preferences: {}
users:
- name: hello
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
- name: kind-kind
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
【问题讨论】:
标签: kubernetes rbac kind