Skip to content
Snippets Groups Projects
Unverified Commit 79f42325 authored by Frederic Branczyk's avatar Frederic Branczyk Committed by GitHub
Browse files

Merge pull request #815 from simonpasquier/fix-thanos-sidecar

Thanos sidecar: use fields from the prometheus object
parents 409add16 874be477
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,8 @@
},
},
prometheus+:: {
local p = self,
// Add the grpc port to the Prometheus service to be able to query it with the Thanos Querier
service+: {
spec+: {
......@@ -23,16 +25,16 @@
apiVersion: 'v1',
kind: 'Service',
metadata: {
name: 'prometheus-' + $._config.prometheus.name + '-thanos-sidecar',
namespace: $._config.namespace,
labels: { prometheus: $._config.prometheus.name, app: 'thanos-sidecar' },
name: 'prometheus-' + p.name + '-thanos-sidecar',
namespace: p.namespace,
labels: { prometheus: p.name, app: 'thanos-sidecar' },
},
spec: {
ports: [
{ name: 'grpc', port: 10901, targetPort: 10901 },
{ name: 'http', port: 10902, targetPort: 10902 },
],
selector: { app: 'prometheus', prometheus: $._config.prometheus.name },
selector: { app: 'prometheus', prometheus: p.name },
clusterIP: 'None',
},
},
......@@ -51,7 +53,7 @@
kind: 'ServiceMonitor',
metadata: {
name: 'thanos-sidecar',
namespace: $._config.namespace,
namespace: p.namespace,
labels: {
'k8s-app': 'prometheus',
},
......@@ -61,7 +63,7 @@
jobLabel: 'app',
selector: {
matchLabels: {
prometheus: $._config.prometheus.name,
prometheus: p.name,
app: 'thanos-sidecar',
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment