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 }} {{- 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 }}
@@ -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
-6
View File
@@ -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