controller-prometheusrules.yaml 961 B

123456789101112131415161718192021
  1. {{- if and ( .Values.controller.metrics.enabled ) ( .Values.controller.metrics.prometheusRule.enabled ) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) -}}
  2. apiVersion: monitoring.coreos.com/v1
  3. kind: PrometheusRule
  4. metadata:
  5. name: {{ include "ingress-nginx.controller.fullname" . }}
  6. {{- if .Values.controller.metrics.prometheusRule.namespace }}
  7. namespace: {{ .Values.controller.metrics.prometheusRule.namespace | quote }}
  8. {{- end }}
  9. labels:
  10. {{- include "ingress-nginx.labels" . | nindent 4 }}
  11. app.kubernetes.io/component: controller
  12. {{- if .Values.controller.metrics.prometheusRule.additionalLabels }}
  13. {{- toYaml .Values.controller.metrics.prometheusRule.additionalLabels | nindent 4 }}
  14. {{- end }}
  15. spec:
  16. {{- if .Values.controller.metrics.prometheusRule.rules }}
  17. groups:
  18. - name: {{ template "ingress-nginx.name" . }}
  19. rules: {{- toYaml .Values.controller.metrics.prometheusRule.rules | nindent 4 }}
  20. {{- end }}
  21. {{- end }}