Skip to content

Instantly share code, notes, and snippets.

@JasonMorgan
Created December 10, 2020 17:28
Show Gist options
  • Save JasonMorgan/4aa07be683c65d6de34930ebc3d8afcc to your computer and use it in GitHub Desktop.
Save JasonMorgan/4aa07be683c65d6de34930ebc3d8afcc to your computer and use it in GitHub Desktop.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
labels:
name: read-only
namespace: '*'
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs:
- get
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: read-only-binding
subjects:
- kind: ServiceAccount
name: read-only-sa
namespace: default
roleRef:
kind: ClusterRole
name: read-only
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: read-only-sa
namespace: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment