aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--k8s/seaweedfs/Chart.yaml3
-rw-r--r--k8s/seaweedfs/templates/_helpers.tpl14
-rw-r--r--k8s/seaweedfs/templates/cronjob.yaml3
-rw-r--r--k8s/seaweedfs/templates/filer-service-client.yaml31
-rw-r--r--k8s/seaweedfs/templates/filer-service.yaml11
-rw-r--r--k8s/seaweedfs/templates/filer-statefulset.yaml12
-rw-r--r--k8s/seaweedfs/templates/master-service.yaml3
-rw-r--r--k8s/seaweedfs/templates/master-statefulset.yaml10
-rw-r--r--k8s/seaweedfs/templates/s3-deployment.yaml27
-rw-r--r--k8s/seaweedfs/templates/volume-statefulset.yaml13
-rw-r--r--k8s/seaweedfs/values.yaml15
11 files changed, 111 insertions, 31 deletions
diff --git a/k8s/seaweedfs/Chart.yaml b/k8s/seaweedfs/Chart.yaml
index ea3317e61..a734d3f9e 100644
--- a/k8s/seaweedfs/Chart.yaml
+++ b/k8s/seaweedfs/Chart.yaml
@@ -1,4 +1,5 @@
apiVersion: v1
description: SeaweedFS
name: seaweedfs
-version: 2.14 \ No newline at end of file
+appVersion: "2.20"
+version: 2.20
diff --git a/k8s/seaweedfs/templates/_helpers.tpl b/k8s/seaweedfs/templates/_helpers.tpl
index 44d480e66..f6c4fa570 100644
--- a/k8s/seaweedfs/templates/_helpers.tpl
+++ b/k8s/seaweedfs/templates/_helpers.tpl
@@ -52,12 +52,12 @@ Inject extra environment vars in the format key:value, if populated
{{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
{{- $repositoryName := .Values.image.repository | toString -}}
{{- $name := .Values.global.imageName | toString -}}
-{{- $tag := .Values.global.imageTag | toString -}}
+{{- $tag := .Chart.AppVersion | toString -}}
{{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
{{- end -}}
{{- end -}}
-{{/* Return the proper postgresqlSchema image */}}
+{{/* Return the proper dbSchema image */}}
{{- define "filer.dbSchema.image" -}}
{{- if .Values.filer.dbSchema.imageOverride -}}
{{- $imageOverride := .Values.filer.dbSchema.imageOverride -}}
@@ -80,7 +80,7 @@ Inject extra environment vars in the format key:value, if populated
{{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
{{- $repositoryName := .Values.image.repository | toString -}}
{{- $name := .Values.global.imageName | toString -}}
-{{- $tag := .Values.global.imageTag | toString -}}
+{{- $tag := .Chart.AppVersion | toString -}}
{{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
{{- end -}}
{{- end -}}
@@ -94,7 +94,7 @@ Inject extra environment vars in the format key:value, if populated
{{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
{{- $repositoryName := .Values.image.repository | toString -}}
{{- $name := .Values.global.imageName | toString -}}
-{{- $tag := .Values.global.imageTag | toString -}}
+{{- $tag := .Chart.AppVersion | toString -}}
{{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
{{- end -}}
{{- end -}}
@@ -108,7 +108,7 @@ Inject extra environment vars in the format key:value, if populated
{{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
{{- $repositoryName := .Values.image.repository | toString -}}
{{- $name := .Values.global.imageName | toString -}}
-{{- $tag := .Values.global.imageTag | toString -}}
+{{- $tag := .Chart.AppVersion | toString -}}
{{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
{{- end -}}
{{- end -}}
@@ -122,7 +122,7 @@ Inject extra environment vars in the format key:value, if populated
{{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
{{- $repositoryName := .Values.image.repository | toString -}}
{{- $name := .Values.global.imageName | toString -}}
-{{- $tag := .Values.global.imageTag | toString -}}
+{{- $tag := .Chart.AppVersion | toString -}}
{{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
{{- end -}}
-{{- end -}} \ No newline at end of file
+{{- end -}}
diff --git a/k8s/seaweedfs/templates/cronjob.yaml b/k8s/seaweedfs/templates/cronjob.yaml
index ad4406d4f..6f4ed8c70 100644
--- a/k8s/seaweedfs/templates/cronjob.yaml
+++ b/k8s/seaweedfs/templates/cronjob.yaml
@@ -6,6 +6,7 @@ metadata:
name: {{ include "seaweedfs.fullname" . }}-cronjob
spec:
schedule: "{{ .Values.cronjob.schedule }}"
+ startingDeadlineSeconds: 200
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 2
successfulJobsHistoryLimit: 2
@@ -51,4 +52,4 @@ spec:
-filer {{ template "seaweedfs.name" . }}-filer.{{ .Release.Namespace }}.svc:{{ .Values.filer.port }}
{{- end }}
{{- end }}
-{{- end }} \ No newline at end of file
+{{- end }}
diff --git a/k8s/seaweedfs/templates/filer-service-client.yaml b/k8s/seaweedfs/templates/filer-service-client.yaml
new file mode 100644
index 000000000..65568418f
--- /dev/null
+++ b/k8s/seaweedfs/templates/filer-service-client.yaml
@@ -0,0 +1,31 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "seaweedfs.name" . }}-filer-client
+ namespace: {{ .Release.Namespace }}
+ labels:
+ app: {{ template "seaweedfs.name" . }}
+ component: filer
+{{- if .Values.filer.metricsPort }}
+ monitoring: "true"
+{{- end }}
+spec:
+ clusterIP: None
+ ports:
+ - name: "swfs-filer"
+ port: {{ .Values.filer.port }}
+ targetPort: {{ .Values.filer.port }}
+ protocol: TCP
+ - name: "swfs-filer-grpc"
+ port: {{ .Values.filer.grpcPort }}
+ targetPort: {{ .Values.filer.grpcPort }}
+ protocol: TCP
+{{- if .Values.filer.metricsPort }}
+ - name: "metrics"
+ port: {{ .Values.filer.metricsPort }}
+ targetPort: {{ .Values.filer.metricsPort }}
+ protocol: TCP
+{{- end }}
+ selector:
+ app: {{ template "seaweedfs.name" . }}
+ component: filer \ No newline at end of file
diff --git a/k8s/seaweedfs/templates/filer-service.yaml b/k8s/seaweedfs/templates/filer-service.yaml
index debc31f6c..45035fc27 100644
--- a/k8s/seaweedfs/templates/filer-service.yaml
+++ b/k8s/seaweedfs/templates/filer-service.yaml
@@ -1,6 +1,8 @@
apiVersion: v1
kind: Service
metadata:
+ annotations:
+ service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: {{ template "seaweedfs.name" . }}-filer
namespace: {{ .Release.Namespace }}
labels:
@@ -8,6 +10,7 @@ metadata:
component: filer
spec:
clusterIP: None
+ publishNotReadyAddresses: true
ports:
- name: "swfs-filer"
port: {{ .Values.filer.port }}
@@ -17,12 +20,6 @@ spec:
port: {{ .Values.filer.grpcPort }}
targetPort: {{ .Values.filer.grpcPort }}
protocol: TCP
-{{- if .Values.filer.metricsPort }}
- - name: "swfs-filer-metrics"
- port: {{ .Values.filer.metricsPort }}
- targetPort: {{ .Values.filer.metricsPort }}
- protocol: TCP
-{{- end }}
selector:
app: {{ template "seaweedfs.name" . }}
- component: filer \ No newline at end of file
+ component: filer
diff --git a/k8s/seaweedfs/templates/filer-statefulset.yaml b/k8s/seaweedfs/templates/filer-statefulset.yaml
index a4f38830f..d284e9992 100644
--- a/k8s/seaweedfs/templates/filer-statefulset.yaml
+++ b/k8s/seaweedfs/templates/filer-statefulset.yaml
@@ -87,6 +87,12 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
+ {{- if .Values.global.extraEnvironmentVars }}
+ {{- range $key, $value := .Values.global.extraEnvironmentVars }}
+ - name: {{ $key }}
+ value: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
command:
- "/bin/sh"
- "-ec"
@@ -128,7 +134,7 @@ spec:
{{- end }}
-ip=${POD_IP} \
{{- if gt (.Values.filer.replicas | int) 1 }}
- -peers={{ range $index := until (.Values.filer.replicas | int) }}${SEAWEEDFS_FULLNAME}-filer-{{ $index }}.${SEAWEEDFS_FULLNAME}-filer:{{ $.Values.filer.port }}{{ if lt $index (sub ($.Values.filer.replicas | int) 1) }},{{ end }}{{ end }}
+ -peers=$(echo -n "{{ range $index := until (.Values.filer.replicas | int) }}${SEAWEEDFS_FULLNAME}-filer-{{ $index }}.${SEAWEEDFS_FULLNAME}-filer:{{ $.Values.filer.port }}{{ if lt $index (sub ($.Values.filer.replicas | int) 1) }},{{ end }}{{ end }}" | sed "s/$HOSTNAME.${SEAWEEDFS_FULLNAME}-filer:{{ $.Values.filer.port }}//" | sed 's/,$//; 's/^,//'; s/,,/,/;' ) \
{{- 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) }}
@@ -172,7 +178,7 @@ spec:
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
- timeoutSeconds: 3
+ timeoutSeconds: 10
livenessProbe:
httpGet:
path: /
@@ -182,7 +188,7 @@ spec:
periodSeconds: 30
successThreshold: 1
failureThreshold: 5
- timeoutSeconds: 3
+ timeoutSeconds: 10
{{- if .Values.filer.resources }}
resources:
{{ tpl .Values.filer.resources . | nindent 12 | trim }}
diff --git a/k8s/seaweedfs/templates/master-service.yaml b/k8s/seaweedfs/templates/master-service.yaml
index f7603bd91..0ce467538 100644
--- a/k8s/seaweedfs/templates/master-service.yaml
+++ b/k8s/seaweedfs/templates/master-service.yaml
@@ -10,6 +10,7 @@ metadata:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
clusterIP: None
+ publishNotReadyAddresses: true
ports:
- name: "swfs-master"
port: {{ .Values.master.port }}
@@ -21,4 +22,4 @@ spec:
protocol: TCP
selector:
app: {{ template "seaweedfs.name" . }}
- component: master \ No newline at end of file
+ component: master
diff --git a/k8s/seaweedfs/templates/master-statefulset.yaml b/k8s/seaweedfs/templates/master-statefulset.yaml
index fe90f3d81..e5a7a537a 100644
--- a/k8s/seaweedfs/templates/master-statefulset.yaml
+++ b/k8s/seaweedfs/templates/master-statefulset.yaml
@@ -76,6 +76,12 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
+ {{- if .Values.global.extraEnvironmentVars }}
+ {{- range $key, $value := .Values.global.extraEnvironmentVars }}
+ - name: {{ $key }}
+ value: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
command:
- "/bin/sh"
- "-ec"
@@ -157,7 +163,7 @@ spec:
periodSeconds: 45
successThreshold: 2
failureThreshold: 100
- timeoutSeconds: 5
+ timeoutSeconds: 10
livenessProbe:
httpGet:
path: /cluster/status
@@ -167,7 +173,7 @@ spec:
periodSeconds: 30
successThreshold: 1
failureThreshold: 4
- timeoutSeconds: 5
+ timeoutSeconds: 10
{{- if .Values.master.resources }}
resources:
{{ tpl .Values.master.resources . | nindent 12 | trim }}
diff --git a/k8s/seaweedfs/templates/s3-deployment.yaml b/k8s/seaweedfs/templates/s3-deployment.yaml
index f7244ad76..ed01758b8 100644
--- a/k8s/seaweedfs/templates/s3-deployment.yaml
+++ b/k8s/seaweedfs/templates/s3-deployment.yaml
@@ -59,11 +59,17 @@ spec:
fieldPath: metadata.namespace
- name: SEAWEEDFS_FULLNAME
value: "{{ template "seaweedfs.name" . }}"
+ {{- if .Values.global.extraEnvironmentVars }}
+ {{- range $key, $value := .Values.global.extraEnvironmentVars }}
+ - name: {{ $key }}
+ value: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
command:
- "/bin/sh"
- "-ec"
- |
- exec /usr/bin/weed \
+ exec /usr/bin/weed -logdir=/logs \
{{- if .Values.s3.loggingOverrideLevel }}
-v={{ .Values.s3.loggingOverrideLevel }} \
{{- else }}
@@ -81,9 +87,13 @@ spec:
{{- if .Values.s3.domainName }}
-domainName={{ .Values.s3.domainName }} \
{{- end }}
- -filer={{ template "seaweedfs.name" . }}-filer:{{ .Values.filer.port }}
- {{- if or (.Values.global.enableSecurity) (.Values.s3.extraVolumeMounts) }}
+ {{- if .Values.s3.allowEmptyFolder }}
+ -allowEmptyFolder={{ .Values.s3.allowEmptyFolder }} \
+ {{- end }}
+ -filer={{ template "seaweedfs.name" . }}-filer-client:{{ .Values.filer.port }}
volumeMounts:
+ - name: logs
+ mountPath: "/logs/"
{{- if .Values.global.enableSecurity }}
- name: security-config
readOnly: true
@@ -106,7 +116,6 @@ spec:
mountPath: /usr/local/share/ca-certificates/client/
{{- end }}
{{ tpl .Values.s3.extraVolumeMounts . | nindent 12 | trim }}
- {{- end }}
ports:
- containerPort: {{ .Values.s3.port }}
name: swfs-s3
@@ -119,7 +128,7 @@ spec:
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
- timeoutSeconds: 3
+ timeoutSeconds: 10
livenessProbe:
httpGet:
path: /
@@ -129,12 +138,18 @@ spec:
periodSeconds: 60
successThreshold: 1
failureThreshold: 20
- timeoutSeconds: 3
+ timeoutSeconds: 10
{{- if .Values.s3.resources }}
resources:
{{ tpl .Values.s3.resources . | nindent 12 | trim }}
{{- end }}
volumes:
+ {{- if eq .Values.s3.logs.type "hostPath" }}
+ - name: logs
+ hostPath:
+ path: /storage/logs/seaweedfs/s3
+ type: DirectoryOrCreate
+ {{- end }}
{{- if .Values.global.enableSecurity }}
- name: security-config
configMap:
diff --git a/k8s/seaweedfs/templates/volume-statefulset.yaml b/k8s/seaweedfs/templates/volume-statefulset.yaml
index 6c519f374..f9e55e0d3 100644
--- a/k8s/seaweedfs/templates/volume-statefulset.yaml
+++ b/k8s/seaweedfs/templates/volume-statefulset.yaml
@@ -64,6 +64,12 @@ spec:
fieldPath: status.hostIP
- name: SEAWEEDFS_FULLNAME
value: "{{ template "seaweedfs.name" . }}"
+ {{- if .Values.global.extraEnvironmentVars }}
+ {{- range $key, $value := .Values.global.extraEnvironmentVars }}
+ - name: {{ $key }}
+ value: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
command:
- "/bin/sh"
- "-ec"
@@ -80,6 +86,9 @@ spec:
-metricsPort {{ .Values.volume.metricsPort }} \
{{- end }}
-dir={{ .Values.volume.dir }} \
+ {{- if .Values.volume.dir_idx }}
+ -dir.idx={{ .Values.volume.dir_idx }} \
+ {{- end }}
-max={{ .Values.volume.maxVolumes }} \
{{- if .Values.volume.rack }}
-rack={{ .Values.volume.rack }} \
@@ -149,7 +158,7 @@ spec:
periodSeconds: 90
successThreshold: 1
failureThreshold: 100
- timeoutSeconds: 5
+ timeoutSeconds: 30
livenessProbe:
httpGet:
path: /status
@@ -159,7 +168,7 @@ spec:
periodSeconds: 90
successThreshold: 1
failureThreshold: 4
- timeoutSeconds: 5
+ timeoutSeconds: 30
{{- if .Values.volume.resources }}
resources:
{{ tpl .Values.volume.resources . | nindent 12 | trim }}
diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml
index 964521693..cdb9437ee 100644
--- a/k8s/seaweedfs/values.yaml
+++ b/k8s/seaweedfs/values.yaml
@@ -4,7 +4,7 @@ global:
registry: ""
repository: ""
imageName: chrislusf/seaweedfs
- imageTag: "2.20"
+ # imageTag: "2.20" - started using {.Chart.appVersion}
imagePullPolicy: IfNotPresent
imagePullSecrets: imagepullsecret
restartPolicy: Always
@@ -21,6 +21,10 @@ global:
# Y number of replica in other racks in the same data center
# Z number of replica in other servers in the same rack
replicationPlacment: "001"
+ extraEnvironmentVars:
+ WEED_CLUSTER_DEFAULT: "sw"
+ WEED_CLUSTER_SW_MASTER: "seaweedfs-master:9333"
+ WEED_CLUSTER_SW_FILER: "seaweedfs-filer-client:8888"
image:
registry: ""
@@ -140,6 +144,8 @@ volume:
# Directories to store data files. dir[,dir]... (default "/tmp")
dir: "/data"
+ # Directories to store index files. dir[,dir]... (default "/tmp")
+ dir_idx: null
# Maximum numbers of volumes, count[,count]...
# If set to zero on non-windows OS, the limit will be auto configured. (default "7")
@@ -313,6 +319,8 @@ s3:
port: 8333
metricsPort: 9327
loggingOverrideLevel: null
+ #allow empty folders
+ allowEmptyFolder: true
# Suffix of the host name, {bucket}.{domainName}
domainName: ""
@@ -343,6 +351,11 @@ s3:
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
priorityClassName: ""
+ logs:
+ type: "hostPath"
+ size: ""
+ storageClass: ""
+
cronjob:
enabled: false
schedule: "*/7 * * * *"