Lens 创建 Service Accounts 及分配权限

Lens 创建 Service Accounts 及分配权限,第1张

Lens 创建 Service Accounts 及分配权限

1、创建 Servcie Accounts

2、创建一个 Cluster Role

3、修改Cluster Role

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: devops-role
  uid: 7d36b90b-2407-428b-b2d9-744964ae962f
  resourceVersion: '1005840'
  creationTimestamp: '2021-09-17T06:27:29Z'
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"rbac.authorization.k8s.io/v1","kind":"ClusterRole","metadata":{"annotations":{},"creationTimestamp":"2021-09-17T06:27:29Z","name":"devops-role","selflink":"/apis/rbac.authorization.k8s.io/v1/clusterroles/devops-role","uid":"7d36b90b-2407-428b-b2d9-744964ae962f"},"rules":[{"apiGroups":[""],"resources":["pods","pods/exec","pods/log"],"verbs":["*"]},{"apiGroups":[""],"resources":["services"],"verbs":["list","get","watch"]}]}
  selflink: /apis/rbac.authorization.k8s.io/v1/clusterroles/devops-role

# 添加的内容
rules:
  - verbs:
      - '*'
    apiGroups:
      - ''
    resources:
      - pods
      - pods/exec
      - pods/log
  - verbs:
      - list
      - get
      - watch
    apiGroups:
      - ''
    resources:
      - services

4、把 Service Account 用户绑定到 Cluster Role

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5682948.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存