Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] Revert "Add downward compat for Prom CRD (#4818)" #4883

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 63.1.0
version: 64.0.0
appVersion: v0.76.1
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
8 changes: 7 additions & 1 deletion charts/kube-prometheus-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documen

A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.

### From 63.x to 64.x

v64 reverts the v63 release.

All changes mentioned in the v63 release notes must be reverted.

### From 62.x to 63.x

Simplify setting empty selectors, by deprecating `*SelectorNilUsesHelmValues` properties.
Expand Down Expand Up @@ -974,7 +980,7 @@ For information on how to use PodMonitors/ServiceMonitors, please see the docume
By default, Prometheus discovers PodMonitors and ServiceMonitors within its namespace, that are labeled with the same release tag as the prometheus-operator release.
Sometimes, you may need to discover custom PodMonitors/ServiceMonitors, for example used to scrape data from third-party applications.
An easy way of doing this, without compromising the default PodMonitors/ServiceMonitors discovery, is allowing Prometheus to discover all PodMonitors/ServiceMonitors within its namespace, without applying label filtering.
To do so, you can set `prometheus.prometheusSpec.podMonitorSelector` and `prometheus.prometheusSpec.serviceMonitorSelector` to `matchLabels=null`.
To do so, you can set `prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues` and `prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues` to `false`.

## Migrating from stable/prometheus-operator chart

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ spec:
configMaps:
{{ toYaml .Values.alertmanager.alertmanagerSpec.configMaps | indent 4 }}
{{- end }}
{{- if not (kindIs "invalid" .Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector) }}
alertmanagerConfigSelector: {{ tpl (toYaml .Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector) . | nindent 4 }}
{{- end }}
{{- if not (kindIs "invalid" .Values.alertmanager.alertmanagerSpec.alertmanagerConfigNamespaceSelector) }}
alertmanagerConfigNamespaceSelector: {{ tpl (toYaml .Values.alertmanager.alertmanagerSpec.alertmanagerConfigNamespaceSelector) . | nindent 4 }}
{{- if .Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector }}
alertmanagerConfigSelector:
{{ tpl (toYaml .Values.alertmanager.alertmanagerSpec.alertmanagerConfigSelector | indent 4) . }}
{{ else }}
alertmanagerConfigSelector: {}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.alertmanagerConfigNamespaceSelector }}
alertmanagerConfigNamespaceSelector:
{{ tpl (toYaml .Values.alertmanager.alertmanagerSpec.alertmanagerConfigNamespaceSelector | indent 4) . }}
{{ else }}
alertmanagerConfigNamespaceSelector: {}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.web }}
web:
Expand Down
18 changes: 0 additions & 18 deletions charts/kube-prometheus-stack/templates/deprecation.yaml

This file was deleted.

