
As fixed in pull request #7829 for the ServiceMonitor resource, this is also needed for the PrometheusRule. When upgrading the ingress-nginx chart in our environment (via Pulumi) from a really old version to the latest (4.2.0) we noticed it wanted to delete the PrometheusRule resource. This PR should fix that.
23 lines
951 B
YAML
23 lines
951 B
YAML
{{- if and .Values.controller.metrics.enabled .Values.controller.metrics.prometheusRule.enabled -}}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: PrometheusRule
|
|
metadata:
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
|
{{- if .Values.controller.metrics.prometheusRule.namespace }}
|
|
namespace: {{ .Values.controller.metrics.prometheusRule.namespace }}
|
|
{{- else }}
|
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: controller
|
|
{{- if .Values.controller.metrics.prometheusRule.additionalLabels }}
|
|
{{- toYaml .Values.controller.metrics.prometheusRule.additionalLabels | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.controller.metrics.prometheusRule.rules }}
|
|
groups:
|
|
- name: {{ template "ingress-nginx.name" . }}
|
|
rules: {{- toYaml .Values.controller.metrics.prometheusRule.rules | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|