|
| 1 | +{{/* |
| 2 | +Copyright 2024 HAProxy Technologies LLC |
| 3 | + |
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | + |
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + |
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/}} |
| 16 | + |
| 17 | +{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.controller.podMonitor.enabled }} |
| 18 | +apiVersion: monitoring.coreos.com/v1 |
| 19 | +kind: PodMonitor |
| 20 | +metadata: |
| 21 | + name: {{ include "kubernetes-ingress.podMonitorName" . }} |
| 22 | + namespace: {{ include "kubernetes-ingress.namespace" . }} |
| 23 | + labels: |
| 24 | + app.kubernetes.io/name: {{ include "kubernetes-ingress.name" . }} |
| 25 | + helm.sh/chart: {{ include "kubernetes-ingress.chart" . }} |
| 26 | + app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 27 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 28 | + app.kubernetes.io/version: {{ .Chart.AppVersion }} |
| 29 | + {{- if .Values.controller.podMonitor.extraLabels }} |
| 30 | + {{ toYaml .Values.controller.podMonitor.extraLabels | nindent 4 }} |
| 31 | + {{- end }} |
| 32 | +spec: |
| 33 | + podMetricsEndpoints: |
| 34 | + {{ .Values.controller.podMonitor.endpoints | toYaml | nindent 4 }} |
| 35 | + namespaceSelector: |
| 36 | + matchNames: |
| 37 | + - {{ include "kubernetes-ingress.namespace" . }} |
| 38 | + selector: |
| 39 | + matchLabels: |
| 40 | + app.kubernetes.io/name: {{ include "kubernetes-ingress.name" . }} |
| 41 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 42 | +{{- end }} |
0 commit comments