feat: add existing pvc claim for standalone (#1829)

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
majinghe
2026-02-15 15:49:37 +08:00
committed by GitHub
parent 2093a13308
commit 2d4d240508
4 changed files with 20 additions and 8 deletions

View File

@@ -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 | `""` | |

View File

@@ -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 }}

View File

@@ -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:

View File

@@ -40,6 +40,9 @@ mode:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
existingClaim:
dataClaim: ""
logsClaim: ""
distributed:
enabled: true