diff --git a/manifests/prometheus/kustomization.yaml b/manifests/prometheus/kustomization.yaml index 723baa6..5dc83e0 100644 --- a/manifests/prometheus/kustomization.yaml +++ b/manifests/prometheus/kustomization.yaml @@ -2,4 +2,6 @@ resources: - serviceaccount.yaml - clusterrole.yaml - clusterrolebinding.yaml + - service.yaml + - servicemonitor.yaml - prometheus.yaml diff --git a/manifests/prometheus/prometheus.yaml b/manifests/prometheus/prometheus.yaml index f9f79f0..8496f03 100644 --- a/manifests/prometheus/prometheus.yaml +++ b/manifests/prometheus/prometheus.yaml @@ -7,6 +7,9 @@ spec: serviceAccountName: prometheus serviceMonitorNamespaceSelector: {} serviceMonitorSelector: {} + podMonitorSelector: + matchLabels: + team: core resources: requests: memory: 300Mi diff --git a/manifests/prometheus/service.yaml b/manifests/prometheus/service.yaml new file mode 100644 index 0000000..7ccddcd --- /dev/null +++ b/manifests/prometheus/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: prometheus-svc + namespace: monitoring + labels: + app.kubernetes.io/name: prometheus +spec: + ports: + - name: web + port: 9090 + protocol: TCP + targetPort: web + selector: + app.kubernetes.io/name: prometheus + diff --git a/manifests/prometheus/servicemonitor.yaml b/manifests/prometheus/servicemonitor.yaml new file mode 100644 index 0000000..ceb46bc --- /dev/null +++ b/manifests/prometheus/servicemonitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: prometheus + namespace: monitoring + labels: + team: core +spec: + selector: + matchLabels: + app.kubernetes.io/name: prometheus + endpoints: + - port: web + path: /metrics