对于原始类型,我应该使用什么RBAC角色资源类型?
例如kubectl get --raw "/api/v1/nodes/(your-node-name)/proxy/stats/summary"
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: k8s-ephemeral-storage-metrics-debug
rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["*"]
还是直接调用API k8s?
content, err := clientset.RESTClient().Get().AbsPath(fmt.Sprintf("/api/v1/nodes/%s/proxy/stats/summary", currentNode)).DoRaw(context.Background())
1条答案
按热度按时间gmol16391#
API文档将此操作命名为“获取Connect代理路径”,并将URL具体描述为
.../proxy/...
部分是有趣的部分。它表明您没有在Node对象上使用基本的CRUD操作,而是访问Node的某些 subresource。RBAC设置有针对子资源的特定语法。您需要将URL分解为几个组成部分您可以将其分解为几个组成部分:
然后,在RBAC定义中使用
resource/subresource
名称