Files
homelab/infra/kubernetes/platform/garage/statefulset.yaml
Julia McGhee 9d11765405
All checks were successful
CI / lint-and-test (push) Successful in 35s
Deploy Production / deploy (push) Successful in 31s
CI / build (push) Successful in 33s
Fix Garage config: use top-level rpc fields, template admin_token
Garage v1.0.x uses top-level rpc_bind_addr/rpc_secret, not a [rpc]
section. Also template admin_token into [admin] from the sealed secret.
2026-03-22 09:42:26 +00:00

105 lines
2.6 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: garage
namespace: platform
labels:
app: garage
spec:
serviceName: garage
replicas: 1
selector:
matchLabels:
app: garage
template:
metadata:
labels:
app: garage
spec:
initContainers:
- name: config
image: busybox:1.37
command: ["sh", "-c"]
args:
- |
sed -e "s/RPC_SECRET_PLACEHOLDER/$RPC_SECRET/" \
-e "s/ADMIN_TOKEN_PLACEHOLDER/$ADMIN_TOKEN/" \
/config-tmpl/garage.toml > /config/garage.toml
env:
- name: RPC_SECRET
valueFrom:
secretKeyRef:
name: garage-credentials
key: rpc-secret
- name: ADMIN_TOKEN
valueFrom:
secretKeyRef:
name: garage-credentials
key: admin-token
volumeMounts:
- name: config-tmpl
mountPath: /config-tmpl
- name: config
mountPath: /config
containers:
- name: garage
image: dxflrs/garage:v1.0.1
ports:
- containerPort: 3900
name: s3-api
- containerPort: 3901
name: rpc
- containerPort: 3902
name: web
- containerPort: 3903
name: admin
resources:
requests:
memory: 256Mi
cpu: 100m
limits:
memory: 512Mi
volumeMounts:
- name: config
mountPath: /etc/garage.toml
subPath: garage.toml
- name: meta
mountPath: /mnt/meta
- name: data
mountPath: /mnt/data
readinessProbe:
httpGet:
path: /health
port: 3903
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 3903
initialDelaySeconds: 15
periodSeconds: 20
volumes:
- name: config-tmpl
configMap:
name: garage-config
- name: config
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: meta
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: longhorn-nvme
resources:
requests:
storage: 1Gi
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: longhorn
resources:
requests:
storage: 20Gi