Skip to content

Commit

Permalink
feat: Add container lifecycle to the main Minecraft container (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
allanger authored Jun 23, 2023
1 parent c9f601b commit 155c89a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/minecraft/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: minecraft
version: 4.9.0
version: 4.9.1
appVersion: SeeValues
home: https://minecraft.net/
description: Minecraft server
Expand Down
17 changes: 17 additions & 0 deletions charts/minecraft/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,23 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
tty: true
stdin: true
{{- if or (.Values.lifecycle.postStart) (.Values.lifecycle.preStop)}}
lifecycle:
{{- if .Values.lifecycle.postStart }}
postStart:
exec:
command: {{- range .Values.lifecycle.postStart }}
- {{ . }}
{{- end }}
{{- end }}
{{- if .Values.lifecycle.preStop }}
preStop:
exec:
command: {{- range .Values.lifecycle.postStart }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.startupProbe.enabled }}
Expand Down
4 changes: 4 additions & 0 deletions charts/minecraft/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ resources:
memory: 512Mi
cpu: 500m

lifecycle:
postStart: []
preStop: []

# upgrade strategy type (e.g. Recreate or RollingUpdate)
strategyType: Recreate

Expand Down

0 comments on commit 155c89a

Please sign in to comment.