diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2022-04-18 09:58:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-18 09:58:41 -0700 |
| commit | 868b4f894485d1b041daf4cfbfc96856b27eb253 (patch) | |
| tree | 70dfe1581ae0626f878d60c58b2c04e82588c084 | |
| parent | cdb31c5b61ca3c8632c8722cbb8ca5adef535cdc (diff) | |
| parent | 1093e8e6d7ee2e3df8c2559ac0118634618d992b (diff) | |
| download | seaweedfs-868b4f894485d1b041daf4cfbfc96856b27eb253.tar.xz seaweedfs-868b4f894485d1b041daf4cfbfc96856b27eb253.zip | |
Merge pull request #2935 from joy717/fix/filer-leveldb2-lost-data
fix filer using leveldb2 may lose data
| -rw-r--r-- | k8s/helm_charts2/templates/filer-statefulset.yaml | 32 | ||||
| -rw-r--r-- | k8s/helm_charts2/values.yaml | 3 |
2 files changed, 21 insertions, 14 deletions
diff --git a/k8s/helm_charts2/templates/filer-statefulset.yaml b/k8s/helm_charts2/templates/filer-statefulset.yaml index 667466753..94003819f 100644 --- a/k8s/helm_charts2/templates/filer-statefulset.yaml +++ b/k8s/helm_charts2/templates/filer-statefulset.yaml @@ -154,13 +154,16 @@ spec: {{- end }} {{- end }} -master={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }} - {{- if or (.Values.global.enableSecurity) (.Values.filer.extraVolumeMounts) }} volumeMounts: - name: seaweedfs-filer-log-volume mountPath: "/logs/" - mountPath: /etc/sw name: config-users readOnly: true + {{- if .Values.filer.enablePVC }} + - name: data-filer + mountPath: /data + {{- end }} {{- if .Values.global.enableSecurity }} - name: security-config readOnly: true @@ -183,7 +186,6 @@ spec: mountPath: /usr/local/share/ca-certificates/client/ {{- end }} {{ tpl .Values.filer.extraVolumeMounts . | nindent 12 | trim }} - {{- end }} ports: - containerPort: {{ .Values.filer.port }} name: swfs-filer @@ -250,16 +252,18 @@ spec: nodeSelector: {{ tpl .Values.filer.nodeSelector . | indent 8 | trim }} {{- end }} -{{/* volumeClaimTemplates:*/}} -{{/* - metadata:*/}} -{{/* name: data-{{ .Release.Namespace }}*/}} -{{/* spec:*/}} -{{/* accessModes:*/}} -{{/* - ReadWriteOnce*/}} -{{/* resources:*/}} -{{/* requests:*/}} -{{/* storage: {{ .Values.filer.storage }}*/}} -{{/* {{- if .Values.filer.storageClass }}*/}} -{{/* storageClassName: {{ .Values.filer.storageClass }}*/}} -{{/* {{- end }}*/}} + {{- if .Values.filer.enablePVC }} + volumeClaimTemplates: + - metadata: + name: data-filer + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.filer.storage }} + {{- if .Values.filer.storageClass }} + storageClassName: {{ .Values.filer.storageClass }} + {{- end }} + {{- end }} {{- end }} diff --git a/k8s/helm_charts2/values.yaml b/k8s/helm_charts2/values.yaml index 3ffb1824f..08cfe43b1 100644 --- a/k8s/helm_charts2/values.yaml +++ b/k8s/helm_charts2/values.yaml @@ -61,6 +61,8 @@ master: extraVolumes: "" extraVolumeMounts: "" + # enablePVC will create a pvc for filer for data persistence. + enablePVC: false # storage and storageClass are the settings for configuring stateful # storage for the master pods. storage should be set to the disk size of # the attached volume. storageClass is the class of storage which defaults @@ -357,6 +359,7 @@ filer: WEED_MYSQL_CONNECTION_MAX_LIFETIME_SECONDS: "600" # enable usage of memsql as filer backend WEED_MYSQL_INTERPOLATEPARAMS: "true" + # if you want to use leveldb2, then should enable "enablePVC". or you may lose your data. WEED_LEVELDB2_ENABLED: "false" # with http DELETE, by default the filer would check whether a folder is empty. # recursive_delete will delete all sub folders and files, similar to "rm -Rf" |
