mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 15:37:02 +00:00
feat(helm): add option to disable log PVCs and mounts (#3189)
Co-authored-by: cxymds <Cxymds@qq.com>
This commit is contained in:
+1
-1
@@ -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.domains | string | `""` | Enable virtual host mode. |
|
||||||
| config.rustfs.log_level | string | `"info"` | |
|
| config.rustfs.log_level | string | `"info"` | |
|
||||||
| config.rustfs.obs_environment | string | `"development"` | |
|
| 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.region | string | `"us-east-1"` | |
|
||||||
| config.rustfs.volumes | string | `""` | |
|
| config.rustfs.volumes | string | `""` | |
|
||||||
| config.rustfs.log_rotation.size | int | `"100"` | Default log rotation size mb for rustfs. |
|
| config.rustfs.log_rotation.size | int | `"100"` | Default log rotation size mb for rustfs. |
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- $logDir := .Values.config.rustfs.obs_log_directory }}
|
{{- $logDir := .Values.config.rustfs.obs_log_directory }}
|
||||||
|
{{- $logDirEnabled := ne $logDir "" }}
|
||||||
|
|
||||||
{{- if .Values.mode.standalone.enabled }}
|
{{- if .Values.mode.standalone.enabled }}
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -75,13 +76,18 @@ spec:
|
|||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
mkdir -p /data /mnt/rustfs/logs
|
mkdir -p /data
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
|
mkdir -p /mnt/rustfs/logs
|
||||||
chmod 755 /mnt/rustfs/logs
|
chmod 755 /mnt/rustfs/logs
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
- name: logs
|
- name: logs
|
||||||
mountPath: /mnt/rustfs
|
mountPath: /mnt/rustfs
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.rustfs.repository }}:{{ .Values.image.rustfs.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.rustfs.repository }}:{{ .Values.image.rustfs.tag | default .Chart.AppVersion }}"
|
||||||
@@ -130,9 +136,11 @@ spec:
|
|||||||
{{- with .Values.extraVolumeMounts }}
|
{{- with .Values.extraVolumeMounts }}
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
- name: logs
|
- name: logs
|
||||||
mountPath: {{ $logDir }}
|
mountPath: {{ $logDir }}
|
||||||
subPath: logs
|
subPath: logs
|
||||||
|
{{- end }}
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
volumes:
|
volumes:
|
||||||
@@ -161,6 +169,7 @@ spec:
|
|||||||
- key: ca.crt
|
- key: ca.crt
|
||||||
path: client_ca.crt
|
path: client_ca.crt
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
- name: logs
|
- name: logs
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
{{- if .Values.mode.standalone.existingClaim.logsClaim }}
|
{{- if .Values.mode.standalone.existingClaim.logsClaim }}
|
||||||
@@ -168,6 +177,7 @@ spec:
|
|||||||
{{- else }}
|
{{- else }}
|
||||||
claimName: {{ include "rustfs.fullname" $ }}-logs
|
claimName: {{ include "rustfs.fullname" $ }}-logs
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
- name: data
|
- name: data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
{{- if .Values.mode.standalone.existingClaim.dataClaim }}
|
{{- if .Values.mode.standalone.existingClaim.dataClaim }}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- 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 }}
|
{{- with .Values.storageclass }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- $logDir := .Values.config.rustfs.obs_log_directory }}
|
{{- $logDir := .Values.config.rustfs.obs_log_directory }}
|
||||||
|
{{- $logDirEnabled := ne $logDir "" }}
|
||||||
|
|
||||||
{{- if .Values.mode.distributed.enabled }}
|
{{- if .Values.mode.distributed.enabled }}
|
||||||
---
|
---
|
||||||
@@ -86,8 +87,10 @@ spec:
|
|||||||
elif [ "$REPLICA_COUNT" -eq 16 ]; then
|
elif [ "$REPLICA_COUNT" -eq 16 ]; then
|
||||||
mkdir -p /data
|
mkdir -p /data
|
||||||
fi
|
fi
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
mkdir -p /mnt/rustfs/logs
|
mkdir -p /mnt/rustfs/logs
|
||||||
chmod 755 /mnt/rustfs/logs
|
chmod 755 /mnt/rustfs/logs
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{{- if eq (int .Values.replicaCount) 4 }}
|
{{- if eq (int .Values.replicaCount) 4 }}
|
||||||
{{- range $i := until (int .Values.replicaCount) }}
|
{{- range $i := until (int .Values.replicaCount) }}
|
||||||
@@ -98,8 +101,10 @@ spec:
|
|||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
- name: logs
|
- name: logs
|
||||||
mountPath: /mnt/rustfs
|
mountPath: /mnt/rustfs
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.rustfs.repository }}:{{ .Values.image.rustfs.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.rustfs.repository }}:{{ .Values.image.rustfs.tag | default .Chart.AppVersion }}"
|
||||||
@@ -148,9 +153,11 @@ spec:
|
|||||||
{{- with .Values.extraVolumeMounts }}
|
{{- with .Values.extraVolumeMounts }}
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
- name: logs
|
- name: logs
|
||||||
mountPath: {{ $logDir }}
|
mountPath: {{ $logDir }}
|
||||||
subPath: logs
|
subPath: logs
|
||||||
|
{{- end }}
|
||||||
{{- if eq (int .Values.replicaCount) 4 }}
|
{{- if eq (int .Values.replicaCount) 4 }}
|
||||||
{{- range $i := until (int .Values.replicaCount) }}
|
{{- range $i := until (int .Values.replicaCount) }}
|
||||||
- name: data-rustfs-{{ $i }}
|
- name: data-rustfs-{{ $i }}
|
||||||
@@ -189,6 +196,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeClaimTemplates:
|
volumeClaimTemplates:
|
||||||
|
{{- if $logDirEnabled }}
|
||||||
- apiVersion: v1
|
- apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
@@ -203,6 +211,7 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: {{ .Values.storageclass.logStorageSize }}
|
storage: {{ .Values.storageclass.logStorageSize }}
|
||||||
|
{{- end }}
|
||||||
{{- if eq (int .Values.replicaCount) 4 }}
|
{{- if eq (int .Values.replicaCount) 4 }}
|
||||||
{{- range $i := until (int .Values.replicaCount) }}
|
{{- range $i := until (int .Values.replicaCount) }}
|
||||||
- apiVersion: v1
|
- apiVersion: v1
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ config:
|
|||||||
console_address: ":9001"
|
console_address: ":9001"
|
||||||
log_level: "info"
|
log_level: "info"
|
||||||
region: "us-east-1"
|
region: "us-east-1"
|
||||||
obs_log_directory: "/logs"
|
obs_log_directory: "/logs" # Set to "" to disable log PVCs and mounts.
|
||||||
obs_environment: "development"
|
obs_environment: "development"
|
||||||
# Optionally enable support for virtual-hosted-style requests.
|
# Optionally enable support for virtual-hosted-style requests.
|
||||||
# See more information: https://docs.rustfs.com/integration/virtual.html
|
# See more information: https://docs.rustfs.com/integration/virtual.html
|
||||||
|
|||||||
Reference in New Issue
Block a user