Skip to content

Instantly share code, notes, and snippets.

@Informatic
Created January 9, 2024 22:07
Show Gist options
  • Save Informatic/e129c26342dabdc75102000f85874a02 to your computer and use it in GitHub Desktop.
Save Informatic/e129c26342dabdc75102000f85874a02 to your computer and use it in GitHub Desktop.
// This ClusterRole is bound to all humans that log in via prodaccess/prodvider/SSO.
// It should allow viewing of non-sensitive data for debugability and openness.
crViewer: kube.ClusterRole("system:viewer") {
rules: [
{
apiGroups: [""],
resources: [
"nodes",
"namespaces",
"pods",
"configmaps",
"services",
"rolebindings",
],
verbs: ["list"],
},
{
apiGroups: ["metrics.k8s.io"],
resources: [
"nodes",
"pods",
],
verbs: ["list"],
},
{
apiGroups: ["apps"],
resources: [
"statefulsets",
],
verbs: ["list"],
},
{
apiGroups: ["extensions"],
resources: [
"deployments",
"ingresses",
],
verbs: ["list"],
},
{
apiGroups: ["rbac.authorization.k8s.io"],
resources: [
"clusterroles",
"roles",
"clusterrolebindings",
"rolebindings",
],
verbs: ["list", "get"],
},
],
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment