apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: prometheus-rules-contributor
rules:
  - apiGroups: ["monitoring.coreos.com"]
    resources: ["prometheusrules"]
    verbs: ["create", "get", "list", "watch", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: prometheus-rules-contributor-binding
  namespace: freeleaps-monitoring-system
subjects:
  - kind: Group
    name: mathmast:prometheus-rules-contributor
    apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: ClusterRole
  name: prometheus-rules-contributor
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: service-monitor-contributor
rules:
  - apiGroups: ["monitoring.coreos.com"]
    resources: ["servicemonitors"]
    verbs: ["create", "get", "list", "watch", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: service-monitor-contributor-binding
  namespace: freeleaps-monitoring-system
subjects:
  - kind: Group
    name: mathmast:service-monitor-contributor
    apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: ClusterRole
  name: service-monitor-contributor
  apiGroup: rbac.authorization.k8s.io