---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  labels:
    name: monitor-multus-admission-controller
  annotations:
    networkoperator.openshift.io/ignore-errors: ""
  name: monitor-multus-admission-controller
  namespace: openshift-multus
spec:
  endpoints:
  - interval: 30s
    port: metrics
    bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    scheme: 'https'
    tlsConfig:
      caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
      serverName: multus-admission-controller.openshift-multus.svc
  jobLabel: app
  namespaceSelector:
    matchNames:
    - openshift-multus
  selector:
    matchLabels:
       app: multus-admission-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: prometheus-k8s
  namespace: openshift-multus
rules:
- apiGroups:
  - ""
  resources:
  - services
  - endpoints
  - pods
  verbs:
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: prometheus-k8s
  namespace: openshift-multus
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: prometheus-k8s
subjects:
- kind: ServiceAccount
  name: prometheus-k8s
  namespace: openshift-monitoring