fix: seed observability dependencies
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{{- if .Values.thanosRuler.extraSecret.data -}}
|
||||
{{- $secretName := printf "%s-extra" (include "kube-prometheus-stack.thanosRuler.name" . ) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ default $secretName .Values.thanosRuler.extraSecret.name }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
{{- if .Values.thanosRuler.extraSecret.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.thanosRuler.extraSecret.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
app.kubernetes.io/component: thanos-ruler
|
||||
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
||||
data:
|
||||
{{- range $key, $val := .Values.thanosRuler.extraSecret.data }}
|
||||
{{ $key }}: {{ $val | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,77 @@
|
||||
{{- if and .Values.thanosRuler.enabled .Values.thanosRuler.ingress.enabled }}
|
||||
{{- $pathType := .Values.thanosRuler.ingress.pathType | default "ImplementationSpecific" }}
|
||||
{{- $serviceName := include "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- $servicePort := .Values.thanosRuler.service.port -}}
|
||||
{{- $routePrefix := list .Values.thanosRuler.thanosRulerSpec.routePrefix }}
|
||||
{{- $paths := .Values.thanosRuler.ingress.paths | default $routePrefix -}}
|
||||
{{- $apiIsStable := eq (include "kube-prometheus-stack.ingress.isStable" .) "true" -}}
|
||||
{{- $ingressSupportsPathType := eq (include "kube-prometheus-stack.ingress.supportsPathType" .) "true" -}}
|
||||
apiVersion: {{ include "kube-prometheus-stack.ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $serviceName }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
{{- if .Values.thanosRuler.ingress.annotations }}
|
||||
annotations:
|
||||
{{- tpl (toYaml .Values.thanosRuler.ingress.annotations) . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- if .Values.thanosRuler.ingress.labels }}
|
||||
{{ toYaml .Values.thanosRuler.ingress.labels | indent 4 }}
|
||||
{{- end }}
|
||||
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
||||
spec:
|
||||
{{- if $apiIsStable }}
|
||||
{{- if .Values.thanosRuler.ingress.ingressClassName }}
|
||||
ingressClassName: {{ .Values.thanosRuler.ingress.ingressClassName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.thanosRuler.ingress.hosts }}
|
||||
{{- range $host := .Values.thanosRuler.ingress.hosts }}
|
||||
- host: {{ tpl $host $ | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range $p := $paths }}
|
||||
- path: {{ tpl $p $ }}
|
||||
{{- if and $pathType $ingressSupportsPathType }}
|
||||
pathType: {{ $pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if $apiIsStable }}
|
||||
service:
|
||||
name: {{ $serviceName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else }}
|
||||
- http:
|
||||
paths:
|
||||
{{- range $p := $paths }}
|
||||
- path: {{ tpl $p $ }}
|
||||
{{- if and $pathType $ingressSupportsPathType }}
|
||||
pathType: {{ $pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if $apiIsStable }}
|
||||
service:
|
||||
name: {{ $serviceName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if .Values.thanosRuler.ingress.tls }}
|
||||
tls:
|
||||
{{ tpl (toYaml .Values.thanosRuler.ingress.tls | indent 4) . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
{{- if and .Values.thanosRuler.enabled .Values.thanosRuler.podDisruptionBudget.enabled }}
|
||||
apiVersion: {{ include "kube-prometheus-stack.pdb.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
||||
spec:
|
||||
{{- if .Values.thanosRuler.podDisruptionBudget.minAvailable }}
|
||||
minAvailable: {{ .Values.thanosRuler.podDisruptionBudget.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.podDisruptionBudget.maxUnavailable }}
|
||||
maxUnavailable: {{ .Values.thanosRuler.podDisruptionBudget.maxUnavailable }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: thanos-ruler
|
||||
thanos-ruler: {{ template "kube-prometheus-stack.thanosRuler.crname" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,48 @@
|
||||
{{- if .Values.thanosRuler.enabled -}}
|
||||
{{- $serviceName := include "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- $servicePort := .Values.thanosRuler.service.port -}}
|
||||
{{- range $name, $route := .Values.thanosRuler.route }}
|
||||
{{- if $route.enabled -}}
|
||||
---
|
||||
apiVersion: {{ $route.apiVersion | default "gateway.networking.k8s.io/v1" }}
|
||||
kind: {{ $route.kind | default "HTTPRoute" }}
|
||||
metadata:
|
||||
{{- with $route.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ $serviceName }}{{ if ne $name "main" }}-{{ $name }}{{ end }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" $ }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.name" $ }}-prometheus
|
||||
{{- include "kube-prometheus-stack.labels" $ | nindent 4 }}
|
||||
{{- with $route.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with $route.parentRefs }}
|
||||
parentRefs:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $route.hostnames }}
|
||||
hostnames:
|
||||
{{- tpl (toYaml .) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if $route.additionalRules }}
|
||||
{{- tpl (toYaml $route.additionalRules) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
- backendRefs:
|
||||
- name: {{ $serviceName }}
|
||||
port: {{ $servicePort }}
|
||||
{{- with $route.filters }}
|
||||
filters:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $route.matches }}
|
||||
matches:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,203 @@
|
||||
{{- if .Values.thanosRuler.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ThanosRuler
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.crname" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
labels:
|
||||
app: {{ include "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- include "kube-prometheus-stack.labels" . | indent 4 -}}
|
||||
{{- if .Values.thanosRuler.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.thanosRuler.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.image }}
|
||||
{{- $registry := .Values.global.imageRegistry | default .Values.thanosRuler.thanosRulerSpec.image.registry -}}
|
||||
{{- if and .Values.thanosRuler.thanosRulerSpec.image.tag .Values.thanosRuler.thanosRulerSpec.image.sha }}
|
||||
image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}:{{ .Values.thanosRuler.thanosRulerSpec.image.tag }}@sha256:{{ .Values.thanosRuler.thanosRulerSpec.image.sha }}"
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.image.sha }}
|
||||
image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}@sha256:{{ .Values.thanosRuler.thanosRulerSpec.image.sha }}"
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.image.tag }}
|
||||
image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}:{{ .Values.thanosRuler.thanosRulerSpec.image.tag }}"
|
||||
{{- else }}
|
||||
image: "{{ $registry }}/{{ .Values.thanosRuler.thanosRulerSpec.image.repository }}"
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.image.sha }}
|
||||
sha: {{ .Values.thanosRuler.thanosRulerSpec.image.sha }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
replicas: {{ .Values.thanosRuler.thanosRulerSpec.replicas }}
|
||||
listenLocal: {{ .Values.thanosRuler.thanosRulerSpec.listenLocal }}
|
||||
serviceAccountName: {{ template "kube-prometheus-stack.thanosRuler.serviceAccountName" . }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.externalPrefix }}
|
||||
externalPrefix: "{{ tpl .Values.thanosRuler.thanosRulerSpec.externalPrefix . }}"
|
||||
{{- else if and .Values.thanosRuler.ingress.enabled .Values.thanosRuler.ingress.hosts }}
|
||||
externalPrefix: "http://{{ tpl (index .Values.thanosRuler.ingress.hosts 0) . }}{{ .Values.thanosRuler.thanosRulerSpec.routePrefix }}"
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.externalPrefixNilUsesHelmValues }}
|
||||
externalPrefix: "http://{{ template "kube-prometheus-stack.thanosRuler.name" . }}.{{ template "kube-prometheus-stack.namespace" . }}:{{ .Values.thanosRuler.service.port }}"
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.additionalArgs }}
|
||||
additionalArgs:
|
||||
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.additionalArgs) $ | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.nodeSelector | indent 4 }}
|
||||
{{- end }}
|
||||
paused: {{ .Values.thanosRuler.thanosRulerSpec.paused }}
|
||||
logFormat: {{ .Values.thanosRuler.thanosRulerSpec.logFormat | quote }}
|
||||
logLevel: {{ .Values.thanosRuler.thanosRulerSpec.logLevel | quote }}
|
||||
retention: {{ .Values.thanosRuler.thanosRulerSpec.retention | quote }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.evaluationInterval }}
|
||||
evaluationInterval: {{ .Values.thanosRuler.thanosRulerSpec.evaluationInterval }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector }}
|
||||
ruleNamespaceSelector:
|
||||
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector | indent 4) . }}
|
||||
{{ else }}
|
||||
ruleNamespaceSelector: {}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.ruleSelector }}
|
||||
ruleSelector:
|
||||
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.ruleSelector | indent 4) .}}
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.ruleSelectorNilUsesHelmValues }}
|
||||
ruleSelector:
|
||||
matchLabels:
|
||||
release: {{ $.Release.Name | quote }}
|
||||
{{ else }}
|
||||
ruleSelector: {}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.alertQueryUrl }}
|
||||
alertQueryUrl: "{{ .Values.thanosRuler.thanosRulerSpec.alertQueryUrl }}"
|
||||
{{- end}}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersUrl }}
|
||||
alertmanagersUrl:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersUrl | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.existingSecret }}
|
||||
alertmanagersConfig:
|
||||
key: "{{.Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.existingSecret.key }}"
|
||||
name: "{{.Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.existingSecret.name }}"
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.secret }}
|
||||
alertmanagersConfig:
|
||||
key: alertmanager-configs.yaml
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.queryEndpoints }}
|
||||
queryEndpoints:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.queryEndpoints | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.queryConfig.existingSecret }}
|
||||
queryConfig:
|
||||
key: "{{.Values.thanosRuler.thanosRulerSpec.queryConfig.existingSecret.key }}"
|
||||
name: "{{.Values.thanosRuler.thanosRulerSpec.queryConfig.existingSecret.name }}"
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.queryConfig.secret }}
|
||||
queryConfig:
|
||||
key: query-configs.yaml
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.resources }}
|
||||
resources:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.resources | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.routePrefix }}
|
||||
routePrefix: "{{ .Values.thanosRuler.thanosRulerSpec.routePrefix }}"
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.securityContext | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.storage }}
|
||||
storage:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.storage | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig.existingSecret }}
|
||||
objectStorageConfig:
|
||||
key: "{{.Values.thanosRuler.thanosRulerSpec.objectStorageConfig.existingSecret.key }}"
|
||||
name: "{{.Values.thanosRuler.thanosRulerSpec.objectStorageConfig.existingSecret.name }}"
|
||||
{{- else if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig.secret }}
|
||||
objectStorageConfig:
|
||||
key: object-storage-configs.yaml
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.labels }}
|
||||
labels:
|
||||
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.labels) $ | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.podMetadata }}
|
||||
podMetadata:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.podMetadata | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.thanosRuler.thanosRulerSpec.podAntiAffinity .Values.thanosRuler.thanosRulerSpec.affinity }}
|
||||
affinity:
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.affinity }}
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.affinity | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.thanosRuler.thanosRulerSpec.podAntiAffinity "hard" }}
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: {{ .Values.thanosRuler.thanosRulerSpec.podAntiAffinityTopologyKey }}
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- {key: app.kubernetes.io/name, operator: In, values: [thanos-ruler]}
|
||||
- {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.crname" . }}]}
|
||||
{{- else if eq .Values.thanosRuler.thanosRulerSpec.podAntiAffinity "soft" }}
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
topologyKey: {{ .Values.thanosRuler.thanosRulerSpec.podAntiAffinityTopologyKey }}
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- {key: app.kubernetes.io/name, operator: In, values: [thanos-ruler]}
|
||||
- {key: thanos-ruler, operator: In, values: [{{ template "kube-prometheus-stack.thanosRuler.crname" . }}]}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.tolerations | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.topologySpreadConstraints | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{ toYaml .Values.global.imagePullSecrets | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.containers }}
|
||||
containers:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.containers | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.initContainers }}
|
||||
initContainers:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.initContainers | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.priorityClassName }}
|
||||
priorityClassName: {{.Values.thanosRuler.thanosRulerSpec.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.volumes }}
|
||||
volumes:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.volumes | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.volumeMounts }}
|
||||
volumeMounts:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.volumeMounts | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.alertDropLabels }}
|
||||
alertDropLabels:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.alertDropLabels | indent 4 }}
|
||||
{{- end }}
|
||||
portName: {{ .Values.thanosRuler.thanosRulerSpec.portName }}
|
||||
{{- with .Values.thanosRuler.thanosRulerSpec.additionalConfig }}
|
||||
{{- tpl (toYaml .) $ | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.thanosRulerSpec.web }}
|
||||
web:
|
||||
{{ toYaml .Values.thanosRuler.thanosRulerSpec.web | indent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.thanosRuler.thanosRulerSpec.additionalConfigString }}
|
||||
{{- tpl . $ | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.thanosRuler.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
labels:
|
||||
app: {{ include "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
||||
data:
|
||||
{{- with .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }}
|
||||
{{- if and .secret (not .existingSecret) }}
|
||||
alertmanager-configs.yaml: {{ toYaml .secret | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.thanosRuler.thanosRulerSpec.objectStorageConfig }}
|
||||
{{- if and .secret (not .existingSecret) }}
|
||||
object-storage-configs.yaml: {{ toYaml .secret | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.thanosRuler.thanosRulerSpec.queryConfig }}
|
||||
{{- if and .secret (not .existingSecret) }}
|
||||
query-configs.yaml: {{ toYaml .secret | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,57 @@
|
||||
{{- if .Values.thanosRuler.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
self-monitor: {{ .Values.thanosRuler.serviceMonitor.selfMonitor | quote }}
|
||||
{{- include "kube-prometheus-stack.labels" . | indent 4 -}}
|
||||
{{- if .Values.thanosRuler.service.labels }}
|
||||
{{ toYaml .Values.thanosRuler.service.labels | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.thanosRuler.service.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.thanosRuler.service.clusterIP }}
|
||||
clusterIP: {{ .Values.thanosRuler.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.service.ipDualStack.enabled }}
|
||||
ipFamilies: {{ toYaml .Values.thanosRuler.service.ipDualStack.ipFamilies | nindent 4 }}
|
||||
ipFamilyPolicy: {{ .Values.thanosRuler.service.ipDualStack.ipFamilyPolicy }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{ toYaml .Values.thanosRuler.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.thanosRuler.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- range $cidr := .Values.thanosRuler.service.loadBalancerSourceRanges }}
|
||||
- {{ $cidr }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if ne .Values.thanosRuler.service.type "ClusterIP" }}
|
||||
externalTrafficPolicy: {{ .Values.thanosRuler.service.externalTrafficPolicy }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ .Values.thanosRuler.thanosRulerSpec.portName }}
|
||||
{{- if eq .Values.thanosRuler.service.type "NodePort" }}
|
||||
nodePort: {{ .Values.thanosRuler.service.nodePort }}
|
||||
{{- end }}
|
||||
port: {{ .Values.thanosRuler.service.port }}
|
||||
targetPort: {{ .Values.thanosRuler.service.targetPort }}
|
||||
protocol: TCP
|
||||
{{- if .Values.thanosRuler.service.additionalPorts }}
|
||||
{{ toYaml .Values.thanosRuler.service.additionalPorts | indent 2 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app.kubernetes.io/name: thanos-ruler
|
||||
thanos-ruler: {{ template "kube-prometheus-stack.thanosRuler.crname" . }}
|
||||
type: "{{ .Values.thanosRuler.service.type }}"
|
||||
{{- end }}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{{- if and .Values.thanosRuler.enabled .Values.thanosRuler.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.serviceAccountName" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
app.kubernetes.io/name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
app.kubernetes.io/component: thanos-ruler
|
||||
{{- include "kube-prometheus-stack.labels" . | indent 4 -}}
|
||||
{{- if .Values.thanosRuler.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.thanosRuler.serviceAccount.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{ toYaml .Values.global.imagePullSecrets | indent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
{{- if and .Values.thanosRuler.enabled .Values.thanosRuler.serviceMonitor.selfMonitor }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||||
labels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
||||
{{- with .Values.thanosRuler.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "servicemonitor.scrapeLimits" .Values.thanosRuler.serviceMonitor | nindent 2 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
|
||||
release: {{ $.Release.Name | quote }}
|
||||
self-monitor: {{ .Values.thanosRuler.serviceMonitor.selfMonitor | quote }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ printf "%s" (include "kube-prometheus-stack.namespace" .) | quote }}
|
||||
endpoints:
|
||||
- port: {{ .Values.thanosRuler.thanosRulerSpec.portName }}
|
||||
{{- if .Values.thanosRuler.serviceMonitor.interval }}
|
||||
interval: {{ .Values.thanosRuler.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.serviceMonitor.proxyUrl }}
|
||||
proxyUrl: {{ .Values.thanosRuler.serviceMonitor.proxyUrl}}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.serviceMonitor.scheme }}
|
||||
scheme: {{ .Values.thanosRuler.serviceMonitor.scheme }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.serviceMonitor.bearerTokenFile }}
|
||||
bearerTokenFile: {{ .Values.thanosRuler.serviceMonitor.bearerTokenFile }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.serviceMonitor.tlsConfig }}
|
||||
tlsConfig: {{- toYaml .Values.thanosRuler.serviceMonitor.tlsConfig | nindent 6 }}
|
||||
{{- end }}
|
||||
path: "{{ trimSuffix "/" .Values.thanosRuler.thanosRulerSpec.routePrefix }}/metrics"
|
||||
{{- if .Values.thanosRuler.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings: {{- tpl (toYaml .Values.thanosRuler.serviceMonitor.metricRelabelings | nindent 6) . }}
|
||||
{{- end }}
|
||||
{{- if .Values.thanosRuler.serviceMonitor.relabelings }}
|
||||
relabelings: {{- toYaml .Values.thanosRuler.serviceMonitor.relabelings | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- range .Values.thanosRuler.serviceMonitor.additionalEndpoints }}
|
||||
- port: {{ .port }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.interval .interval }}
|
||||
interval: {{ default $.Values.thanosRuler.serviceMonitor.interval .interval }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.proxyUrl .proxyUrl }}
|
||||
proxyUrl: {{ default $.Values.thanosRuler.serviceMonitor.proxyUrl .proxyUrl }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.scheme .scheme }}
|
||||
scheme: {{ default $.Values.thanosRuler.serviceMonitor.scheme .scheme }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.bearerTokenFile .bearerTokenFile }}
|
||||
bearerTokenFile: {{ default $.Values.thanosRuler.serviceMonitor.bearerTokenFile .bearerTokenFile }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.tlsConfig .tlsConfig }}
|
||||
tlsConfig: {{- default $.Values.thanosRuler.serviceMonitor.tlsConfig .tlsConfig | toYaml | nindent 6 }}
|
||||
{{- end }}
|
||||
path: {{ .path }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.metricRelabelings .metricRelabelings }}
|
||||
metricRelabelings: {{- tpl (default $.Values.thanosRuler.serviceMonitor.metricRelabelings .metricRelabelings | toYaml | nindent 6) . }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.thanosRuler.serviceMonitor.relabelings .relabelings }}
|
||||
relabelings: {{- default $.Values.thanosRuler.serviceMonitor.relabelings .relabelings | toYaml | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user