96 changes: 73 additions & 23 deletions charts/kube-prometheus-stack/templates/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,53 @@ spec:
{{ toYaml .Values.prometheus.prometheusSpec.configMaps | indent 4 }}
{{- end }}
serviceAccountName: {{ template "kube-prometheus-stack.prometheus.serviceAccountName" . }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.serviceMonitorSelector) }}
serviceMonitorSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.serviceMonitorSelector) . | nindent 4 }}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.serviceMonitorNamespaceSelector) }}
serviceMonitorNamespaceSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.serviceMonitorNamespaceSelector) . | nindent 4 }}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.podMonitorSelector) }}
podMonitorSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.podMonitorSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.serviceMonitorSelector }}
serviceMonitorSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.serviceMonitorSelector | indent 4) . }}
{{ else if .Values.prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues }}
serviceMonitorSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
serviceMonitorSelector: {}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.podMonitorNamespaceSelector) }}
podMonitorNamespaceSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.podMonitorNamespaceSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.serviceMonitorNamespaceSelector }}
serviceMonitorNamespaceSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.serviceMonitorNamespaceSelector | indent 4) . }}
{{ else }}
serviceMonitorNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.podMonitorSelector }}
podMonitorSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.podMonitorSelector | indent 4) . }}
{{ else if .Values.prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues }}
podMonitorSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
podMonitorSelector: {}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.probeSelector) }}
probeSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.probeSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.podMonitorNamespaceSelector }}
podMonitorNamespaceSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.podMonitorNamespaceSelector | indent 4) . }}
{{ else }}
podMonitorNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.probeSelector }}
probeSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.probeSelector | indent 4) . }}
{{ else if .Values.prometheus.prometheusSpec.probeSelectorNilUsesHelmValues }}
probeSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
probeSelector: {}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.probeNamespaceSelector) }}
probeNamespaceSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.probeNamespaceSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.probeNamespaceSelector }}
probeNamespaceSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.probeNamespaceSelector | indent 4) . }}
{{ else }}
probeNamespaceSelector: {}
{{- end }}
{{- if and (not .Values.prometheus.agentMode) (or .Values.prometheus.prometheusSpec.remoteRead .Values.prometheus.prometheusSpec.additionalRemoteRead) }}
remoteRead:
Expand All @@ -199,18 +229,38 @@ spec:
{{ toYaml .Values.prometheus.prometheusSpec.securityContext | indent 4 }}
{{- end }}
{{- if not .Values.prometheus.agentMode }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.ruleNamespaceSelector) }}
ruleNamespaceSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.ruleNamespaceSelector) . | nindent 4 }}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.ruleSelector) }}
ruleSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.ruleSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.ruleNamespaceSelector }}
ruleNamespaceSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.ruleNamespaceSelector | indent 4) . }}
{{ else }}
ruleNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.ruleSelector }}
ruleSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.ruleSelector | indent 4) . }}
{{- else if .Values.prometheus.prometheusSpec.ruleSelectorNilUsesHelmValues }}
ruleSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
ruleSelector: {}
{{- end }}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.scrapeConfigSelector) }}
scrapeConfigSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.scrapeConfigSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.scrapeConfigSelector }}
scrapeConfigSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.scrapeConfigSelector | indent 4) . }}
{{ else if .Values.prometheus.prometheusSpec.scrapeConfigSelectorNilUsesHelmValues }}
scrapeConfigSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
scrapeConfigSelector: {}
{{- end }}
{{- if not (kindIs "invalid" .Values.prometheus.prometheusSpec.scrapeConfigNamespaceSelector) }}
scrapeConfigNamespaceSelector: {{ tpl (toYaml .Values.prometheus.prometheusSpec.scrapeConfigNamespaceSelector) . | nindent 4 }}
{{- if .Values.prometheus.prometheusSpec.scrapeConfigNamespaceSelector }}
scrapeConfigNamespaceSelector:
{{ tpl (toYaml .Values.prometheus.prometheusSpec.scrapeConfigNamespaceSelector | indent 4) . }}
{{ else }}
scrapeConfigNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.storageSpec }}
storage:
Expand Down
20 changes: 15 additions & 5 deletions charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ spec:
{{- if .Values.thanosRuler.thanosRulerSpec.evaluationInterval }}
evaluationInterval: {{ .Values.thanosRuler.thanosRulerSpec.evaluationInterval }}
{{- end }}
{{- if not (kindIs "invalid" .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector) }}
ruleNamespaceSelector: {{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector) . | nindent 4 }}
{{- end }}
{{- if not (kindIs "invalid" .Values.thanosRuler.thanosRulerSpec.ruleSelector) }}
ruleSelector: {{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.ruleSelector) . | nindent 4 }}
{{- if .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector }}
ruleNamespaceSelector:
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.ruleNamespaceSelector | indent 4) . }}
{{ else }}
ruleNamespaceSelector: {}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.ruleSelector }}
ruleSelector:
{{ tpl (toYaml .Values.thanosRuler.thanosRulerSpec.ruleSelector | indent 4) .}}
{{- else if .Values.thanosRuler.thanosRulerSpec.ruleSelectorNilUsesHelmValues }}
ruleSelector:
matchLabels:
release: {{ $.Release.Name | quote }}
{{ else }}
ruleSelector: {}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.alertQueryUrl }}
alertQueryUrl: "{{ .Values.thanosRuler.thanosRulerSpec.alertQueryUrl }}"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading