Browse Source

helm chart - add support for emptyDir storage type (#5610)

pull/5611/head
Tomer Eskenazi 7 months ago
committed by GitHub
parent
commit
4e00ab4942
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      k8s/charts/seaweedfs/templates/filer-statefulset.yaml
  2. 12
      k8s/charts/seaweedfs/templates/master-statefulset.yaml
  3. 8
      k8s/charts/seaweedfs/templates/s3-deployment.yaml
  4. 12
      k8s/charts/seaweedfs/templates/volume-statefulset.yaml
  5. 33
      k8s/charts/seaweedfs/values.yaml

14
k8s/charts/seaweedfs/templates/filer-statefulset.yaml

@ -129,7 +129,7 @@ spec:
- "-ec" - "-ec"
- | - |
exec /usr/bin/weed \ 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 \ -logdir=/logs \
{{- else }} {{- else }}
-logtostderr=true \ -logtostderr=true \
@ -197,7 +197,7 @@ spec:
{{- end }} {{- 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 }} -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: 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 - name: seaweedfs-filer-log-volume
mountPath: "/logs/" mountPath: "/logs/"
{{- end }} {{- end }}
@ -206,7 +206,7 @@ spec:
mountPath: /etc/sw mountPath: /etc/sw
readOnly: true readOnly: true
{{- end }} {{- 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 - name: data-filer
mountPath: /data mountPath: /data
{{- end }} {{- end }}
@ -285,6 +285,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.filer.logs.claimName }} claimName: {{ .Values.filer.logs.claimName }}
{{- end }} {{- end }}
{{- if eq .Values.filer.logs.type "emptyDir" }}
- name: seaweedfs-filer-log-volume
emptyDir: {}
{{- end }}
{{- if eq .Values.filer.data.type "hostPath" }} {{- if eq .Values.filer.data.type "hostPath" }}
- name: data-filer - name: data-filer
hostPath: hostPath:
@ -296,6 +300,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.filer.data.claimName }} claimName: {{ .Values.filer.data.claimName }}
{{- end }} {{- end }}
{{- if eq .Values.filer.data.type "emptyDir" }}
- name: data-filer
emptyDir: {}
{{- end }}
- name: db-schema-config-volume - name: db-schema-config-volume
configMap: configMap:
name: seaweedfs-db-init-config name: seaweedfs-db-init-config

12
k8s/charts/seaweedfs/templates/master-statefulset.yaml

@ -110,7 +110,7 @@ spec:
- "-ec" - "-ec"
- | - |
exec /usr/bin/weed \ 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 \ -logdir=/logs \
{{- else }} {{- else }}
-logtostderr=true \ -logtostderr=true \
@ -158,7 +158,7 @@ spec:
volumeMounts: volumeMounts:
- name : data-{{ .Release.Namespace }} - name : data-{{ .Release.Namespace }}
mountPath: /data 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 - name: seaweedfs-master-log-volume
mountPath: "/logs/" mountPath: "/logs/"
{{- end }} {{- end }}
@ -243,6 +243,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.master.logs.claimName }} claimName: {{ .Values.master.logs.claimName }}
{{- end }} {{- end }}
{{- if eq .Values.master.logs.type "emptyDir" }}
- name: seaweedfs-master-log-volume
emptyDir: {}
{{- end }}
{{- if eq .Values.master.data.type "hostPath" }} {{- if eq .Values.master.data.type "hostPath" }}
- name: data-{{ .Release.Namespace }} - name: data-{{ .Release.Namespace }}
hostPath: hostPath:
@ -254,6 +258,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.master.data.claimName }} claimName: {{ .Values.master.data.claimName }}
{{- end }} {{- end }}
{{- if eq .Values.master.data.type "emptyDir" }}
- name: data-{{ .Release.Namespace }}
emptyDir: {}
{{- end }}
- name: master-config - name: master-config
configMap: configMap:
name: {{ template "seaweedfs.name" . }}-master-config name: {{ template "seaweedfs.name" . }}-master-config

8
k8s/charts/seaweedfs/templates/s3-deployment.yaml

@ -99,7 +99,7 @@ spec:
- "-ec" - "-ec"
- | - |
exec /usr/bin/weed \ 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 \ -logdir=/logs \
{{- else }} {{- else }}
-logtostderr=true \ -logtostderr=true \
@ -136,7 +136,7 @@ spec:
{{- end }} {{- end }}
-filer={{ template "seaweedfs.name" . }}-filer-client.{{ .Release.Namespace }}:{{ .Values.filer.port }} -filer={{ template "seaweedfs.name" . }}-filer-client.{{ .Release.Namespace }}:{{ .Values.filer.port }}
volumeMounts: volumeMounts:
{{- if eq .Values.s3.logs.type "hostPath" }}
{{- if or (eq .Values.s3.logs.type "hostPath") (eq .Values.s3.logs.type "emptyDir") }}
- name: logs - name: logs
mountPath: "/logs/" mountPath: "/logs/"
{{- end }} {{- end }}
@ -225,6 +225,10 @@ spec:
path: {{ .Values.s3.logs.hostPathPrefix }}/logs/seaweedfs/s3 path: {{ .Values.s3.logs.hostPathPrefix }}/logs/seaweedfs/s3
type: DirectoryOrCreate type: DirectoryOrCreate
{{- end }} {{- end }}
{{- if eq .Values.s3.logs.type "emptyDir" }}
- name: logs
emptyDir: {}
{{- end }}
{{- if .Values.global.enableSecurity }} {{- if .Values.global.enableSecurity }}
- name: security-config - name: security-config
configMap: configMap:

12
k8s/charts/seaweedfs/templates/volume-statefulset.yaml

@ -261,6 +261,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ $dir.claimName }} claimName: {{ $dir.claimName }}
{{- end }} {{- end }}
{{- if eq $dir.type "emptyDir" }}
- name: {{ $dir.name }}
emptyDir: {}
{{- end }}
{{- end }} {{- end }}
@ -276,6 +280,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.volume.idx.claimName }} claimName: {{ .Values.volume.idx.claimName }}
{{- end }} {{- end }}
{{- if eq .Values.volume.idx.type "emptyDir" }}
- name: idx
emptyDir: {}
{{- end }}
{{- end }} {{- end }}
{{- if .Values.volume.logs }} {{- if .Values.volume.logs }}
@ -290,6 +298,10 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.volume.logs.claimName }} claimName: {{ .Values.volume.logs.claimName }}
{{- end }} {{- end }}
{{- if eq .Values.volume.logs.type "emptyDir" }}
- name: logs
emptyDir: {}
{{- end }}
{{- end }} {{- end }}
{{- if .Values.global.enableSecurity }} {{- if .Values.global.enableSecurity }}
- name: security-config - name: security-config

33
k8s/charts/seaweedfs/values.yaml

@ -93,11 +93,18 @@ master:
# data: # data:
# type: "existingClaim" # type: "existingClaim"
# claimName: "my-pvc" # claimName: "my-pvc"
#
# You can also use emptyDir storage:
# data:
# type: "emptyDir"
data: data:
type: "hostPath" type: "hostPath"
storageClass: "" storageClass: ""
hostPathPrefix: /ssd hostPathPrefix: /ssd
# You can also use emptyDir storage:
# logs:
# type: "emptyDir"
logs: logs:
type: "hostPath" type: "hostPath"
size: "" size: ""
@ -275,9 +282,14 @@ volume:
# maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7") # 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: # 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") # maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7")
dataDirs: dataDirs:
@ -310,6 +322,11 @@ volume:
# idx: # idx:
# type: "existingClaim" # type: "existingClaim"
# claimName: "myClaim" # claimName: "myClaim"
#
# or
#
# idx:
# type: "emptyDir"
# same applies to "logs" # same applies to "logs"
@ -499,12 +516,19 @@ filer:
# data: # data:
# type: "existingClaim" # type: "existingClaim"
# claimName: "my-pvc" # claimName: "my-pvc"
#
# You can also use emptyDir storage:
# data:
# type: "emptyDir"
data: data:
type: "hostPath" type: "hostPath"
size: "" size: ""
storageClass: "" storageClass: ""
hostPathPrefix: /storage hostPathPrefix: /storage
# You can also use emptyDir storage:
# logs:
# type: "emptyDir"
logs: logs:
type: "hostPath" type: "hostPath"
size: "" size: ""
@ -783,6 +807,9 @@ s3:
# allowPrivilegeEscalation: false # allowPrivilegeEscalation: false
containerSecurityContext: {} containerSecurityContext: {}
# You can also use emptyDir storage:
# logs:
# type: "emptyDir"
logs: logs:
type: "hostPath" type: "hostPath"
size: "" size: ""

Loading…
Cancel
Save