Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
allow user to provide external_labels
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
  • Loading branch information
surajssd committed Jul 14, 2020
1 parent be75103 commit 0e4142c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/components/prometheus-operator/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type Prometheus struct {
WatchLabeledServiceMonitors bool `hcl:"watch_labeled_service_monitors,optional"`
WatchLabeledPrometheusRules bool `hcl:"watch_labeled_prometheus_rules,optional"`
Ingress *types.Ingress `hcl:"ingress,block"`
ExternalLabels map[string]string `hcl:"external_labels,optional"`
}

type component struct {
Expand Down
6 changes: 6 additions & 0 deletions pkg/components/prometheus-operator/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ prometheus:
{{ $key }}: {{ $value }}
{{ end }}
{{ end }}
{{ if .Prometheus.ExternalLabels }}
externalLabels:
{{ range $key, $value := .Prometheus.ExternalLabels}}
{{ $key }}: {{ $value }}
{{ end }}
{{ end }}
retention: {{.Prometheus.MetricsRetention}}
serviceMonitorSelectorNilUsesHelmValues: {{.Prometheus.WatchLabeledServiceMonitors}}
ruleSelectorNilUsesHelmValues: {{.Prometheus.WatchLabeledPrometheusRules}}
Expand Down

0 comments on commit 0e4142c

Please sign in to comment.