Files
jklein 79b7e44fdc
Validate Helm Charts / Detect changed charts (pull_request) Successful in 3s
Validate Helm Charts / Resource quantities (pull_request) Successful in 11s
Validate Helm Charts / Build garage (pull_request) Successful in 6s
Validate Helm Charts / Trivy config garage (pull_request) Successful in 16s
Install-test / Install-test garage (pull_request) Successful in 1m15s
Validate Helm Charts / Install-test (pull_request) Successful in 1m15s
feat(garage): new chart for the Garage object store
One Garage node with replication_factor = 1, built from template-chart to the
style guide rather than copied from upstream's in-tree chart (Gitea #81). The
single-node trade is deliberate and its price is named at the value: the factor
applies to the metadata as well, where upstream calls a corrupted database
"generally not recoverable" and a replicated volume replicates the corruption
faithfully. The three countermeasures that work at factor 1 are therefore
mandatory, not optional - metadata_fsync = true (off in Garage's defaults), the
automatic metadata snapshots, and those snapshots on a second PVC.

Storage: PVC 1 carries metadata_dir AND data_dir as two subdirectories, because
volume snapshots are atomic per volume and that is what keeps index and blocks
consistent with each other; PVC 2 carries metadata_snapshots_dir, because a
recovery point must not die with the volume whose corruption it should repair.
Garage creates all three directories itself, which matters because the image is
FROM scratch and has no mkdir.

Two corrections to the approved plan, both verified against the source at tag
v2.4.1 and decided on the issue before implementation:

- The RPC secret arrives as GARAGE_RPC_SECRET via secretKeyRef, not through
  rpc_secret_file. The file form cannot work in a non-root pod:
  read_secret_file rejects any mode with a group or other bit set
  (src/garage/secrets.rs:144, mask 0o077) while the kubelet OR-s the group-read
  bit onto every file of a secret volume once fsGroup is set
  (pkg/volume/volume_linux.go), and Kubernetes can set the group of such a file
  but never its owner. The mechanism is documented at the value so the next
  round does not "fix" it back.
- The first start is done by the server, not by hand: garage server
  --single-node creates the layout in-process before any listener opens, is
  idempotent on the layout version and has no --version argument that could be
  reused, and --default-access-key/--default-bucket import key and bucket FROM
  the vault item. Both premises of the original "manual first start" decision
  fell with that.

Probes follow from the same source reading: readiness is GET /health on the
admin port, which answers 503 while no layout exists; liveness and startup are
a TCP connect, because a probe that can only fail would restart a node waiting
for its layout forever (same lesson as zipline, README 12.3). The S3 listener
binds independently of the layout, so a TCP probe on 3900 would have been the
lie the plan warned about.

CI: fixtures under ci/garage/ rather than an exclusion - with --single-node the
pod reaches Ready on its own, which makes the install-test an assertion about
the layout, the one-PVC subdirectory layout and readOnlyRootFilesystem instead
of a formality. The Renovate block carries a regex versioning anchored to
^v<major>.<minor>.<patch>$, because the registry receives 40-character
commit-SHA tags almost daily (measured 2026-10-03: the newest 22 tags are all
of that kind) and the four v1.99.x-internal builds sort above the v1.3.x line.

Part of #81
2026-10-03 20:29:38 +00:00

64 lines
2.5 KiB
YAML

{{- /*
TWO claims, and the split is the durability design of this chart rather than a
sizing convenience (Gitea #81):
1. <release>-garage-pvc metadata_dir AND data_dir, as two
subdirectories of this one volume
2. <release>-garage-snapshots-pvc metadata_snapshots_dir
Claim 1 keeps index and blocks on ONE volume because Longhorn snapshots are
atomic per volume and never across volumes. Split over two volumes, a backup
can capture metadata that points at objects whose blocks were not written yet -
for a mail store exactly the failure "the mailbox lists a message whose body is
missing".
Claim 2 exists because Garage's own metadata snapshots are the only consistent
recovery point here (file-system snapshots of a live metadata database are not
one), and a recovery point stored on the volume whose corruption it should
repair is not a recovery point.
Both blocks are DELIBERATELY NOT null-safe: an erased size yields an invalid
PVC that is rejected at apply time, which is loud. A chart-side fallback would
silently size somebody's object store - and on an existing release it could not
help anyway, because a PVC cannot shrink. Same reasoning as satisfactory's
documented exception (Gitea #39) and valkey's persistence block.
Neither claim is ever renamed: a renamed PVC makes Kubernetes provision a new,
empty volume and orphans the data.
*/ -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-pvc
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.storage.data.amount }}
{{- if .Values.storage.data.storageClass }}
storageClassName: {{ .Values.storage.data.storageClass }}
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-snapshots-pvc
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
# Sized for TWO snapshots of the metadata database plus head room, not
# for the objects - Garage keeps exactly two and deletes the older ones
# itself. A snapshot is a compacted copy of the LMDB file, so this needs
# roughly twice the size metadata_dir reaches.
storage: {{ .Values.storage.snapshots.amount }}
{{- if .Values.storage.snapshots.storageClass }}
storageClassName: {{ .Values.storage.snapshots.storageClass }}
{{- end }}