Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/preview-service/bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:

ports:
- name: metrics
containerPort: 9094
containerPort: {{ .Values.preview_service.monitoring.metricsPort }}
protocol: TCP

livenessProbe:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ spec:
ports:
- protocol: TCP
name: web
port: 9094
port: {{ .Values.preview_service.monitoring.metricsPort }}
targetPort: metrics
15 changes: 15 additions & 0 deletions utils/helm/speckle-server/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 7 additions & 0 deletions utils/helm/speckle-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down