Skip to content

Instantly share code, notes, and snippets.

@neilkuan
Created January 16, 2022 01:22
Show Gist options
  • Save neilkuan/1eb96e0f2e8c64ea12cb75dba57649ab to your computer and use it in GitHub Desktop.
Save neilkuan/1eb96e0f2e8c64ea12cb75dba57649ab to your computer and use it in GitHub Desktop.
sample-rbac-mapping
apiVersion: v1
kind: ServiceAccount
metadata:
name: sample-rbac-mapping
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: sample-rbac-mapping
namespace: default
rules:
- apiGroups: [""]
resources:
- namespaces
- pods
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: sample-rbac-mapping
namespace: defualt
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: sample-rbac-mapping
subjects:
- kind: ServiceAccount
name: sample-rbac-mapping
namespace: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment