feat: add persistence.hostPath to Helm chart

This commit is contained in:
shoce
2026-03-13 02:37:31 +07:00
parent a1f9d86698
commit 755029db26
4 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v2
name: versitygw
description: A Helm chart for deploying the Versity S3 Gateway on Kubernetes
type: application
version: 0.3.0
version: 0.3.1
sources:
- https://github.com/versity/versitygw
icon: https://raw.githubusercontent.com/versity/versitygw/main/webui/web/assets/images/Versity-logo-blue-horizontal.png
+2 -2
View File
@@ -84,12 +84,12 @@ The `gateway.backend.type` value selects the storage backend. Use `gateway.backe
| **Admin API** | `admin.enabled=true` — exposes a separate management API on `admin.port` (default `7071`) |
| **WebUI** | `webui.enabled=true` — browser-based management UI on `webui.port` (default `8080`); set `webui.apiGateways` and `webui.adminGateways` to your externally reachable endpoints |
| **IAM** | `iam.enabled=true` — flat-file identity and access management stored alongside backend data |
| **Persistence** | `persistence.enabled=true` — provisions a PVC for backend data and IAM storage; defaults to `10Gi` |
| **Persistence** | `persistence.enabled=true` — provisions a PVC for backend data and IAM storage; defaults to `10Gi`, or uses a hostPath volume specified by `persistence.hostPath` |
| **NetworkPolicy** | `networkPolicy.enabled=true` — restricts ingress to selected pods/namespaces; allows all egress |
## Scaling and Persistence
By default, this chart enables persistence via a `PersistentVolumeClaim` (PVC) to ensure data consistency and prevent data loss.
By default, this chart enables persistence via a `PersistentVolumeClaim` (PVC) to ensure data consistency and prevent data loss. To use a hostPath volume set `persistence.hostPath`.
### Horizontal Scaling (replicas > 1)
+14 -2
View File
@@ -4,8 +4,14 @@
{{- fail "Multiple replicas with POSIX backend or Internal IAM require persistence.enabled=true to prevent data loss and inconsistency across pods. If using a stateless backend (e.g. S3, Azure) and external IAM, set persistence.enabled=false." }}
{{- end }}
{{- end }}
{{- if and .Values.persistence.enabled (not .Values.persistence.create) (not .Values.persistence.claimName) }}
{{- fail "persistence.claimName is required when persistence.create is false" }}
{{- if and .Values.persistence.enabled (not .Values.persistence.create) (not .Values.persistence.claimName) (not .Values.persistence.hostPath) }}
{{- fail "persistence.claimName or persistence.hostPath is required when persistence.create is false" }}
{{- end }}
{{- if and .Values.persistence.claimName .Values.persistence.hostPath }}
{{- fail "only persistence.claimName or persistence.hostPath can be set" }}
{{- end }}
{{- if and .Values.persistence.create .Values.persistence.hostPath }}
{{- fail "persistence.create must be false for persistence.hostPath can be set" }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
@@ -195,8 +201,14 @@ spec:
volumes:
- name: data
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.hostPath }}
hostPath:
path: {{ .Values.persistence.hostPath }}
type: DirectoryOrCreate
{{- else }}
persistentVolumeClaim:
claimName: {{ include "versitygw.pvcName" . }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
+2
View File
@@ -288,6 +288,8 @@ persistence:
claimName: ""
size: 10Gi
storageClassName: ""
# If set then use a hostPath volume, needs `persistence.create=false`
hostPath: ""
# Access mode for the PVC. Use ReadWriteMany for multi-replica deployments.
accessMode: ReadWriteOnce