Generic sidecar support
This commit is contained in:
@@ -90,14 +90,16 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- if .Values.debugSidecarEnabled }}
|
{{- if .Values.sidecar }}
|
||||||
- name: {{ template "robustName" .Release.Name }}-debug
|
- name: {{ template "robustName" .Release.Name }}-sidecar
|
||||||
securityContext: *securityContext
|
securityContext: *securityContext
|
||||||
image: {{ .Values.debugSidecar.image }}
|
image: {{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }}
|
||||||
|
{{- if .Values.sidecar.command }}
|
||||||
command:
|
command:
|
||||||
- {{ .Values.debugSidecar.shell }}
|
- {{ .Values.sidecar.shell }}
|
||||||
- -c
|
- -c
|
||||||
- {{ .Values.debugSidecar.command | quote }}
|
- {{ .Values.sidecar.command | quote }}
|
||||||
|
{{- end }}
|
||||||
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
|
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
|
||||||
envFrom: *envFrom
|
envFrom: *envFrom
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
+4
-2
@@ -3,9 +3,11 @@ templates:
|
|||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- configmap.yaml
|
- configmap.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: Should add a debug sidecar
|
- it: Should inject a sidecar if one is specified
|
||||||
set:
|
set:
|
||||||
debugSidecarEnabled: true
|
sidecar:
|
||||||
|
repository: debian
|
||||||
|
tag: stable-slim
|
||||||
asserts:
|
asserts:
|
||||||
- equal:
|
- equal:
|
||||||
path: spec.template.spec.containers[1].image
|
path: spec.template.spec.containers[1].image
|
||||||
@@ -44,12 +44,6 @@ secretEnabled: false
|
|||||||
|
|
||||||
shell: "/bin/sh"
|
shell: "/bin/sh"
|
||||||
|
|
||||||
debugSidecarEnabled: false
|
|
||||||
debugSidecar:
|
|
||||||
image: debian:stable-slim
|
|
||||||
shell: "/bin/bash"
|
|
||||||
command: "while true; do sleep 30; done;"
|
|
||||||
|
|
||||||
podDisruptionBudgetEnabled: true
|
podDisruptionBudgetEnabled: true
|
||||||
spreadAcrossNodes: false
|
spreadAcrossNodes: false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user