mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-10-13 06:09:16 +00:00
Fix garage container command and drop postStart layout hook
The dxflrs/garage image ships as a single static binary with no ENTRYPOINT and no shell, so `args: [server]` alone was exec'd as the command (crash loop) and the shell-based postStart layout-bootstrap hook could never run. Set command: [/garage] explicitly, and replace the automated hook with documented one-time `kubectl exec` steps. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ZA4cJygj4VPCYVms4TDrH
This commit is contained in:
@@ -24,6 +24,8 @@ spec:
|
||||
- name: garage
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command:
|
||||
- /garage
|
||||
args:
|
||||
- server
|
||||
env:
|
||||
@@ -51,28 +53,6 @@ spec:
|
||||
mountPath: /var/lib/garage/data
|
||||
- name: meta
|
||||
mountPath: /var/lib/garage/meta
|
||||
{{- if .Values.layoutJob.enabled }}
|
||||
lifecycle:
|
||||
postStart:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
NODE_ID=""
|
||||
for i in $(seq 1 60); do
|
||||
NODE_ID=$(/garage node id -q 2>/dev/null | cut -d@ -f1)
|
||||
[ -n "$NODE_ID" ] && break
|
||||
sleep 2
|
||||
done
|
||||
[ -z "$NODE_ID" ] && exit 0
|
||||
if /garage layout show 2>/dev/null | grep -q "$NODE_ID"; then
|
||||
exit 0
|
||||
fi
|
||||
/garage layout assign -z {{ .Values.garage.zone }} -c {{ .Values.garage.capacity }} "$NODE_ID"
|
||||
VERSION=$(/garage layout show 2>/dev/null | grep -o 'version [0-9]*' | tail -1 | awk '{print $2+1}')
|
||||
/garage layout apply --version "${VERSION:-1}" || true
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: s3-api
|
||||
|
||||
Reference in New Issue
Block a user