Generic sidecar support

This commit is contained in:
Laszlo Fogas
2021-04-12 09:28:53 +02:00
parent 6acf4ec41f
commit ee15631900
3 changed files with 11 additions and 13 deletions
+7 -5
View File
@@ -90,14 +90,16 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.debugSidecarEnabled }}
- name: {{ template "robustName" .Release.Name }}-debug
{{- if .Values.sidecar }}
- name: {{ template "robustName" .Release.Name }}-sidecar
securityContext: *securityContext
image: {{ .Values.debugSidecar.image }}
image: {{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }}
{{- if .Values.sidecar.command }}
command:
- {{ .Values.debugSidecar.shell }}
- {{ .Values.sidecar.shell }}
- -c
- {{ .Values.debugSidecar.command | quote }}
- {{ .Values.sidecar.command | quote }}
{{- end }}
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
envFrom: *envFrom
{{- end }}
@@ -3,9 +3,11 @@ templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should add a debug sidecar
- it: Should inject a sidecar if one is specified
set:
debugSidecarEnabled: true
sidecar:
repository: debian
tag: stable-slim
asserts:
- equal:
path: spec.template.spec.containers[1].image
-6
View File
@@ -44,12 +44,6 @@ secretEnabled: false
shell: "/bin/sh"
debugSidecarEnabled: false
debugSidecar:
image: debian:stable-slim
shell: "/bin/bash"
command: "while true; do sleep 30; done;"
podDisruptionBudgetEnabled: true
spreadAcrossNodes: false