feat(preview-service): allow metrics port to be configured (#2421)

* feat(preview-service): allow metrics port to be configured

* Allow configurable port
This commit is contained in:
Iain Sproat
2024-06-21 17:04:23 +01:00
committed by GitHub
parent d019e327c1
commit 2e59d231b5
5 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ function onError(error) {
function onListening() {
const addr = server.address()
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr?.port
serverLogger.info('Listening on ' + bind)
startPreviewService()
@@ -25,7 +25,7 @@ spec:
ports:
- name: metrics
containerPort: 9094
containerPort: {{ .Values.preview_service.monitoring.metricsPort }}
protocol: TCP
livenessProbe:
@@ -62,6 +62,12 @@ spec:
{{- end }}
env:
- name: PORT
value: {{ .Values.preview_service.port | quote }}
- name: PROMETHEUS_METRICS_PORT
value: {{ .Values.preview_service.monitoring.metricsPort | quote }}
- name: PG_CONNECTION_STRING
valueFrom:
secretKeyRef:
@@ -12,5 +12,5 @@ spec:
ports:
- protocol: TCP
name: web
port: 9094
port: {{ .Values.preview_service.monitoring.metricsPort }}
targetPort: metrics
@@ -1601,6 +1601,21 @@
"description": "The Docker image to be used for the Speckle Preview Service component. If blank, defaults to speckle/speckle-preview-service:{{ .Values.docker_image_tag }}. If provided, this value should be the full path including tag. The docker_image_tag value will be ignored.",
"default": ""
},
"port": {
"type": "string",
"description": "The port on which the Preview Service will run. This is not exposed, but used within its own local network within the pod.",
"default": "3001"
},
"monitoring": {
"type": "object",
"properties": {
"metricsPort": {
"type": "string",
"description": "The port on which the metrics server will be exposed.",
"default": "9094"
}
}
},
"requests": {
"type": "object",
"properties": {
+7
View File
@@ -1022,6 +1022,13 @@ preview_service:
##
image: ''
## @param preview_service.port The port on which the Preview Service will run. This is not exposed, but used within its own local network within the pod.
port: '3001'
monitoring:
## @param preview_service.monitoring.metricsPort The port on which the metrics server will be exposed.
metricsPort: '9094'
requests:
## @param preview_service.requests.cpu The CPU that should be available on a node when scheduling this pod.
## ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/