From a86469752e47fc62494241bed3d0b6181878dfe5 Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Mon, 3 Feb 2025 14:51:56 +0800 Subject: [PATCH] prometheus: prepare for other thanos components --- monitoring/prometheus/deployment.yaml | 6 +++++- monitoring/prometheus/kustomization.yaml | 1 + monitoring/prometheus/service.yaml | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 monitoring/prometheus/service.yaml diff --git a/monitoring/prometheus/deployment.yaml b/monitoring/prometheus/deployment.yaml index 40174e1..4538c85 100644 --- a/monitoring/prometheus/deployment.yaml +++ b/monitoring/prometheus/deployment.yaml @@ -6,12 +6,16 @@ spec: strategy: type: Recreate replicas: 1 + selector: + matchLabels: + component: prometheus template: metadata: annotations: prometheus.xdavidwu.link/instance: main labels: metrics: metrics + component: prometheus spec: containers: - name: prometheus @@ -36,7 +40,7 @@ spec: mountPath: /prometheus - name: configs mountPath: /etc/prometheus - - name: thanos-sidecar + - name: sidecar image: quay.io/thanos/thanos:THANOS_VERSION args: - sidecar diff --git a/monitoring/prometheus/kustomization.yaml b/monitoring/prometheus/kustomization.yaml index a34319a..bf8c62d 100644 --- a/monitoring/prometheus/kustomization.yaml +++ b/monitoring/prometheus/kustomization.yaml @@ -12,6 +12,7 @@ images: resources: - namespace.yaml - deployment.yaml + - service.yaml - configmap.yaml - serviceaccount.yaml - clusterrole.yaml diff --git a/monitoring/prometheus/service.yaml b/monitoring/prometheus/service.yaml new file mode 100644 index 0000000..ddec026 --- /dev/null +++ b/monitoring/prometheus/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: prometheus +spec: + selector: + component: prometheus + ports: + - name: prometheus + protocol: TCP + port: 80 + targetPort: 9090 + - name: sidecar-grpc + protocol: TCP + port: 10901 -- 2.45.2