apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: victoriametrics
rules:
- apiGroups: [""]
  resources:
  - nodes
  - nodes/metrics
  - 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: victoriametrics
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: victoriametrics
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: victoriametrics
subjects:
- kind: ServiceAccount
  name: victoriametrics
  namespace: default
# # couldn't get prometheus to read the per-node telegraf metrics as 'prometheus' account
# - kind: ServiceAccount
#   name: default
#   namespace: default