gpt4 book ai didi

kubernetes - 创建角色以查看集群事件

转载 作者:行者123 更新时间:2023-12-02 12:26:47 26 4
gpt4 key购买 nike

我创建了一个集群角色来查看其事件:

kubectl create clusterrole events-view -n my-namespace --verb get --resource events
kubectl create clusterrolebinding events-view -n my-namespace --group 'activedirectory_group://my-groups-canonical-name' --clusterrole events-view
但是当我尝试查看事件时,我得到了:
> kubectl auth can-i get events -n my-namespace
yes
> kubectl get events -n my-namespace
Error from server (Forbidden): events is forbidden: User "u-wwrp76jtem" cannot list resource "events" in API group "" in the namespace "my-namespace"
这是 kubectl version的输出:
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.8", GitCommit:"ec6eb119b81be488b030e849b9e64fda4caaf33c", GitTreeState:"clean", BuildDate:"2020-03-12T21:00:06Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-12T20:55:23Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}

最佳答案

确保用户u-wwrp76jtem是组activedirectory_group://my-groups-canonical-name的一部分
您应该尝试使用以下命令来验证组权限

kubectl auth can-i get events -n my-namespace --as-group=activedirectory_group://my-groups-canonical-name

关于kubernetes - 创建角色以查看集群事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62933213/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com