Skip to content

Instantly share code, notes, and snippets.

@briansunter
Created September 28, 2025 07:45
Show Gist options
  • Select an option

  • Save briansunter/a7ed13cd50ccadb30e0bf2fe639107ed to your computer and use it in GitHub Desktop.

Select an option

Save briansunter/a7ed13cd50ccadb30e0bf2fe639107ed to your computer and use it in GitHub Desktop.
readonly.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: digitalocean:read-only
rules:
- apiGroups: [""]
resources:
- configmaps
- endpoints
- nodes
- persistentvolumeclaims
- persistentvolumes
- pods
- pods/log
- pods/status
- replicationcontrollers
- replicationcontrollers/scale
- serviceaccounts
- services
- services/status
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources:
- daemonsets
- deployments
- deployments/scale
- replicasets
- replicasets/scale
- statefulsets
- statefulsets/scale
verbs: ["get", "list", "watch"]
- apiGroups: ["batch"]
resources:
- cronjobs
- jobs
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources:
- daemonsets
- deployments
- deployments/scale
- ingresses
- replicasets
- replicasets/scale
verbs: ["get", "list", "watch"]
- apiGroups: ["autoscaling"]
resources:
- horizontalpodautoscalers
verbs: ["get", "list", "watch"]
- apiGroups: ["networking.k8s.io"]
resources:
- ingresses
- networkpolicies
verbs: ["get", "list", "watch"]
- apiGroups: ["policy"]
resources:
- poddisruptionbudgets
verbs: ["get", "list", "watch"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources:
- clusterroles
- clusterrolebindings
- roles
- rolebindings
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: digitalocean:read-only-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: digitalocean:read-only
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: digitalocean:read-only-users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment