【问题标题】:Rolebinding wasn't that i expected角色绑定不是我所期望的
【发布时间】:2021-07-26 12:13:07
【问题描述】:

我为部署和 pod 创建了一个包含所有动词的集群角色。

kubectl create clusterrole pipeline-manager --verb create,delete,update,list,get --resource deployments,pods

我在测试命名空间上创建了一个 ServiceAccount 管道。

kubectl 创建 sa 管道 -n 测试

我在 test 命名空间上绑定了 serviceaccount 和 clusterrole。

kubectl create rolebinding pipeline-resources-role --clusterrole=pipeline-manager --serviceaccount=test:pipeline -n​​ test

当我测试它是否运作良好时,结果并不是我所期望的。

# Yes expected
k auth can-i list deployments --as system:serviceaccount:test:pipeline -n test => result : yes
k auth can-i list pods --as system:serviceaccount:test:pipeline -n test => result : no

我想知道我知道错了什么。

提前致谢。

【问题讨论】:

    标签: kubernetes


    【解决方案1】:

    有效。

    我在创建后确实以错误的方式编辑了 clusterrole。

    不要介意这篇文章。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多