@ -51,4 +51,11 @@ spec:
|
||||
serviceMonitorSelector: {}
|
||||
storage:
|
||||
{{- toYaml .Values.nfc_monitoring.prometheus.affinity | nindent 4 }}
|
||||
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
|
||||
thanos:
|
||||
image: "{{ .Values.nfc_monitoring.thanos.image.name }}:{{ .Values.nfc_monitoring.thanos.image.tag }}"
|
||||
objectStorageConfig:
|
||||
key: thanos.yaml
|
||||
name: thanos-sidecar-config
|
||||
{{ end }}
|
||||
version: 2.42.0
|
||||
|
13
templates/Secret-prometheus-sidecar-thanos.yaml
Normal file
13
templates/Secret-prometheus-sidecar-thanos.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: thanos-sidecar-config
|
||||
namespace: monitoring
|
||||
type: Opaque
|
||||
stringData:
|
||||
thanos.yaml: |-
|
||||
{{ toYaml .Values.nfc_monitoring.thanos.sidecar.config | nindent 4 }}
|
||||
|
||||
{{ end }}
|
@ -25,3 +25,35 @@ spec:
|
||||
app.kubernetes.io/name: prometheus
|
||||
app.kubernetes.io/part-of: {{ $.Chart.Name }}
|
||||
sessionAffinity: ClientIP
|
||||
|
||||
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: prometheus-sidecar
|
||||
app.kubernetes.io/instance: k8s
|
||||
app.kubernetes.io/name: thanos-sidecar
|
||||
app.kubernetes.io/part-of: {{ $.Chart.Name }}
|
||||
app.kubernetes.io/managed-by: {{ $.Release.Service }}
|
||||
app.kubernetes.io/version: {{ $.Chart.Version }}
|
||||
name: thanos-sidecar
|
||||
namespace: {{ .Values.nfc_monitoring.prometheus.namespace }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: grpc
|
||||
port: 10901
|
||||
targetPort: 10901
|
||||
- name: http
|
||||
port: 10902
|
||||
targetPort: 10902
|
||||
selector:
|
||||
app.kubernetes.io/component: prometheus
|
||||
app.kubernetes.io/instance: k8s
|
||||
app.kubernetes.io/name: prometheus
|
||||
app.kubernetes.io/part-of: {{ $.Chart.Name }}
|
||||
|
||||
{{ end }}
|
||||
|
@ -29,3 +29,34 @@ spec:
|
||||
app.kubernetes.io/instance: k8s
|
||||
app.kubernetes.io/name: prometheus
|
||||
app.kubernetes.io/part-of: {{ $.Chart.Name }}
|
||||
|
||||
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: prometheus-sidecar
|
||||
app.kubernetes.io/instance: thanos-sidecar
|
||||
app.kubernetes.io/name: thanos-sidecar
|
||||
app.kubernetes.io/version: v0.30.2
|
||||
name: thanos-sidecar
|
||||
namespace: {{ .Values.nfc_monitoring.prometheus.namespace }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: http
|
||||
relabelings:
|
||||
- action: replace
|
||||
separator: /
|
||||
sourceLabels:
|
||||
- namespace
|
||||
- pod
|
||||
targetLabel: instance
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: prometheus-sidecar
|
||||
app.kubernetes.io/instance: k8s
|
||||
app.kubernetes.io/name: thanos-sidecar
|
||||
app.kubernetes.io/part-of: {{ $.Chart.Name }}
|
||||
|
||||
{{ end }}
|
Reference in New Issue
Block a user