RoleBinding in Kubernetes

Using role bindings in Kubernetes

Planted .

A role binding grants the permissions defined in a role to a user or set of users.

Similar to roles, a RoleBinding grants permissions in a namespace, whereas ClusterRoleBinding is not bound to a namespace.

After a rolebinding is created, it can not be changed. It must be deleted and recreated.

Sample rolebinding

apiVersion: rbac.authorization.k8s.io/v1
# This role binding allows "dave" to read secrets in the "development" namespace.
# You need to already have a ClusterRole named "secret-reader".
kind: RoleBinding
metadata:
  name: read-secrets
  #
  # The namespace of the RoleBinding determines where the permissions are granted.
  # This only grants permissions within the "development" namespace.
  namespace: development
subjects:
- kind: User
  name: dave # Name is case sensitive
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: ClusterRole
  name: secret-reader
  apiGroup: rbac.authorization.k8s.io
Updated . Thoughts? Email me.