Skip to content

Commit

Permalink
port enable podMonitor
Browse files Browse the repository at this point in the history
Signed-off-by: Tao Li <[email protected]>
  • Loading branch information
litaocdl committed Nov 25, 2024
1 parent 0a394cd commit ee393e0
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2021 EnterpriseDB Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
{{- if .Values.monitoring.podMonitorEnabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "edb-postgres-for-kubernetes.fullname" . }}
labels:
{{- include "edb-postgres-for-kubernetes.labels" . | nindent 4 }}
{{- with .Values.monitoring.podMonitorAdditionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "edb-postgres-for-kubernetes.selectorLabels" . | nindent 6 }}
podMetricsEndpoints:
- port: metrics
{{- with .Values.monitoring.podMonitorMetricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.monitoring.podMonitorRelabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@
}
}
},
"monitoring": {
"type": "object",
"properties": {
"podMonitorEnabled": {
"type": "boolean"
},
"podMonitorMetricRelabelings": {
"type": "array"
},
"podMonitorRelabelings": {
"type": "array"
},
"podMonitorAdditionalLabels": {
"type": "object"
}
}
},
"hostNetwork": {
"type": "boolean"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ tolerations: []
# -- Affinity for the operator to be installed
affinity: {}

monitoring:
# -- Specifies whether the monitoring should be enabled. Requires Prometheus Operator CRDs.
podMonitorEnabled: false
# -- Metrics relabel configurations to apply to samples before ingestion.
podMonitorMetricRelabelings: []
# -- Relabel configurations to apply to samples before scraping.
podMonitorRelabelings: []
# -- Additional labels for the podMonitor
podMonitorAdditionalLabels: {}

# -- Test related configurations
test:
image:
Expand Down

0 comments on commit ee393e0

Please sign in to comment.