Skip to content

Commit

Permalink
Templating prometheus url into cronjob heartbeat
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
david972 committed Sep 16, 2023
1 parent 49f7d4e commit 3606b7d
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 @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 3606b7d

Please sign in to comment.