---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  labels:
    k8s-app: net-attach-def-admission-controller-sm
  name: net-attach-def-admission-sm
spec:
  jobLabel: NetworkAttachmentDefinition
  endpoints:
  - interval: 30s
    port: metrics
    honorLabels: true
  selector:
    matchLabels:
      service: net-attach-def-admission-controller-service
  namespaceSelector: 
    matchNames:
      - ${NAMESPACE}
---
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: prometheus-k8s
  labels:
    prometheus: k8s
spec:
  serviceAccountName: prometheus-k8s
  serviceMonitorSelector: 
    matchExpressions:
    - key : k8s-app
      operator: Exists
  version: v1.3.0
---
apiVersion: v1
kind: Service
metadata:
  name: prometheus-k8s
spec:
  type: NodePort
  ports:
  - name: web
    nodePort: 30900
    port: 9090
    protocol: TCP
    targetPort: web
  selector:
    prometheus: prometheus-k8s

  