Skip to content

Commit

Permalink
Expose Prometheus Metrics Server with k8s Service
Browse files Browse the repository at this point in the history
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 <alex.szakaly@gmail.com>
  • Loading branch information
alex1989hu committed Oct 17, 2022
1 parent 206cc6a commit 10a4d8b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm/install/Chart.yaml
Expand Up @@ -4,5 +4,5 @@ description: Installer for PGO, the open source Postgres Operator from Crunchy D

type: application
# The version below should match the version on the PostgresCluster CRD
version: 0.6.0
version: 0.6.1
appVersion: 5.2.0
3 changes: 3 additions & 0 deletions helm/install/templates/manager.yaml
Expand Up @@ -40,6 +40,9 @@ spec:
- name: CHECK_FOR_UPGRADES
value: "false"
{{- end }}
ports:
- containerPort: 8080
name: metrics
securityContext:
allowPrivilegeEscalation: false
capabilities: { drop: [ALL] }
Expand Down
15 changes: 15 additions & 0 deletions helm/install/templates/service.yaml
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
labels:
{{- include "install.labels" . | nindent 4 }}
{{- include "install.clusterLabels" . | nindent 4 }}
name: {{ .Chart.Name }}
spec:
ports:
- name: metrics
port: 9090
protocol: TCP
targetPort: metrics
selector:
{{- include "install.clusterLabels" . | nindent 4 }}

0 comments on commit 10a4d8b

Please sign in to comment.