Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ed6768f

Browse files
committedNov 25, 2021
Expose Prometheus Metrics Server with k8s Service
To let us able to scrape metrics from the Operator e.g. with a ServiceMonitor we need to have a Service which provides named port close #61 Signed-off-by: Alex Szakaly <[email protected]>
1 parent 25d67c1 commit ed6768f

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed
 

‎helm/install/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: pgo
33
description: Installer for PGO, the open source Postgres Operator from Crunchy Data
44
type: application
5-
version: 0.2.2
5+
version: 0.2.3
66
appVersion: 5.0.4

‎helm/install/templates/manager.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ spec:
2929
- name: PGO_TARGET_NAMESPACE
3030
valueFrom: { fieldRef: { apiVersion: v1, fieldPath: metadata.namespace } }
3131
{{- end }}
32+
ports:
33+
- containerPort: 8080
34+
name: metrics
3235
securityContext:
3336
allowPrivilegeEscalation: false
3437
readOnlyRootFilesystem: true

‎helm/install/templates/service.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
{{- include "install.labels" . | nindent 4 }}
6+
name: {{ .Chart.Name }}
7+
spec:
8+
ports:
9+
- name: metrics
10+
port: 9090
11+
protocol: TCP
12+
targetPort: metrics
13+
selector:
14+
{{- include "install.crunchyLabels" . | nindent 5 }}

0 commit comments

Comments
 (0)
Please sign in to comment.