Skip to content

Commit 687bf29

Browse files
committed
fix(helm): keep install port aligned with service port
Signed-off-by: Tian Teng <tian.teng@emerson.com>
1 parent fca80ab commit 687bf29

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

charts/templates/deployment.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,23 @@ spec:
6464
port: http
6565
resources:
6666
{{- toYaml .Values.resources | nindent 12 }}
67-
{{- if .Values.env }}
67+
{{- $envNames := list }}
68+
{{- range .Values.env }}
69+
{{- $envNames = append $envNames .name }}
70+
{{- end }}
6871
env:
72+
{{- if not (has "INSTALL_PORT" $envNames) }}
73+
- name: INSTALL_PORT
74+
value: {{ .Values.service.port | quote }}
75+
{{- end }}
76+
{{- if not (has "SITE_ADDR" $envNames) }}
77+
- name: SITE_ADDR
78+
value: {{ printf "0.0.0.0:%v" .Values.service.port | quote }}
79+
{{- end }}
80+
{{- if not (has "SWAGGER_ADDRESS_PORT" $envNames) }}
81+
- name: SWAGGER_ADDRESS_PORT
82+
value: {{ printf ":%v" .Values.service.port | quote }}
83+
{{- end }}
6984
{{- range .Values.env }}
7085
- name: {{ .name }}
7186
{{- if .value | quote }}
@@ -76,7 +91,6 @@ spec:
7691
{{- toYaml .valueFrom | nindent 16 }}
7792
{{- end }}
7893
{{- end }}
79-
{{- end }}
8094
volumeMounts:
8195
- name: data
8296
mountPath: "/data"
@@ -102,4 +116,4 @@ spec:
102116
{{- with .Values.tolerations }}
103117
tolerations:
104118
{{- toYaml . | nindent 8 }}
105-
{{- end }}
119+
{{- end }}

0 commit comments

Comments
 (0)