Skip to content

Commit

Permalink
Templating prometheus url into cronjob heartbeat (#11343)
Browse files Browse the repository at this point in the history
Can not use external prometheus with hearbeat. This change adds a new variable `.prometheusUrl` in value and use it into heartbeat from linkerd-control-plane chart.

Fixes #11342

Signed-off-by: David ALEXANDRE <[email protected]>
  • Loading branch information
david972 authored and adleong committed Feb 17, 2024
1 parent 2779d11 commit 22a59ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/linkerd-control-plane/templates/heartbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 4 additions & 1 deletion charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,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
Expand All @@ -544,6 +544,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)
Expand Down

0 comments on commit 22a59ba

Please sign in to comment.