Debug toolbox in a sidecar container
This commit is contained in:
@@ -15,4 +15,4 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
|
||||
@@ -28,17 +28,17 @@ spec:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Release.Name }}
|
||||
securityContext:
|
||||
securityContext: &securityContext
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }} &imagePullPolicy
|
||||
{{- if .Values.command }}
|
||||
command:
|
||||
- {{ .Values.shell }}
|
||||
- -c
|
||||
- {{ .Values.command | quote }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
envFrom: &envFrom
|
||||
{{- if .Values.vars }}
|
||||
- configMapRef:
|
||||
name: {{ .Release.Name }}
|
||||
@@ -66,7 +66,7 @@ spec:
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 10
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
volumeMounts: &volumeMounts
|
||||
{{- range .Values.volumes }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .path }}
|
||||
@@ -78,6 +78,18 @@ spec:
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- if .Values.debugSidecarEnabled }}
|
||||
- name: {{ .Release.Name }}-debug
|
||||
securityContext: *securityContext
|
||||
image: {{ .Values.debugSidecar.image }}
|
||||
imagePullPolicy: *imagePullPolicy
|
||||
command:
|
||||
- {{ .Values.debugSidecar.shell }}
|
||||
- -c
|
||||
- {{ .Values.debugSidecar.command | quote }}
|
||||
envFrom: *envFrom
|
||||
volumeMounts: *volumeMounts
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- range .Values.volumes }}
|
||||
- name: {{ .name }}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
suite: test deployment
|
||||
templates:
|
||||
- deployment.yaml
|
||||
- configmap.yaml
|
||||
tests:
|
||||
- it: Should add a debug sidecar
|
||||
set:
|
||||
debugSidecarEnabled: true
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[1].image
|
||||
value: debian:stable-slim
|
||||
@@ -38,3 +38,9 @@ secret:
|
||||
enabled: false
|
||||
|
||||
shell: "/bin/sh"
|
||||
|
||||
debugSidecarEnabled: false
|
||||
debugSidecar:
|
||||
image: debian:stable-slim
|
||||
shell: "/bin/bash"
|
||||
command: "while true; do sleep 30; done;"
|
||||
|
||||
Reference in New Issue
Block a user