set env variables on helm-deployed apps so that they work as expected

Signed-off-by: Pascal Sthamer <pascal+github@sthamer.xyz>
This commit is contained in:
Pascal Sthamer
2025-12-05 16:00:13 +01:00
parent 82edd747ad
commit fb07662d7a
2 changed files with 25 additions and 8 deletions
@@ -108,6 +108,18 @@ Usage:
{{ include "common.affinities.pods" (dict "type" .type "customLabels" $customLabels "context" .context )}}
{{- end -}}
{{- define "shuffle.worker.hostname" -}}
{{- if .Values.worker.enableHelmDeployment -}}
http://{{ include "shuffle.worker.name" . }}.{{ .Release.Namespace }}.svc.cluster.local
{{- else -}}
http://shuffle-workers.{{ .Release.Namespace }}.svc.cluster.local
{{- end -}}
{{- end -}}
{{- define "shuffle.worker.baseUrl" -}}
{{ include "shuffle.worker.hostname" . }}:{{ .Values.worker.containerPorts.http }}
{{- end -}}
{{/*
Return the environment variables of shuffle-worker in the format
KEY: VALUE
@@ -118,12 +130,7 @@ KUBERNETES_NAMESPACE: "{{ .Release.Namespace }}"
SHUFFLE_SWARM_CONFIG: "run" # Shuffle Worker requires this to be set even when using K8s instead of swarm
BASE_URL: {{ include "shuffle.backend.baseUrl" . | quote }}
SHUFFLE_APP_EXPOSED_PORT: {{ .Values.app.exposedContainerPort | quote }}
{{- if .Values.worker.enableHelmDeployment }}
WORKER_HOSTNAME: "{{ include "shuffle.worker.name" . }}.{{ .Release.Namespace }}.svc.cluster.local"
{{- else }}
WORKER_HOSTNAME: "shuffle-workers.{{ .Release.Namespace }}.svc.cluster.local"
{{- end }}
WORKER_HOSTNAME: {{ include "shuffle.worker.hostname" . }}
{{- if .Values.worker.manageAppDeployments }}
# Shuffle app images
@@ -164,4 +171,4 @@ SHUFFLE_APP_EPHEMERAL_STORAGE_LIMIT: {{ (index $appResources.limits "ephemeral-s
# Include shuffle app environment variables. Worker passes them down to apps, when creating their deployment.
{{ include "shuffle.appInstance.env" . }}
{{- end }}
{{- end -}}
{{- end -}}