feat(helm): add option to disable log PVCs and mounts (#3189)

Co-authored-by: cxymds <Cxymds@qq.com>
This commit is contained in:
Michael
2026-06-08 12:35:12 +02:00
committed by GitHub
parent ed73952cb6
commit 2fc1cf90e0
5 changed files with 23 additions and 4 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m
| config.rustfs.domains | string | `""` | Enable virtual host mode. |
| config.rustfs.log_level | string | `"info"` | |
| config.rustfs.obs_environment | string | `"development"` | |
| config.rustfs.obs_log_directory | string | `"/logs"` | |
| config.rustfs.obs_log_directory | string | `"/logs"` | Log directory inside the RustFS container. Set to `""` to disable log PVCs and mounts. |
| config.rustfs.region | string | `"us-east-1"` | |
| config.rustfs.volumes | string | `""` | |
| config.rustfs.log_rotation.size | int | `"100"` | Default log rotation size mb for rustfs. |
+11 -1
View File
@@ -1,4 +1,5 @@
{{- $logDir := .Values.config.rustfs.obs_log_directory }}
{{- $logDirEnabled := ne $logDir "" }}
{{- if .Values.mode.standalone.enabled }}
apiVersion: apps/v1
@@ -75,13 +76,18 @@ spec:
- sh
- -c
- |
mkdir -p /data /mnt/rustfs/logs
mkdir -p /data
{{- if $logDirEnabled }}
mkdir -p /mnt/rustfs/logs
chmod 755 /mnt/rustfs/logs
{{- end }}
volumeMounts:
- name: data
mountPath: /data
{{- if $logDirEnabled }}
- name: logs
mountPath: /mnt/rustfs
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.rustfs.repository }}:{{ .Values.image.rustfs.tag | default .Chart.AppVersion }}"
@@ -130,9 +136,11 @@ spec:
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $logDirEnabled }}
- name: logs
mountPath: {{ $logDir }}
subPath: logs
{{- end }}
- name: data
mountPath: /data
volumes:
@@ -161,6 +169,7 @@ spec:
- key: ca.crt
path: client_ca.crt
{{- end }}
{{- if $logDirEnabled }}
- name: logs
persistentVolumeClaim:
{{- if .Values.mode.standalone.existingClaim.logsClaim }}
@@ -168,6 +177,7 @@ spec:
{{- else }}
claimName: {{ include "rustfs.fullname" $ }}-logs
{{- end }}
{{- end }}
- name: data
persistentVolumeClaim:
{{- if .Values.mode.standalone.existingClaim.dataClaim }}
+1 -1
View File
@@ -23,7 +23,7 @@ spec:
{{- end }}
{{- end }}
{{- if and .Values.mode.standalone.enabled (not .Values.mode.standalone.existingClaim.logsClaim) }}
{{- if and .Values.mode.standalone.enabled .Values.config.rustfs.obs_log_directory (not .Values.mode.standalone.existingClaim.logsClaim) }}
{{- with .Values.storageclass }}
---
apiVersion: v1
+9
View File
@@ -1,4 +1,5 @@
{{- $logDir := .Values.config.rustfs.obs_log_directory }}
{{- $logDirEnabled := ne $logDir "" }}
{{- if .Values.mode.distributed.enabled }}
---
@@ -86,8 +87,10 @@ spec:
elif [ "$REPLICA_COUNT" -eq 16 ]; then
mkdir -p /data
fi
{{- if $logDirEnabled }}
mkdir -p /mnt/rustfs/logs
chmod 755 /mnt/rustfs/logs
{{- end }}
volumeMounts:
{{- if eq (int .Values.replicaCount) 4 }}
{{- range $i := until (int .Values.replicaCount) }}
@@ -98,8 +101,10 @@ spec:
- name: data
mountPath: /data
{{- end }}
{{- if $logDirEnabled }}
- name: logs
mountPath: /mnt/rustfs
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.rustfs.repository }}:{{ .Values.image.rustfs.tag | default .Chart.AppVersion }}"
@@ -148,9 +153,11 @@ spec:
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $logDirEnabled }}
- name: logs
mountPath: {{ $logDir }}
subPath: logs
{{- end }}
{{- if eq (int .Values.replicaCount) 4 }}
{{- range $i := until (int .Values.replicaCount) }}
- name: data-rustfs-{{ $i }}
@@ -189,6 +196,7 @@ spec:
{{- end }}
{{- end }}
volumeClaimTemplates:
{{- if $logDirEnabled }}
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
@@ -203,6 +211,7 @@ spec:
resources:
requests:
storage: {{ .Values.storageclass.logStorageSize }}
{{- end }}
{{- if eq (int .Values.replicaCount) 4 }}
{{- range $i := until (int .Values.replicaCount) }}
- apiVersion: v1
+1 -1
View File
@@ -71,7 +71,7 @@ config:
console_address: ":9001"
log_level: "info"
region: "us-east-1"
obs_log_directory: "/logs"
obs_log_directory: "/logs" # Set to "" to disable log PVCs and mounts.
obs_environment: "development"
# Optionally enable support for virtual-hosted-style requests.
# See more information: https://docs.rustfs.com/integration/virtual.html