diff --git a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml index d83d3a639..77457be74 100644 --- a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml @@ -129,7 +129,7 @@ spec: - "-ec" - | exec /usr/bin/weed \ - {{- if eq .Values.filer.logs.type "hostPath" }} + {{- if or (eq .Values.filer.logs.type "hostPath") (eq .Values.filer.logs.type "emptyDir") }} -logdir=/logs \ {{- else }} -logtostderr=true \ @@ -197,7 +197,7 @@ spec: {{- end }} -master={{ if .Values.global.masterServer }}{{.Values.global.masterServer}}{{ else }}{{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ $.Release.Namespace }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}{{ end }} volumeMounts: - {{- if eq .Values.filer.logs.type "hostPath" }} + {{- if or (eq .Values.filer.logs.type "hostPath") (eq .Values.filer.logs.type "emptyDir") }} - name: seaweedfs-filer-log-volume mountPath: "/logs/" {{- end }} @@ -206,7 +206,7 @@ spec: mountPath: /etc/sw readOnly: true {{- end }} - {{- if (or .Values.filer.enablePVC (or (eq .Values.filer.data.type "hostPath") (eq .Values.filer.data.type "persistentVolumeClaim"))) }} + {{- if (or .Values.filer.enablePVC (or (eq .Values.filer.data.type "hostPath") (eq .Values.filer.data.type "persistentVolumeClaim") (eq .Values.filer.data.type "emptyDir"))) }} - name: data-filer mountPath: /data {{- end }} @@ -285,6 +285,10 @@ spec: persistentVolumeClaim: claimName: {{ .Values.filer.logs.claimName }} {{- end }} + {{- if eq .Values.filer.logs.type "emptyDir" }} + - name: seaweedfs-filer-log-volume + emptyDir: {} + {{- end }} {{- if eq .Values.filer.data.type "hostPath" }} - name: data-filer hostPath: @@ -296,6 +300,10 @@ spec: persistentVolumeClaim: claimName: {{ .Values.filer.data.claimName }} {{- end }} + {{- if eq .Values.filer.data.type "emptyDir" }} + - name: data-filer + emptyDir: {} + {{- end }} - name: db-schema-config-volume configMap: name: seaweedfs-db-init-config diff --git a/k8s/charts/seaweedfs/templates/master-statefulset.yaml b/k8s/charts/seaweedfs/templates/master-statefulset.yaml index 1f196fb9c..00fb6f913 100644 --- a/k8s/charts/seaweedfs/templates/master-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/master-statefulset.yaml @@ -108,9 +108,9 @@ spec: command: - "/bin/sh" - "-ec" - - | + - | exec /usr/bin/weed \ - {{- if eq .Values.master.logs.type "hostPath" }} + {{- if or (eq .Values.master.logs.type "hostPath") (eq .Values.master.logs.type "emptyDir") }} -logdir=/logs \ {{- else }} -logtostderr=true \ @@ -158,7 +158,7 @@ spec: volumeMounts: - name : data-{{ .Release.Namespace }} mountPath: /data - {{- if eq .Values.master.logs.type "hostPath" }} + {{- if or (eq .Values.master.logs.type "hostPath") (eq .Values.master.logs.type "emptyDir") }} - name: seaweedfs-master-log-volume mountPath: "/logs/" {{- end }} @@ -241,7 +241,11 @@ spec: {{- if eq .Values.master.logs.type "existingClaim" }} - name: seaweedfs-master-log-volume persistentVolumeClaim: - claimName: {{ .Values.master.logs.claimName }} + claimName: {{ .Values.master.logs.claimName }} + {{- end }} + {{- if eq .Values.master.logs.type "emptyDir" }} + - name: seaweedfs-master-log-volume + emptyDir: {} {{- end }} {{- if eq .Values.master.data.type "hostPath" }} - name: data-{{ .Release.Namespace }} @@ -252,7 +256,11 @@ spec: {{- if eq .Values.master.data.type "existingClaim" }} - name: data-{{ .Release.Namespace }} persistentVolumeClaim: - claimName: {{ .Values.master.data.claimName }} + claimName: {{ .Values.master.data.claimName }} + {{- end }} + {{- if eq .Values.master.data.type "emptyDir" }} + - name: data-{{ .Release.Namespace }} + emptyDir: {} {{- end }} - name: master-config configMap: diff --git a/k8s/charts/seaweedfs/templates/s3-deployment.yaml b/k8s/charts/seaweedfs/templates/s3-deployment.yaml index 7a02524a0..365a32cdf 100644 --- a/k8s/charts/seaweedfs/templates/s3-deployment.yaml +++ b/k8s/charts/seaweedfs/templates/s3-deployment.yaml @@ -99,7 +99,7 @@ spec: - "-ec" - | exec /usr/bin/weed \ - {{- if eq .Values.s3.logs.type "hostPath" }} + {{- if or (eq .Values.s3.logs.type "hostPath") (eq .Values.s3.logs.type "emptyDir") }} -logdir=/logs \ {{- else }} -logtostderr=true \ @@ -136,7 +136,7 @@ spec: {{- end }} -filer={{ template "seaweedfs.name" . }}-filer-client.{{ .Release.Namespace }}:{{ .Values.filer.port }} volumeMounts: - {{- if eq .Values.s3.logs.type "hostPath" }} + {{- if or (eq .Values.s3.logs.type "hostPath") (eq .Values.s3.logs.type "emptyDir") }} - name: logs mountPath: "/logs/" {{- end }} @@ -225,6 +225,10 @@ spec: path: {{ .Values.s3.logs.hostPathPrefix }}/logs/seaweedfs/s3 type: DirectoryOrCreate {{- end }} + {{- if eq .Values.s3.logs.type "emptyDir" }} + - name: logs + emptyDir: {} + {{- end }} {{- if .Values.global.enableSecurity }} - name: security-config configMap: diff --git a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml index b691f3045..8732a810c 100644 --- a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml @@ -261,6 +261,10 @@ spec: persistentVolumeClaim: claimName: {{ $dir.claimName }} {{- end }} + {{- if eq $dir.type "emptyDir" }} + - name: {{ $dir.name }} + emptyDir: {} + {{- end }} {{- end }} @@ -276,6 +280,10 @@ spec: persistentVolumeClaim: claimName: {{ .Values.volume.idx.claimName }} {{- end }} + {{- if eq .Values.volume.idx.type "emptyDir" }} + - name: idx + emptyDir: {} + {{- end }} {{- end }} {{- if .Values.volume.logs }} @@ -290,6 +298,10 @@ spec: persistentVolumeClaim: claimName: {{ .Values.volume.logs.claimName }} {{- end }} + {{- if eq .Values.volume.logs.type "emptyDir" }} + - name: logs + emptyDir: {} + {{- end }} {{- end }} {{- if .Values.global.enableSecurity }} - name: security-config diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index 8962e8d34..f22f6b1f4 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -93,11 +93,18 @@ master: # data: # type: "existingClaim" # claimName: "my-pvc" + # + # You can also use emptyDir storage: + # data: + # type: "emptyDir" data: type: "hostPath" storageClass: "" hostPathPrefix: /ssd + # You can also use emptyDir storage: + # logs: + # type: "emptyDir" logs: type: "hostPath" size: "" @@ -275,9 +282,14 @@ volume: # maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7") # # You may also spacify an existing claim: - # - name: data - # type: "existingClaim" - # claimName: "my-pvc" + # - name: data + # type: "existingClaim" + # claimName: "my-pvc" + # maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7") + # + # You can also use emptyDir storage: + # - name: data + # type: "emptyDir" # maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7") dataDirs: @@ -310,6 +322,11 @@ volume: # idx: # type: "existingClaim" # claimName: "myClaim" + # + # or + # + # idx: + # type: "emptyDir" # same applies to "logs" @@ -499,12 +516,19 @@ filer: # data: # type: "existingClaim" # claimName: "my-pvc" + # + # You can also use emptyDir storage: + # data: + # type: "emptyDir" data: type: "hostPath" size: "" storageClass: "" hostPathPrefix: /storage + # You can also use emptyDir storage: + # logs: + # type: "emptyDir" logs: type: "hostPath" size: "" @@ -783,6 +807,9 @@ s3: # allowPrivilegeEscalation: false containerSecurityContext: {} + # You can also use emptyDir storage: + # logs: + # type: "emptyDir" logs: type: "hostPath" size: ""