nee*_*zer 0 google-cloud-platform kubernetes google-kubernetes-engine traefik
我正在尝试使用此Traefik用户指南:https://docs.traefik.io/user-guide/kubernetes/
用户指南和我的设置之间的主要区别在于指南假设我在Minikube上,而我正在尝试在Google Cloud Platform(GCP)上进行此设置.我是Kubernetes的新手,但我认为我对基本面有一个很好的处理.
无论如何,关于上面的用户指南中提供的基于角色的访问控制配置,我不断收到此错误:
服务器出错(禁止):创建"rbac.yml"时出错:cl usterroles.rbac.authorization.k8s.io"traefik-ingress-controller"被禁止:尝试授予额外权限:[PolicyRule {Resources:["services "],APIGroups:[""],动词:["get"]} PolicyRule {Resour ces:["services"],APIGroups:[""],动词:["list"]} PolicyRule {资源:["服务"],APIGroups:[""],动词:["观察"]} PolicyRule {资源:["端点"],APIGroups:[""],动词:["get"]} PolicyRule {资源:[ "端点"],APIGroups:[""],动词:["list"]} PolicyRule {资源:["端点"],APIGroups:[""],动词:["watch"]} PolicyRule {资源:[ "秘密"],APIGroups:[""],动词:["get"]} PolicyRule {资源:["秘密"],APIGroups:[""],动词:["list"]} PolicyRule {资源:[ "秘密"],APIGroups:[""],动词:["观看"]} PolicyRule {资源:["ingresses"],APIGroups:["extensions"],动词:["get"]} PolicyRule {资源: ["ingresses"],APIGroups:["extensions"],动词:["list"]} PolicyRule {资源:["ingresses"],APIGroups:["扩展名 s"],动词:["watch"]}] user=&{evan@sherwood.io [system:authenti cated] map [authenticator:[GKE]]} ownerrules = [PolicyRule {Resources:["selfsubjectaccessreviews"], APIGroups:["authorization.k8s.io"],动词:["create"]} PolicyRule {资源:["selfsubjectrulesreviews"],APIGroups:["authorization.k8s.io"],动词:["create"]} PolicyRule {NonResourceURLs:["/ api""/ api/""/ apis""/ apis / ""/ healthz""/ swagger-2.0.0.pb-v1""/ swagger.json""/ swaggerapi""/swaggerapi/*""/ version"],动词:["get"]}] ruleResolutionErrors = []
我觉得我正在遇到特权升级预防和引导,但我不确定我需要改变/做什么才能超越这个.
正如您引用的文档所述,您需要升级用户的权限,至少在允许RBAC规则更改所必需的范围内.
实现这一目标的最简单方法是添加一个分配cluster-admin
权限的ClusterRoleBinding .YAML看起来像这样:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: megacorp-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: john.doe@megacorp.com
Run Code Online (Sandbox Code Playgroud)
YAML假定您在GKE注册的用户电子邮件地址是john.doe@megacorp.com
.在kubectl apply
该清单之后,您应该申请相应地扩展Traefik的RBAC规则.
请注意,这cluster-admin
基本上是群集的root用户.如果您打算进一步限制权限,也可以使用更多选择权限.
归档时间: |
|
查看次数: |
1329 次 |
最近记录: |