Skip to content

Commit 1332ae8

Browse files
guzzijonesajjonen
authored andcommitted
work with docker proxy
update fix default registry fix whitespace
1 parent a8ca314 commit 1332ae8

File tree

4 files changed

+58
-33
lines changed

4 files changed

+58
-33
lines changed

templates/_helpers.tpl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ app.kubernetes.io/name: {{ $name }}
3939
app.kubernetes.io/instance: {{ $root.Release.Name }}
4040
{{- end -}}
4141

42+
{{/*
43+
Generate Docker image registry: container registry
44+
*/}}
45+
{{- define "stackstorm-ha.imageRegistry" -}}
46+
{{- if .Values.image.registry -}}
47+
{{ .Values.image.registry }}
48+
{{- else -}}
49+
'docker.io'
50+
{{- end -}}
51+
{{- end -}}
52+
53+
4254
{{/*
4355
Generate Docker image repository: Public Docker Hub 'stackstorm' for FOSS version
4456
*/}}
@@ -91,7 +103,7 @@ Generate comma-separated list of nodes for MongoDB-HA connection string, based o
91103
{{- range $index0 := until $replicas -}}
92104
{{- $index1 := $index0 | add1 -}}
93105
{{- if eq $architecture "replicaset" }}
94-
{{- $mongo_fullname }}-{{ $index0 }}.{{ $mongo_fullname }}-headless{{ if ne $index1 $replicas }},{{ end }}
106+
{{- $mongo_fullname }}-{{ $index0 }}.{{ $mongo_fullname }}-headless.{{ $.Release.Namespace }}.svc.cluster.local{{ if ne $index1 $replicas }},{{ end }}
95107
{{- else }}
96108
{{- $mongo_fullname }}-{{ $index0 }}.{{ $mongo_fullname }}{{ if ne $index1 $replicas }},{{ end }}
97109
{{- end -}}
@@ -110,9 +122,9 @@ Generate list of nodes for Redis with Sentinel connection string, based on numbe
110122
{{- $sentinel_port := (index .Values "redis" "sentinel" "port") }}
111123
{{- range $index0 := until $replicas -}}
112124
{{- if eq $index0 0 -}}
113-
{{ $.Release.Name }}-redis-node-{{ $index0 }}.{{ $.Release.Name }}-redis-headless:{{ $sentinel_port }}?sentinel={{ $master_name }}
125+
{{ $.Release.Name }}-redis-node-{{ $index0 }}.{{ $.Release.Name }}-redis-headless.{{ $.Release.Namespace }}.svc.cluster.local:{{ $sentinel_port }}?sentinel={{ $master_name }}
114126
{{- else -}}
115-
&sentinel_fallback={{ $.Release.Name }}-redis-node-{{ $index0 }}.{{ $.Release.Name }}-redis-headless:{{ $sentinel_port }}
127+
&sentinel_fallback={{ $.Release.Name }}-redis-node-{{ $index0 }}.{{ $.Release.Name }}-redis-headless.{{ $.Release.Namespace }}.svc.cluster.local:{{ $sentinel_port }}
116128
{{- end -}}
117129
{{- end -}}
118130
{{- end -}}
@@ -165,7 +177,7 @@ Reduce duplication of the st2.*.conf volume details
165177
{{- if index .Values "mongodb" "enabled" }}
166178
{{- $mongodb_port := (int (index .Values "mongodb" "service" "port")) }}
167179
- name: wait-for-db
168-
image: busybox:1.28
180+
image: {{ template "stackstorm-ha.imageRegistry" . }}/library/busybox:1.28
169181
command:
170182
- 'sh'
171183
- '-c'
@@ -185,7 +197,7 @@ Reduce duplication of the st2.*.conf volume details
185197
{{- if index .Values "rabbitmq" "enabled" }}
186198
{{- $rabbitmq_port := (int (index .Values "rabbitmq" "service" "port")) }}
187199
- name: wait-for-queue
188-
image: busybox:1.28
200+
image: {{ template "stackstorm-ha.imageRegistry" . }}/library/busybox:1.28
189201
command:
190202
- 'sh'
191203
- '-c'
@@ -296,7 +308,7 @@ Merge packs and virtualenvs from st2 with those from st2packs images
296308
{{- if $.Values.st2.packs.images }}
297309
{{- range $.Values.st2.packs.images }}
298310
- name: 'st2-custom-pack-{{ printf "%s-%s-%s" .repository .name .tag | sha1sum }}'
299-
image: "{{ .repository }}/{{ .name }}:{{ .tag }}"
311+
image: "{{ .registry }}/{{ .repository }}/{{ .name }}:{{ .tag }}"
300312
imagePullPolicy: {{ .pullPolicy | quote }}
301313
volumeMounts:
302314
- name: st2-packs-vol

