diff --git a/helm/README.md b/helm/README.md index 643e13a30..7ff22e878 100644 --- a/helm/README.md +++ b/helm/README.md @@ -75,6 +75,8 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | livenessProbe.timeoutSeconds | int | `3` | | | mode.distributed.enabled | bool | `true` | RustFS distributed mode support, namely multiple pod multiple pvc. | | mode.standalone.enabled | bool | `false` | RustFS standalone mode support, namely one pod one pvc. | +| mode.standalone.existingClaim.dataClaim |string |`""` |Whether to use existing pvc claim for data storage. | +| mode.standalone.existingClaim.logsClaim |string |`""` |Whether to use existing pvc claim for logs storage. | | mtls.enabled | bool | `false` | Enable mtls betweens pods. | | mtls.serverOnly | bool | `false` | Only enable server https. | | nameOverride | string | `""` | | diff --git a/helm/rustfs/templates/deployment.yaml b/helm/rustfs/templates/deployment.yaml index f67695cb5..ae7f8f454 100644 --- a/helm/rustfs/templates/deployment.yaml +++ b/helm/rustfs/templates/deployment.yaml @@ -60,10 +60,6 @@ spec: {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} - {{- end }} initContainers: - name: init-step image: "{{ .Values.image.initImage.repository }}:{{ .Values.image.initImage.tag }}" @@ -127,8 +123,16 @@ spec: volumes: - name: logs persistentVolumeClaim: - claimName: {{ include "rustfs.fullname" . }}-logs + {{- if .Values.mode.standalone.existingClaim.logsClaim }} + claimName: {{ .Values.mode.standalone.existingClaim.logsClaim }} + {{- else }} + claimName: {{ include "rustfs.fullname" $ }}-logs + {{- end }} - name: data persistentVolumeClaim: - claimName: {{ include "rustfs.fullname" . }}-data + {{- if .Values.mode.standalone.existingClaim.dataClaim }} + claimName: {{ .Values.mode.standalone.existingClaim.dataClaim }} + {{- else }} + claimName: {{ include "rustfs.fullname" $ }}-data + {{- end }} {{- end }} diff --git a/helm/rustfs/templates/pvc.yaml b/helm/rustfs/templates/pvc.yaml index f602eec9b..9e5a9b388 100644 --- a/helm/rustfs/templates/pvc.yaml +++ b/helm/rustfs/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.mode.standalone.enabled }} +{{- if and .Values.mode.standalone.enabled (not .Values.mode.standalone.existingClaim.dataClaim) }} {{- with .Values.storageclass }} apiVersion: v1 kind: PersistentVolumeClaim @@ -17,9 +17,12 @@ spec: resources: requests: storage: {{ .dataStorageSize }} +{{- end }} +{{- end }} +{{- if and .Values.mode.standalone.enabled (not .Values.mode.standalone.existingClaim.logsClaim) }} +{{- with .Values.storageclass }} --- - apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index bdfcecb4a..701fc039d 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -40,6 +40,9 @@ mode: rollingUpdate: maxSurge: 0 maxUnavailable: 1 + existingClaim: + dataClaim: "" + logsClaim: "" distributed: enabled: true