|
| 1 | +# |
| 2 | +# Copyright © contributors to CloudNativePG, established as |
| 3 | +# CloudNativePG a Series of LF Projects, LLC. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | +# SPDX-License-Identifier: Apache-2.0 |
| 18 | +# |
| 19 | +{{- if and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }} |
| 20 | +apiVersion: monitoring.coreos.com/v1 |
| 21 | +kind: PodMonitor |
| 22 | +metadata: |
| 23 | + name: {{ include "cluster.fullname" . }} |
| 24 | + namespace: {{ include "cluster.namespace" . }} |
| 25 | + labels: |
| 26 | + {{- include "cluster.labels" . | nindent 4 }} |
| 27 | + {{- with .Values.cluster.monitoring.podMonitor.labels }} |
| 28 | + {{- toYaml . | nindent 4 }} |
| 29 | + {{- end }} |
| 30 | + {{- with .Values.cluster.annotations }} |
| 31 | + annotations: |
| 32 | + {{- toYaml . | nindent 4 }} |
| 33 | + {{- end }} |
| 34 | +spec: |
| 35 | + selector: |
| 36 | + matchLabels: |
| 37 | + cnpg.io/cluster: {{ include "cluster.fullname" . }} |
| 38 | + podMetricsEndpoints: |
| 39 | + - port: metrics |
| 40 | + {{- with .Values.cluster.monitoring.podMonitor.relabelings }} |
| 41 | + relabelings: |
| 42 | + {{- toYaml . | nindent 8 }} |
| 43 | + {{- end }} |
| 44 | + {{- with .Values.cluster.monitoring.podMonitor.metricRelabelings }} |
| 45 | + metricRelabelings: |
| 46 | + {{- toYaml . | nindent 8 }} |
| 47 | + {{- end }} |
| 48 | +{{- end }} |
0 commit comments