feat: add obs log rotations environment variables (#1702)

This commit is contained in:
majinghe
2026-02-03 10:35:30 +08:00
committed by GitHub
parent cb468fb32f
commit 2f66f15524
3 changed files with 32 additions and 12 deletions

View File

@@ -28,6 +28,9 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m
| config.rustfs.region | string | `"us-east-1"` | |
| config.rustfs.rust_log | string | `"debug"` | |
| config.rustfs.volumes | string | `""` | |
| config.rustfs.log_rotation.size | int | `"100"` | Default log rotation size mb for rustfs. |
| config.rustfs.log_rotation.time | string | `"hour"` | Default log rotation time for rustfs. |
| config.rustfs.log_rotation.keep_files | int | `"30"` | Default log keep files for rustfs. |
| containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | |
| containerSecurityContext.readOnlyRootFilesystem | bool | `true` | |
| containerSecurityContext.runAsNonRoot | bool | `true` | |

View File

@@ -5,20 +5,33 @@ metadata:
labels:
{{- toYaml .Values.commonLabels | nindent 4 }}
data:
RUSTFS_ADDRESS: {{ .Values.config.rustfs.address | quote }}
RUSTFS_CONSOLE_ADDRESS: {{ .Values.config.rustfs.console_address | quote }}
RUSTFS_CONSOLE_ENABLE: {{ .Values.config.rustfs.console_enable | quote }}
RUSTFS_OBS_LOG_DIRECTORY: {{ .Values.config.rustfs.obs_log_directory | quote }}
RUSTFS_OBS_LOGGER_LEVEL: {{ .Values.config.rustfs.log_level | quote }}
RUSTFS_OBS_ENVIRONMENT: {{ .Values.config.rustfs.obs_environment | quote }}
{{- if .Values.config.rustfs.region }}
RUSTFS_REGION: {{ .Values.config.rustfs.region | quote }}
{{- with .Values.config.rustfs }}
RUSTFS_ADDRESS: {{ .address | quote }}
RUSTFS_CONSOLE_ADDRESS: {{ .console_address | quote }}
RUSTFS_CONSOLE_ENABLE: {{ .console_enable | quote }}
RUSTFS_OBS_LOG_DIRECTORY: {{ .obs_log_directory | quote }}
RUSTFS_OBS_LOGGER_LEVEL: {{ .log_level | quote }}
RUSTFS_OBS_ENVIRONMENT: {{ .obs_environment | quote }}
{{- if .region }}
RUSTFS_REGION: {{ .region | quote }}
{{- end }}
{{- if .domains }}
RUSTFS_SERVER_DOMAINS: {{ include "rustfs.serverDomains" $ | quote }}
{{- end }}
{{- with .log_rotation }}
{{- if .size }}
RUSTFS_OBS_LOG_ROTATION_SIZE_MB: {{ .size | quote }}
{{- end }}
{{- if .time }}
RUSTFS_OBS_LOG_ROTATION_TIME: {{ .time | quote }}
{{- end }}
{{- if .keep_files }}
RUSTFS_OBS_LOG_KEEP_FILES: {{ .keep_files | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.mode.distributed.enabled }}
RUSTFS_VOLUMES: {{ .Values.config.rustfs.volumes | default (include "rustfs.volumes" .) }}
RUSTFS_VOLUMES: {{ .Values.config.rustfs.volumes | default (include "rustfs.volumes" .) | quote }}
{{- else }}
RUSTFS_VOLUMES: "/data"
{{- end }}
{{- if .Values.config.rustfs.domains }}
RUSTFS_SERVER_DOMAINS: {{ include "rustfs.serverDomains" . | quote }}
{{- end }}

View File

@@ -65,6 +65,10 @@ config:
# Optionally enable support for virtual-hosted-style requests.
# See more information: https://docs.rustfs.com/integration/virtual.html
domains: "" # e.g. "example.com"
log_rotation: # Specify log rotation settings
# size: 100 # Default value: 100 MB
# time: hour # Default value: hour, eg: day,hour,minute,second
# keep_files: 30 # number of rotated log files to keep
# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount: