diff --git a/helm/README.md b/helm/README.md index 1ace70397..82551f275 100644 --- a/helm/README.md +++ b/helm/README.md @@ -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` | | diff --git a/helm/rustfs/templates/configmap.yaml b/helm/rustfs/templates/configmap.yaml index a92c26fa7..c55277847 100644 --- a/helm/rustfs/templates/configmap.yaml +++ b/helm/rustfs/templates/configmap.yaml @@ -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 }} \ No newline at end of file diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index ff6c29e47..05f5ef4c7 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -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: