Skip to content

Instantly share code, notes, and snippets.

@minherz
Created January 22, 2021 16:52
Show Gist options
  • Save minherz/b7ab978f9e6c50cc8d2a247a42b5a5fe to your computer and use it in GitHub Desktop.
Save minherz/b7ab978f9e6c50cc8d2a247a42b5a5fe to your computer and use it in GitHub Desktop.
example of rbac setting
apiVersion: v1
kind: ServiceAccount
metadata:
name: node-labeling-robot
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: node-info-reader
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: node-labeling-robot-read-nodes
subjects:
- kind: ServiceAccount
name: node-labeling-robot
namespace: default
apiGroup: ""
roleRef:
kind: ClusterRole
name: node-info-reader
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment