Add env-based cfgsync port override in helm templates

This commit is contained in:
andrussal 2025-12-10 12:49:43 +01:00
parent 34be48b5b7
commit a5e6ebf5e6
4 changed files with 12 additions and 3 deletions

View File

@ -39,3 +39,12 @@ app.kubernetes.io/name: {{ include "nomos-runner.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
nomos/logical-role: prometheus
{{- end -}}
{{- define "nomos-runner.cfgsyncPort" -}}
{{- $env := env "NOMOS_CFGSYNC_PORT" -}}
{{- if $env -}}
{{ $env | int }}
{{- else -}}
{{ .Values.cfgsync.port | int }}
{{- end -}}
{{- end -}}

View File

@ -23,7 +23,7 @@ spec:
command: ["/etc/nomos/scripts/run_cfgsync.sh"]
ports:
- name: http
containerPort: {{ .Values.cfgsync.port }}
containerPort: {{ include "nomos-runner.cfgsyncPort" . }}
env:
- name: RUST_LOG
value: debug

View File

@ -11,5 +11,5 @@ spec:
nomos/component: cfgsync
ports:
- name: http
port: {{ .Values.cfgsync.port }}
port: {{ include "nomos-runner.cfgsyncPort" . }}
targetPort: http

View File

@ -2,7 +2,7 @@ image: "nomos-testnet:local"
imagePullPolicy: IfNotPresent
cfgsync:
port: {{ default 4400 (env "NOMOS_CFGSYNC_PORT") | int }}
port: 4400
config: ""
scripts: