Skip to content

Commit

Permalink
add initContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Karsten Kraus authored and Karsten Kraus committed Mar 28, 2024
1 parent 0a9c7a2 commit 95c2f12
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/vault-raft-snapshot-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: vault-raft-snapshot-agent
type: application
version: 0.4.12
version: 0.4.13
appVersion: "v0.10.10"
description: Vault Raft Snapshot Agent takes periodic snapshots of Vault's Raft database and stores them on a local volume or an remote S3 bucket
keywords:
Expand Down
21 changes: 21 additions & 0 deletions charts/vault-raft-snapshot-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ spec:
readOnly: {{ $volume.readOnly }}
{{- end }}
{{- end }}
{{ with .Values.deployment.initContainer }}
initContainers:
- name: {{ .name | default "Initialize Agent" }}
image: {{ .image | default "alpine:3.19.1" }}
{{- with .command }}
command: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .env }}
env: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with $.Values.deployment.extraVolumes }}
volumeMounts:
{{- range $volume := $.Values.deployment.extraVolumes }}
- mountPath: {{ required "volume mountPath is required" $volume.mountPath }}
name: {{ required "volume name is required" $volume.name }}
{{- with $volume.readOnly }}
readOnly: {{ $volume.readOnly }}
{{- end }}
{{- end}}
{{- end }}
{{- end }}
volumes:
- name: config
configMap:
Expand Down
4 changes: 4 additions & 0 deletions charts/vault-raft-snapshot-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ deployment:
# `.Chart.AppVersion` of this chart thus must only be changed
# if you use another repository than the default
pullPolicy: IfNotPresent
# -- specify optional init-container. Only properties `name`, `image`, `command` and `env` are used.
# `name` and `image` are optional, by default alpine:3.19.1, which is the agents-base-image, is used as image
# The init-container has access to all extraVolumes.
initContainer: {}
# -- (int) see [kubernetes docs](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy)
# You might want to change this to a small value to avoid cluttering up the
# UI of a Continuous Delivery Tool like Argo-CD
Expand Down

0 comments on commit 95c2f12

Please sign in to comment.