Skip to content

Commit

Permalink
Add support for ProbeSelector and ProbeNamespaceSelector (vmware-tanz…
Browse files Browse the repository at this point in the history
…u#237)

Signed-off-by: Gopi <[email protected]>
Signed-off-by: Torsten Walter <[email protected]>
  • Loading branch information
gopisaba authored and Torsten Walter committed Oct 26, 2020
1 parent 7235a4c commit 801c324
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ spec:
{{ else }}
podMonitorNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.probeSelector }}
probeSelector:
{{ toYaml .Values.prometheus.prometheusSpec.probeSelector | indent 4 }}
{{ else if .Values.prometheus.prometheusSpec.probeSelectorNilUsesHelmValues }}
probeSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
probeSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.probeNamespaceSelector }}
probeNamespaceSelector:
{{ toYaml .Values.prometheus.prometheusSpec.probeNamespaceSelector | indent 4 }}
{{ else }}
probeNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.remoteRead }}
remoteRead:
{{ toYaml .Values.prometheus.prometheusSpec.remoteRead | indent 4 }}
Expand Down
20 changes: 20 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,26 @@ prometheus:
##
podMonitorNamespaceSelector: {}

## If true, a nil or {} value for prometheus.prometheusSpec.probeSelector will cause the
## prometheus resource to be created with selectors based on values in the helm deployment,
## which will also match the podmonitors created
##
probeSelectorNilUsesHelmValues: true

## Probes to be selected for target discovery.
## If {}, select all Probes
##
probeSelector: {}
## Example which selects Probes with label "prometheus" set to "somelabel"
# probeSelector:
# matchLabels:
# prometheus: somelabel

## Namespaces to be selected for Probe discovery.
## See https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#namespaceselector for usage
##
probeNamespaceSelector: {}

## How long to retain metrics
##
retention: 10d
Expand Down

0 comments on commit 801c324

Please sign in to comment.