Merge pull request 'helm: make garage.toml bind addresses configurable via values' (#1383) from giottolino/garage:helm-configurable-bind-addrs into main-v2

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1383
This commit is contained in:
maximilien
2026-04-19 22:39:59 +00:00
7 changed files with 28 additions and 14 deletions
+3
View File
@@ -33,11 +33,14 @@ S3-compatible object store for small self-hosted geo-distributed deployments
| 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.replicationFactor | string | `"3"` | Default to 3 replicas, see the replication_factor section at https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#replication_factor |
| 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.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.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"` | |
| garage.rpcBindAddr | string | `"[::]:3901"` | | | garage.rpcBindAddr | string | `"[::]:3901"` | |
| garage.rpcSecret | string | `""` | If not given, a random secret will be generated and stored in a Secret object | | garage.rpcSecret | string | `""` | If not given, a random secret will be generated and stored in a Secret object |
| garage.s3.api.bindAddr | string | `"[::]:3900"` | |
| garage.s3.api.region | string | `"garage"` | | | garage.s3.api.region | string | `"garage"` | |
| garage.s3.api.rootDomain | string | `".s3.garage.tld"` | | | garage.s3.api.rootDomain | string | `".s3.garage.tld"` | |
| garage.s3.web.index | string | `"index.html"` | | | garage.s3.web.index | string | `"index.html"` | |
| garage.s3.web.bindAddr | string | `"[::]:3902"` | |
| garage.s3.web.rootDomain | string | `".web.garage.tld"` | | | garage.s3.web.rootDomain | string | `".web.garage.tld"` | |
| image.pullPolicy | string | `"IfNotPresent"` | | | image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"dxflrs/amd64_garage"` | default to amd64 docker image | | image.repository | string | `"dxflrs/amd64_garage"` | default to amd64 docker image |
@@ -71,6 +71,13 @@ Create the name of the service account to use
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Extract the trailing port number from a bind address like [::]:3900 or 0.0.0.0:3900.
*/}}
{{- define "garage.portFromBindAddr" -}}
{{- regexFind "[0-9]+$" . -}}
{{- end }}
{{/* {{/*
Returns given number of random Hex characters. Returns given number of random Hex characters.
In practice, it generates up to 100 randAlphaNum strings In practice, it generates up to 100 randAlphaNum strings
+3 -3
View File
@@ -45,16 +45,16 @@ data:
[s3_api] [s3_api]
s3_region = "{{ .Values.garage.s3.api.region }}" s3_region = "{{ .Values.garage.s3.api.region }}"
api_bind_addr = "[::]:3900" api_bind_addr = "{{ .Values.garage.s3.api.bindAddr }}"
root_domain = "{{ .Values.garage.s3.api.rootDomain }}" root_domain = "{{ .Values.garage.s3.api.rootDomain }}"
[s3_web] [s3_web]
bind_addr = "[::]:3902" bind_addr = "{{ .Values.garage.s3.web.bindAddr }}"
root_domain = "{{ .Values.garage.s3.web.rootDomain }}" root_domain = "{{ .Values.garage.s3.web.rootDomain }}"
index = "{{ .Values.garage.s3.web.index }}" index = "{{ .Values.garage.s3.web.index }}"
[admin] [admin]
api_bind_addr = "[::]:3903" api_bind_addr = "{{ .Values.garage.admin.apiBindAddr }}"
{{- if .Values.monitoring.tracing.sink }} {{- if .Values.monitoring.tracing.sink }}
trace_sink = "{{ .Values.monitoring.tracing.sink }}" trace_sink = "{{ .Values.monitoring.tracing.sink }}"
{{- end }} {{- end }}
@@ -10,11 +10,11 @@ spec:
clusterIP: None clusterIP: None
ports: ports:
- port: {{ .Values.service.s3.api.port }} - port: {{ .Values.service.s3.api.port }}
targetPort: 3900 targetPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.api.bindAddr | int }}
protocol: TCP protocol: TCP
name: s3-api name: s3-api
- port: {{ .Values.service.s3.web.port }} - port: {{ .Values.service.s3.web.port }}
targetPort: 3902 targetPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.web.bindAddr | int }}
protocol: TCP protocol: TCP
name: s3-web name: s3-web
selector: selector:
+4 -4
View File
@@ -12,11 +12,11 @@ spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
- port: {{ .Values.service.s3.api.port }} - port: {{ .Values.service.s3.api.port }}
targetPort: 3900 targetPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.api.bindAddr | int }}
protocol: TCP protocol: TCP
name: s3-api name: s3-api
- port: {{ .Values.service.s3.web.port }} - port: {{ .Values.service.s3.web.port }}
targetPort: 3902 targetPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.web.bindAddr | int }}
protocol: TCP protocol: TCP
name: s3-web name: s3-web
selector: selector:
@@ -35,8 +35,8 @@ spec:
type: ClusterIP type: ClusterIP
clusterIP: None clusterIP: None
ports: ports:
- port: 3903 - port: {{ include "garage.portFromBindAddr" .Values.garage.admin.apiBindAddr | int }}
targetPort: 3903 targetPort: {{ include "garage.portFromBindAddr" .Values.garage.admin.apiBindAddr | int }}
protocol: TCP protocol: TCP
name: metrics name: metrics
selector: selector:
+3 -3
View File
@@ -60,11 +60,11 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- containerPort: 3900 - containerPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.api.bindAddr | int }}
name: s3-api name: s3-api
- containerPort: 3902 - containerPort: {{ include "garage.portFromBindAddr" .Values.garage.s3.web.bindAddr | int }}
name: web-api name: web-api
- containerPort: 3903 - containerPort: {{ include "garage.portFromBindAddr" .Values.garage.admin.apiBindAddr | int }}
name: admin name: admin
{{- with .Values.environment }} {{- with .Values.environment }}
env: env:
+6 -2
View File
@@ -48,11 +48,15 @@ garage:
kubernetesSkipCrd: false kubernetesSkipCrd: false
s3: s3:
api: api:
bindAddr: "[::]:3900"
region: "garage" region: "garage"
rootDomain: ".s3.garage.tld" rootDomain: ".s3.garage.tld"
web: web:
bindAddr: "[::]:3902"
rootDomain: ".web.garage.tld" rootDomain: ".web.garage.tld"
index: "index.html" index: "index.html"
admin:
apiBindAddr: "[::]:3903"
# -- Additional configuration to append to garage.toml. Use a multi-line string for custom config. # -- Additional configuration to append to garage.toml. Use a multi-line string for custom config.
# Example: # Example:
@@ -221,14 +225,14 @@ resources: {}
livenessProbe: {} livenessProbe: {}
#httpGet: #httpGet:
# path: /health # path: /health
# port: 3903 # port: 3903 # or the port from garage.admin.apiBindAddr
#initialDelaySeconds: 5 #initialDelaySeconds: 5
#periodSeconds: 30 #periodSeconds: 30
# -- Specifies a readinessProbe # -- Specifies a readinessProbe
readinessProbe: {} readinessProbe: {}
#httpGet: #httpGet:
# path: /health # path: /health
# port: 3903 # port: 3903 # or the port from garage.admin.apiBindAddr
#initialDelaySeconds: 5 #initialDelaySeconds: 5
#periodSeconds: 30 #periodSeconds: 30