Skip to content

Commit e026e79

Browse files
committed
Stop using sh -c to run deployments
With debian (eg. slim) based images, sh will take hold of PID 1, thus preventing signals from being propagated to the intended command. This is not an issue with alpine images. But we want these templates to be agnostic of linux distribution.
1 parent 523aa95 commit e026e79

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

generators/deployments/other.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ spec:
3737
- name: command
3838
image: {{ .Values.image }}
3939
command:
40-
- sh
41-
- c
42-
- {{ .Values.scaling.%{camelName}.command }}
40+
{{- range .Values.deployments.%{camelName}.command | split " " }}
41+
- {{ . | quote }}
42+
{{- end }}
4343
# NOTE: We avoid putting a limit on CPU since Kubernetes throttling kills performance and CPU averages
4444
# tends to be low, so we can allow some pods to burst when needed. Adjust as you see fit.
4545
resources:

generators/deployments/sidekiq.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ spec:
3737
- name: sidekiq
3838
image: {{ .Values.image }}
3939
command:
40-
- sh
41-
- -c
42-
- {{ .Values.deployments.%{camelName}.command | default "bundle exec sidekiq" }}
40+
{{- range .Values.deployments.%{camelName}.command | default "bundle exec sidekiq" | split " " }}
41+
- {{ . | quote }}
42+
{{- end }}
4343
# NOTE: We avoid putting a limit on CPU since Kubernetes throttling kills performance and CPU averages
4444
# tends to be low, so we can allow some pods to burst when needed. Adjust as you see fit.
4545
resources:

generators/deployments/web.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ spec:
4343
- name: web
4444
image: {{ .Values.image }}
4545
command:
46-
- sh
47-
- -c
48-
- {{ .Values.deployments.%{camelName}.command | default "bin/rails server" }}
46+
{{- range .Values.deployments.%{camelName}.command | default "bundle exec rails server" | split " " }}
47+
- {{ . | quote }}
48+
{{- end }}
4949
ports:
5050
- containerPort: {{ $port }}
5151
securityContext:

0 commit comments

Comments
 (0)