From e4f8abadd787b4d21c0e7c6be86f032cd297e62f Mon Sep 17 00:00:00 2001 From: Florian Weber <2+f.weber@noreply.git.morlana.online> Date: Wed, 12 Aug 2026 09:46:27 +0000 Subject: [PATCH] Add Operations --- Operations.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Operations.md diff --git a/Operations.md b/Operations.md new file mode 100644 index 0000000..5b7ae81 --- /dev/null +++ b/Operations.md @@ -0,0 +1,51 @@ +# Operations + +## Growing storage (Helm) + +Changing `persistence.size`/`persistence.storageClass` on an already-installed +StatefulSet makes `helm upgrade` fail with *"updates to statefulset spec for fields +other than replicas, template, and updateStrategy are forbidden"* — Kubernetes +forbids changing `volumeClaimTemplates` after the fact. + +**So, from the start, for production:** set `persistence.existingClaim: `. +Then no `volumeClaimTemplate` exists at all, and resizing is a plain PVC edit +(`kubectl patch pvc ... -p '{"spec":{"resources":{"requests":{"storage":"100Gi"}}}}'`, +as long as the StorageClass has `allowVolumeExpansion: true`). + +If you're stuck with a chart-generated PVC anyway: + +```bash +kubectl delete statefulset -aptly --cascade=orphan # PVC survives +# adjust persistence.size in values.yaml +helm upgrade oci://git.morlana.online/f.weber/aptly ... +``` + +The PVC itself always survives `helm uninstall` regardless (StatefulSet PVCs are +never Helm-managed) — `helm.sh/resource-policy: keep` is neither needed nor +applicable here. + +## Backup & restore (Compose) + +```bash +docker compose --profile backup run --rm backup +# writes /backup/aptly-.tar.zst (without .gnupg) +``` + +Restore: stop the container, restore the `tar` into the `aptly_data` volume, provide +the GPG key again via `config/gpg/` (the private key is deliberately NOT included in +the backup — it only ever lives in `GNUPGHOME`/Secrets, never on the data volume). + +## GPG key rotation + +`GNUPGHOME` lives on an **in-memory** volume in both Compose and the Helm chart +(`tmpfs`/`emptyDir: {medium: Memory}`), which is repopulated from the configured +Secret on every start. Rotation is therefore simple: + +- **Compose:** drop new key files under `compose/config/gpg/`, then + `docker compose restart aptly-init aptly` (or `up -d` again). +- **Helm:** update the referenced Secret, then + `kubectl rollout restart statefulset/-aptly`. + +A key removed from the configuration actually disappears — nothing is left behind on +a PersistentVolume. +