apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: gitlab-admin-binding namespace: gitlab roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: gitlab-admin subjects:
- kind: ServiceAccount name: gitlab
apiVersion: v1 kind: ServiceAccount metadata: name: gitlab namespace: gitlab EOF
全局授权 admin 权限
cat « EOF | kubectl apply -f -
kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: gitlab-admin rules:
- verbs:
- ‘*’ apiGroups:
- ‘*’ resources:
- ‘*’
- verbs:
- ‘*’ nonResourceURLs:
- ‘*’
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: gitlab-admin-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: gitlab-admin subjects:
- kind: ServiceAccount name: gitlab namespace: gitlab
apiVersion: v1 kind: ServiceAccount metadata: name: gitlab namespace: gitlab EOF
|
|