Skip to content

Commit 8c5e92e

Browse files
committed
gfxvcshdfghdfgh
1 parent 77ccbb4 commit 8c5e92e

3 files changed

Lines changed: 85 additions & 12 deletions

File tree

my-apps/media/garage/garage.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ compression_level = 1
1010
rpc_bind_addr = "[::]:3901"
1111
rpc_secret_file = "/mnt/meta/rpc-secret"
1212

13+
# Peers discovery - StatefulSet DNS names
14+
bootstrap_peers = [
15+
"garage-0.garage-rpc.garage.svc.cluster.local:3901",
16+
"garage-1.garage-rpc.garage.svc.cluster.local:3901",
17+
"garage-2.garage-rpc.garage.svc.cluster.local:3901",
18+
]
19+
1320
[s3_api]
1421
s3_region = "garage"
1522
api_bind_addr = "[::]:3900"

my-apps/media/garage/init-job.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: garage-init
6+
namespace: garage
7+
annotations:
8+
argocd.argoproj.io/hook: PostSync
9+
argocd.argoproj.io/hook-delete-policy: HookSucceeded
10+
spec:
11+
ttlSecondsAfterFinished: 300
12+
template:
13+
spec:
14+
restartPolicy: OnFailure
15+
serviceAccountName: garage
16+
containers:
17+
- name: init-cluster
18+
image: dxflrs/garage:v1.0.0
19+
command:
20+
- /bin/sh
21+
- -c
22+
- |
23+
set -e
24+
echo "Waiting for Garage nodes to be ready..."
25+
sleep 30
26+
27+
# Get list of nodes
28+
NODES=$(/garage status -f json | jq -r '.nodes[] | select(.role == null) | .id' || true)
29+
30+
if [ -z "$NODES" ]; then
31+
echo "All nodes already have roles assigned or no nodes found"
32+
/garage status
33+
exit 0
34+
fi
35+
36+
echo "Found unassigned nodes, configuring layout..."
37+
38+
# Assign capacity to each node (100GB each)
39+
for NODE_ID in $NODES; do
40+
echo "Assigning capacity to node $NODE_ID"
41+
/garage layout assign $NODE_ID -z dc1 -c 100G
42+
done
43+
44+
# Apply the layout
45+
echo "Applying layout configuration..."
46+
/garage layout apply --version 1
47+
48+
echo "Garage cluster initialized successfully!"
49+
/garage status
50+
env:
51+
- name: GARAGE_RPC_SECRET_FILE
52+
value: /mnt/meta/rpc-secret
53+
volumeMounts:
54+
- name: meta
55+
mountPath: /mnt/meta
56+
- name: config
57+
mountPath: /etc/garage.toml
58+
subPath: garage.toml
59+
volumes:
60+
- name: meta
61+
persistentVolumeClaim:
62+
claimName: meta-garage-0
63+
- name: config
64+
configMap:
65+
name: garage-config

my-apps/media/garage/kustomization.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
namespace: garage
44

5-
commonLabels:
6-
app: garage
7-
app.kubernetes.io/name: garage
8-
app.kubernetes.io/component: storage
5+
labels:
6+
- pairs:
7+
app: garage
8+
app.kubernetes.io/name: garage
9+
app.kubernetes.io/component: storage
910

1011
resources:
1112
- namespace.yaml
13+
- rbac.yaml
14+
- statefulset.yaml
15+
- service.yaml
1216
- httproute.yaml
17+
- init-job.yaml
1318

14-
helmCharts:
15-
- name: garage
16-
repo: https://git.deuxfleurs.fr/api/packages/Deuxfleurs/helm
17-
version: 1.0.0
18-
releaseName: garage
19-
namespace: garage
20-
valuesFile: values.yaml
21-
includeCRDs: false
19+
configMapGenerator:
20+
- name: garage-config
21+
files:
22+
- garage.toml

0 commit comments

Comments
 (0)