From 3606b7dce3b2f5b07c4b4f9451fb7db756ec4611 Mon Sep 17 00:00:00 2001 From: David ALEXANDRE Date: Sat, 16 Sep 2023 22:10:16 +0200 Subject: [PATCH] Templating prometheus url into cronjob heartbeat Can not use external prometheus with hearbeat Added new variable `.prometheusUrl` in value and use it into heartbeat from linkerd-control-plane chart Run `helm template` check the cronjob manifest Fixes #11342 Signed-off-by: David ALEXANDRE --- charts/linkerd-control-plane/templates/heartbeat.yaml | 4 ++++ charts/linkerd-control-plane/values.yaml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/linkerd-control-plane/templates/heartbeat.yaml b/charts/linkerd-control-plane/templates/heartbeat.yaml index c67d033775240..8ea7ea92aaaa2 100644 --- a/charts/linkerd-control-plane/templates/heartbeat.yaml +++ b/charts/linkerd-control-plane/templates/heartbeat.yaml @@ -64,7 +64,11 @@ spec: - "-controller-namespace={{.Release.Namespace}}" - "-log-level={{.Values.controllerLogLevel}}" - "-log-format={{.Values.controllerLogFormat}}" + {{- if .Values.prometheusUrl }} + - "-prometheus-url={{.Values.prometheusUrl}}" + {{- else }} - "-prometheus-url=http://prometheus.linkerd-viz.svc.{{.Values.clusterDomain}}:9090" + {{- end }} {{- if .Values.heartbeatResources -}} {{- include "partials.resources" .Values.heartbeatResources | nindent 12 }} {{- end }} diff --git a/charts/linkerd-control-plane/values.yaml b/charts/linkerd-control-plane/values.yaml index 38e50541997fc..2d42e8cd37f3c 100644 --- a/charts/linkerd-control-plane/values.yaml +++ b/charts/linkerd-control-plane/values.yaml @@ -502,7 +502,7 @@ policyValidator: # for more information. injectCaFromSecret: "" -# -|- CPU, Memory and Ephemeral Storage resources required by the policy controller +# -|- CPU, Memory and Ephemeral Storage resources required by the policy controller #policyControllerResources: # -- NodeSelector section, See the [K8S @@ -525,6 +525,9 @@ nodeSelector: # for more information #nodeAffinity: +# -- url of external prometheus instance (used for the heartbeat) +prometheusUrl: "" + # Prometheus Operator PodMonitor configuration podMonitor: # -- Enables the creation of Prometheus Operator [PodMonitor](https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.PodMonitor)