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 коммит произвёл GitHub
Родитель d019e327c1
Коммит 2e59d231b5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 31 добавлений и 3 удалений

Просмотреть файл

@ -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": {

Просмотреть файл

@ -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/