Skip to content

Commit 8a0698a

Browse files
committed
use ST2WEB_HTTPS env var instead of use_https value
1 parent c98d120 commit 8a0698a

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

templates/deployments.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,13 @@ spec:
400400
image: '{{ template "imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
401401
imagePullPolicy: {{ .Values.image.pullPolicy }}
402402
ports:
403-
- containerPort: {{ .Values.st2web.use_https | ternary 443 80 }}
403+
- containerPort: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary 443 80 }}
404404
# Probe to check if app is running. Failure will lead to a pod restart.
405405
livenessProbe:
406406
httpGet:
407-
scheme: {{ .Values.st2web.use_https | ternary "HTTPS" "HTTP" }}
407+
scheme: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary "HTTPS" "HTTP" }}
408408
path: /
409-
port: {{ .Values.st2web.use_https | ternary 443 80 }}
409+
port: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary 443 80 }}
410410
initialDelaySeconds: 1
411411
# Probe to check if app is ready to serve traffic. Failure will lead to temp stop serving traffic.
412412
# TODO: Failing to add readinessProbe, since st2 requires authorization (401) and we don't have `/healthz` endpoints yet (https://github.com/StackStorm/st2/issues/4020)
@@ -419,15 +419,8 @@ spec:
419419
# path: /api/
420420
# port: 443
421421
# initialDelaySeconds: 3
422-
{{- if or .Values.st2web.env .Values.st2web.use_https }}
423-
env:
424-
{{- if .Values.st2web.env }}
425-
{{- include "stackstorm-ha.customEnv" .Values.st2web | nindent 10 }}
426-
{{- end }}
427-
{{- if .Values.st2web.use_https }}
428-
- name: ST2WEB_HTTPS
429-
value: "1"
430-
{{- end }}
422+
{{- if .Values.st2web.env }}
423+
env: {{- include "stackstorm-ha.customEnv" .Values.st2web | nindent 8 }}
431424
{{- end }}
432425
envFrom:
433426
- configMapRef:

templates/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ spec:
9999
{{- end }}
100100
ports:
101101
- protocol: TCP
102-
port: {{ .Values.st2web.use_https | ternary 443 80 }}
102+
port: {{ eq (get .Values.st2web.env "ST2WEB_HTTPS" | toString) "1" | ternary 443 80 }}
103103

104104
{{ if .Values.st2chatops.enabled -}}
105105
---

values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,11 @@ st2web:
295295
affinity: {}
296296
env: {}
297297
# HTTP_PROXY: http://proxy:1234
298+
## Advanced: To configure st2web to serve HTTPS (port 443) instead of HTTP (port 80)
299+
## provide ssl certs via extra_volumes, and add the ST2WEB_HTTPS env var here:
300+
# ST2WEB_HTTPS: 1
298301
serviceAccount:
299302
attach: false
300-
# Have st2web pod and service use HTTPS on port 443 when true. default: false (use HTTP on port 80)
301-
use_https: false
302303
# mount extra volumes on the st2web pod(s) (primarily useful for k8s-provisioned secrets)
303304
## Note that Helm templating is supported in 'mount' and 'volume'
304305
extra_volumes: []

0 commit comments

Comments
 (0)