Skip to content

Instantly share code, notes, and snippets.

@glassonion1
Created May 9, 2020 03:43
Show Gist options
  • Save glassonion1/ca3c0688974090db8e46777bb22e04b7 to your computer and use it in GitHub Desktop.
Save glassonion1/ca3c0688974090db8e46777bb22e04b7 to your computer and use it in GitHub Desktop.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: all-reader
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups:
- extensions
resources:
- ingresses
verbs: ["get", "list", "watch"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: stats
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: all-reader
subjects:
- kind: ServiceAccount
name: prometheus
namespace: stats
@glassonion1
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment