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.

Revisions

  1. neilkuan created this gist Jan 16, 2022.
    31 changes: 31 additions & 0 deletions sample-rbac-mapping.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    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