# services/monitoring/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: vmsingle-scrape
rules:
  - apiGroups: [""]
    resources:
      - nodes
      - nodes/proxy
      - nodes/metrics
      - services
      - endpoints
      - pods
    verbs: ["get","list","watch"]
  - apiGroups: ["networking.k8s.io","extensions"]
    resources: ["ingresses"]
    verbs: ["get","list","watch"]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: vmsingle-scrape
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: vmsingle-scrape
subjects:
  - kind: ServiceAccount
    name: victoria-metrics-single
    namespace: monitoring
