123
--- apiVersion: v1 kind: ServiceAccount metadata: name: my-configmap-updater --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: configmap-updater rules: - apiGroups: [""] resources: ["configmaps"] verbs: ["create", "update", "patch", "get", "list"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: configmap-updater namespace: my-namesapce subjects: - kind: ServiceAccount name: spf-configmap-updater namespace: default apiGroup: "" roleRef: kind: ClusterRole name: configmap-updater apiGroup: rbac.authorization.k8s.io
参考:https://stackoverflow.com/questions/42170380/how-to-add-users-to-kubernetes-kubectl