Skip to content

Instantly share code, notes, and snippets.

@a-patel
Created October 28, 2021 17:29
Show Gist options
  • Save a-patel/a263d10a607de6b3b073295d0bd1556b to your computer and use it in GitHub Desktop.
Save a-patel/a263d10a607de6b3b073295d0bd1556b to your computer and use it in GitHub Desktop.
Kubernetes - RBAC - RoleBinding - ClusterRole
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment