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 6, 2023
1 parent 49f7d4e commit d8ca043
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/linkerd-control-plane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- name: partials
version: 0.1.0
repository: file://../partials
version: 1.15.0
version: 1.15.1
icon: https://linkerd.io/images/logo-only-200h.png
maintainers:
- name: Linkerd authors
Expand Down
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
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 d8ca043

Please sign in to comment.