From 13c3b5962f9af5f2a78ace969423f18ad6b53538 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sat, 29 Jul 2023 09:39:51 +0200 Subject: [PATCH] feat(loki): Add prometheus scraping --- manifests/loki/deployment.yaml | 1 + manifests/loki/kustomization.yaml | 1 + manifests/loki/service.yaml | 2 ++ manifests/loki/servicemonitor.yaml | 14 ++++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 manifests/loki/servicemonitor.yaml diff --git a/manifests/loki/deployment.yaml b/manifests/loki/deployment.yaml index 9cfcb74..f78b04e 100644 --- a/manifests/loki/deployment.yaml +++ b/manifests/loki/deployment.yaml @@ -22,6 +22,7 @@ spec: imagePullPolicy: IfNotPresent ports: - containerPort: 3100 + name: http volumeMounts: - name: loki-pv mountPath: /loki diff --git a/manifests/loki/kustomization.yaml b/manifests/loki/kustomization.yaml index 4ff51b4..b741fd1 100644 --- a/manifests/loki/kustomization.yaml +++ b/manifests/loki/kustomization.yaml @@ -5,4 +5,5 @@ resources: - pvc.yaml - configmap.yaml - service.yaml + - servicemonitor.yaml - deployment.yaml diff --git a/manifests/loki/service.yaml b/manifests/loki/service.yaml index 6ca5c92..c35d5cd 100644 --- a/manifests/loki/service.yaml +++ b/manifests/loki/service.yaml @@ -3,6 +3,8 @@ kind: Service metadata: name: loki-svc namespace: monitoring + labels: + app.kubernetes.io/name: loki spec: ports: - name: http diff --git a/manifests/loki/servicemonitor.yaml b/manifests/loki/servicemonitor.yaml new file mode 100644 index 0000000..1cf89b2 --- /dev/null +++ b/manifests/loki/servicemonitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: loki + namespace: monitoring + labels: + team: core +spec: + selector: + matchLabels: + app.kubernetes.io/name: loki + endpoints: + - port: http + path: /metrics