Add garage.singleNode paramter

This commit is contained in:
Kirill Kamakin
2026-06-11 20:12:41 +02:00
committed by maximilien
parent b69cfcb857
commit 4d83477bb6
5 changed files with 31 additions and 4 deletions
+16 -1
View File
@@ -33,12 +33,27 @@ kubectl apply -k ../k8s/crd
helm install --create-namespace --namespace garage garage ./garage -f values.override.yaml
```
After deploying, cluster layout must be configured manually as described in [Creating a cluster layout](@/documentation/quick-start/_index.md#creating-a-cluster-layout). Use the following command to access garage CLI:
For multi-node deployments, cluster layout must be configured manually after deploying, as described in [Creating a cluster layout](@/documentation/quick-start/_index.md#creating-a-cluster-layout). Use the following command to access garage CLI:
```bash
kubectl exec --stdin --tty -n garage garage-0 -- ./garage status
```
## Single-node deployments
For a fresh single-node deployment, enable Garage's automatic single-node setup:
```yaml
garage:
singleNode: true
```
With the chart-generated `garage.toml`, this starts Garage with `--single-node`, runs one StatefulSet replica, and sets `replication_factor = 1`.
If you use `garage.garageTomlString` or `garage.existingConfigMap`, the chart cannot update your configuration file. In that case, make sure your Garage configuration sets `replication_factor = 1`; otherwise Garage will refuse to start in single-node mode.
Garage refuses to run with `--single-node` if the cluster already has a multi-node layout, so this option is intended for new single-node deployments.
## Overriding default values
All possible configuration values can be found with:
+1
View File
@@ -31,6 +31,7 @@ S3-compatible object store for small self-hosted geo-distributed deployments
| garage.garageTomlString | string | `""` | String Template for the garage configuration if set, ignores above values. Values can be templated, see https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/ |
| garage.kubernetesSkipCrd | bool | `false` | Set to true if you want to use k8s discovery but install the CRDs manually outside of the helm chart, for example if you operate at namespace level without cluster resources |
| garage.replicationFactor | string | `"3"` | Default to 3 replicas, see the replication_factor section at https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#replication_factor |
| garage.singleNode | bool | `false` | Start Garage with --single-node, run one StatefulSet replica, and render replication_factor = 1 in the generated garage.toml. If using garageTomlString or existingConfigMap, set replication_factor = 1 yourself. |
| garage.consistencyMode | string | `"consistent"` | Default to read-after-write consistency, see the consistency_mode section at https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#consistency_mode |
| garage.metadataAutoSnapshotInterval | string | `""` | If this value is set, Garage will automatically take a snapshot of the metadata DB file at a regular interval and save it in the metadata directory. https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#metadata_auto_snapshot_interval |
| garage.admin.apiBindAddr | string | `"[::]:3903"` | |
+1 -1
View File
@@ -15,7 +15,7 @@ data:
block_size = "{{ .Values.garage.blockSize }}"
replication_factor = {{ .Values.garage.replicationFactor }}
replication_factor = {{ ternary 1 .Values.garage.replicationFactor .Values.garage.singleNode }}
consistency_mode = "{{ .Values.garage.consistencyMode }}"
compression_level = {{ .Values.garage.compressionLevel }}
+8 -1
View File
@@ -9,7 +9,7 @@ spec:
matchLabels:
{{- include "garage.selectorLabels" . | nindent 6 }}
{{- if eq .Values.deployment.kind "StatefulSet" }}
replicas: {{ .Values.deployment.replicaCount }}
replicas: {{ ternary 1 .Values.deployment.replicaCount .Values.garage.singleNode }}
serviceName: {{ include "garage.fullname" . }}-headless
podManagementPolicy: {{ .Values.deployment.podManagementPolicy }}
{{- end }}
@@ -59,6 +59,13 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.garage.singleNode }}
command:
- /garage
args:
- server
- --single-node
{{- end }}
ports:
- containerPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.api.bindAddr | int }}
name: s3-api
+5 -1
View File
@@ -7,7 +7,7 @@ commonLabels: {}
# app.kubernetes.io/part-of: storage
# team: platform
# Garage configuration. These values go to garage.toml
# Garage configuration. These values configure Garage and render to garage.toml unless noted otherwise.
garage:
# -- Can be changed for better performance on certain systems
# https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#db_engine
@@ -22,6 +22,10 @@ garage:
# https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#replication_factor
replicationFactor: "3"
# -- Start Garage with --single-node, run one StatefulSet replica, and render replication_factor = 1 in the generated garage.toml.
# If using garageTomlString or existingConfigMap, set replication_factor = 1 yourself.
singleNode: false
# -- By default, enable read-after-write consistency guarantees, see the consistency_mode section at
# https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#consistency_mode
consistencyMode: "consistent"