Skip to content

Commit 10a4d8b

Browse files
committed
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 CrunchyData#61 Signed-off-by: Alex Szakaly <[email protected]>
1 parent 206cc6a commit 10a4d8b

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

helm/install/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ description: Installer for PGO, the open source Postgres Operator from Crunchy D
44

55
type: application
66
# The version below should match the version on the PostgresCluster CRD
7-
version: 0.6.0
7+
version: 0.6.1
88
appVersion: 5.2.0

helm/install/templates/manager.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ spec:
4040
- name: CHECK_FOR_UPGRADES
4141
value: "false"
4242
{{- end }}
43+
ports:
44+
- containerPort: 8080
45+
name: metrics
4346
securityContext:
4447
allowPrivilegeEscalation: false
4548
capabilities: { drop: [ALL] }

helm/install/templates/service.yaml

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

0 commit comments

Comments
 (0)