templates/deployments.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
4646
# Sidecar container for generating .htpasswd with st2 username & password pair and sharing produced file with the main st2auth container
4747
- name: generate-htpasswd
48-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
48+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
4949
imagePullPolicy: {{ .Values.image.pullPolicy }}
5050
{{- with .Values.securityContext }}
5151
securityContext: {{- toYaml . | nindent 10 }}
@@ -62,7 +62,7 @@ spec:
6262
- printf "${ST2_AUTH_USERNAME}:$(openssl passwd -apr1 "${ST2_AUTH_PASSWORD}")\n" > /tmp/st2/htpasswd
6363
containers:
6464
- name: st2auth
65-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
65+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
6666
imagePullPolicy: {{ .Values.image.pullPolicy }}
6767
{{- with .Values.securityContext }}
6868
securityContext: {{- toYaml . | nindent 10 }}
@@ -181,7 +181,7 @@ spec:
181181
{{- end }}
182182
containers:
183183
- name: st2api
184-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2api:{{ tpl (.Values.st2api.image.tag | default .Values.image.tag) . }}'
184+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2api:{{ tpl (.Values.st2api.image.tag | default .Values.image.tag) . }}'
185185
imagePullPolicy: {{ .Values.image.pullPolicy }}
186186
{{- with .Values.securityContext }}
187187
securityContext: {{- toYaml . | nindent 10 }}
@@ -307,7 +307,7 @@ spec:
307307
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
308308
containers:
309309
- name: st2stream
310-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2stream:{{ tpl (.Values.st2stream.image.tag | default .Values.image.tag) . }}'
310+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2stream:{{ tpl (.Values.st2stream.image.tag | default .Values.image.tag) . }}'
311311
imagePullPolicy: {{ .Values.image.pullPolicy }}
312312
{{- with .Values.securityContext }}
313313
securityContext: {{- toYaml . | nindent 10 }}
@@ -407,7 +407,7 @@ spec:
407407
{{- end }}
408408
containers:
409409
- name: st2web
410-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
410+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
411411
imagePullPolicy: {{ .Values.image.pullPolicy }}
412412
{{- with default .Values.securityContext .Values.st2web.securityContext }}
413413
securityContext: {{- toYaml . | nindent 10 }}
@@ -541,7 +541,7 @@ spec:
541541
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
542542
containers:
543543
- name: st2rulesengine
544-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2rulesengine:{{ tpl (.Values.st2rulesengine.image.tag | default .Values.image.tag) . }}'
544+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2rulesengine:{{ tpl (.Values.st2rulesengine.image.tag | default .Values.image.tag) . }}'
545545
imagePullPolicy: {{ .Values.image.pullPolicy }}
546546
{{- with .Values.securityContext }}
547547
securityContext: {{- toYaml . | nindent 10 }}
@@ -658,7 +658,7 @@ spec:
658658
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
659659
containers:
660660
- name: st2timersengine
661-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2timersengine:{{ tpl (.Values.st2timersengine.image.tag | default .Values.image.tag) . }}'
661+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2timersengine:{{ tpl (.Values.st2timersengine.image.tag | default .Values.image.tag) . }}'
662662
imagePullPolicy: {{ .Values.image.pullPolicy }}
663663
{{- with .Values.securityContext }}
664664
securityContext: {{- toYaml . | nindent 10 }}
@@ -762,7 +762,7 @@ spec:
762762
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
763763
containers:
764764
- name: st2workflowengine
765-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2workflowengine:{{ tpl (.Values.st2workflowengine.image.tag | default .Values.image.tag) . }}'
765+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2workflowengine:{{ tpl (.Values.st2workflowengine.image.tag | default .Values.image.tag) . }}'
766766
imagePullPolicy: {{ .Values.image.pullPolicy }}
767767
{{- with .Values.securityContext }}
768768
securityContext: {{- toYaml . | nindent 10 }}
@@ -878,7 +878,7 @@ spec:
878878
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
879879
containers:
880880
- name: st2scheduler
881-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2scheduler:{{ tpl (.Values.st2scheduler.image.tag | default .Values.image.tag) . }}'
881+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2scheduler:{{ tpl (.Values.st2scheduler.image.tag | default .Values.image.tag) . }}'
882882
imagePullPolicy: {{ .Values.image.pullPolicy }}
883883
{{- with .Values.securityContext }}
884884
securityContext: {{- toYaml . | nindent 10 }}
@@ -994,7 +994,7 @@ spec:
994994
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
995995
containers:
996996
- name: st2notifier
997-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2notifier:{{ tpl (.Values.st2notifier.image.tag | default .Values.image.tag) . }}'
997+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2notifier:{{ tpl (.Values.st2notifier.image.tag | default .Values.image.tag) . }}'
998998
imagePullPolicy: {{ .Values.image.pullPolicy }}
999999
{{- with .Values.securityContext }}
10001000
securityContext: {{- toYaml . | nindent 10 }}
@@ -1138,7 +1138,7 @@ spec:
11381138
initContainers:
11391139
{{- if $some_sensors_per_pod }}
11401140
- name: {{ $name }}-init-config
1141-
image: busybox:1.28
1141+
image: '{{ template "stackstorm-ha.imageRegistry" $ }}/library/busybox:1.28'
11421142
volumeMounts:
11431143
- name: st2-sensor-config-vol
11441144
mountPath: /tmp/st2
@@ -1160,7 +1160,7 @@ spec:
11601160
{{- end }}
11611161
containers:
11621162
- name: {{ $name }}
1163-
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
1163+
image: '{{ template "stackstorm-ha.imageRegistry" $ }}/{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
11641164
imagePullPolicy: {{ $.Values.image.pullPolicy }}
11651165
{{- with default $.Values.securityContext $sensor.securityContext }}
11661166
securityContext: {{- toYaml . | nindent 10 }}
@@ -1324,7 +1324,7 @@ spec:
13241324
containers:
13251325
- name: st2actionrunner
13261326
{{- with .Values.st2actionrunner }}
1327-
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1327+
image: '{{ .image.registry | default (include "stackstorm-ha.imageRegistry" $) }}/{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
13281328
{{- end }}
13291329
imagePullPolicy: {{ .Values.st2actionrunner.image.pullPolicy | default .Values.image.pullPolicy }}
13301330
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
@@ -1459,7 +1459,7 @@ spec:
14591459
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
14601460
containers:
14611461
- name: st2garbagecollector
1462-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2garbagecollector:{{ tpl (.Values.st2garbagecollector.image.tag | default .Values.image.tag) . }}'
1462+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2garbagecollector:{{ tpl (.Values.st2garbagecollector.image.tag | default .Values.image.tag) . }}'
14631463
imagePullPolicy: {{ .Values.image.pullPolicy }}
14641464
{{- with .Values.securityContext }}
14651465
securityContext: {{- toYaml . | nindent 10 }}
@@ -1572,7 +1572,7 @@ spec:
15721572
{{- end }}
15731573
# Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
15741574
- name: generate-st2client-config
1575-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
1575+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
15761576
imagePullPolicy: {{ .Values.image.pullPolicy }}
15771577
{{- with .Values.securityContext }}
15781578
securityContext: {{- toYaml . | nindent 10 }}
@@ -1599,7 +1599,7 @@ spec:
15991599
EOT
16001600
containers:
16011601
- name: st2client
1602-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default .Values.image.tag) . }}'
1602+
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default .Values.image.tag) . }}'
16031603
imagePullPolicy: {{ .Values.image.pullPolicy }}
16041604
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
16051605
securityContext: {{- toYaml . | nindent 10 }}
@@ -1749,7 +1749,7 @@ spec:
17491749
containers:
17501750
- name: st2chatops
17511751
{{- with .Values.st2chatops }}
1752-
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2chatops" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1752+
image: '{{ .image.registry | default (include "stackstorm-ha.imageRegistry" $) }}/{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2chatops" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
17531753
{{- end }}
17541754
imagePullPolicy: {{ .Values.st2chatops.image.pullPolicy | default .Values.image.pullPolicy }}
17551755
{{- with .Values.securityContext }}

0 commit comments

Comments
 (0)