【问题标题】:RoleBinding not granting permissionsRoleBinding 不授予权限
【发布时间】:2021-07-17 22:34:00
【问题描述】:

我有以下RoleBinding(它是由 Helm 部署的:

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  annotations:
    meta.helm.sh/release-name: environment-namespaces
    meta.helm.sh/release-namespace: namespace-metadata
  creationTimestamp: "2021-04-23T17:16:50Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: SA-DevK8s-admin
  namespace: dev-my-product-name-here
  resourceVersion: "29221536"
  selfLink: /apis/rbac.authorization.k8s.io/v1/namespaces/dev-my-product-name-here/rolebindings/SA-DevK8s-admin
  uid: 4818d6ed-9320-408c-82c3-51e627d9f375
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: admin
subjects:
- apiGroup: rbac.authorization.k8s.io
  kind: User
  name: SA-DevK8s@mydomain.com

当我以SA-DevK8s@mydomain.com 登录集群并运行kubectl get pods -n dev-my-product-name-here 时,出现以下错误:

来自服务器的错误(禁止):pods 被禁止:用户“sa-devk8s@mydomain.com”无法在命名空间“dev-my-product-name-here”中列出 API 组“”中的资源“pods”

在命名空间中拥有 admin 集群角色的用户是否应该能够列出该命名空间的 pod?

【问题讨论】:

    标签: kubernetes rbac


    【解决方案1】:

    案件很重要!!!!

    一旦我将用户更改为sa-devk8s@mydomain.com(而不是SA-DevK8s@mydomain.com),一切都开始正常工作了!

    【讨论】:

      猜你喜欢
      • 2017-07-06
      • 2013-12-24
      • 1970-01-01
      • 2016-08-24
      • 2015-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多