From 8b553312478a7730218846c7fc9d6600be371fc0 Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:11:50 +0200 Subject: [PATCH 1/9] appVersion start publishing and using appVersion as the image tag, so its clear that the appVersion of the chart and containers are the same. --- k8s/seaweedfs/Chart.yaml | 3 ++- k8s/seaweedfs/templates/_helpers.tpl | 14 +++++++------- k8s/seaweedfs/values.yaml | 2 +- 3 files changed, 10 insertions(+), 9 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/values.yaml b/k8s/seaweedfs/values.yaml index 9d621a496..1ae7be731 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -4,7 +4,7 @@ global: registry: "" repository: "" imageName: chrislusf/seaweedfs - imageTag: "2.19" + # imageTag: "2.20" - started using {.Chart.appVersion} imagePullPolicy: IfNotPresent imagePullSecrets: imagepullsecret restartPolicy: Always From 8491fbf1c7e435016cc8eadf8079763c690c3fbd Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:13:07 +0200 Subject: [PATCH 2/9] fix cronjob reschedule avoid errors of "more than 100 jobs skipped/failed" and stopping of job by k8s --- k8s/seaweedfs/templates/cronjob.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 }} From cfc2033bf84dbff131c4e7afceae8b51a5cc88e9 Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:15:47 +0200 Subject: [PATCH 3/9] shell.toml enable running shell from each pod with default filer & master config --- k8s/seaweedfs/templates/filer-statefulset.yaml | 6 ++++++ k8s/seaweedfs/templates/master-statefulset.yaml | 6 ++++++ k8s/seaweedfs/templates/s3-deployment.yaml | 6 ++++++ k8s/seaweedfs/templates/volume-statefulset.yaml | 6 ++++++ k8s/seaweedfs/values.yaml | 4 ++++ 5 files changed, 28 insertions(+) diff --git a/k8s/seaweedfs/templates/filer-statefulset.yaml b/k8s/seaweedfs/templates/filer-statefulset.yaml index a4f38830f..f54d7d455 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" diff --git a/k8s/seaweedfs/templates/master-statefulset.yaml b/k8s/seaweedfs/templates/master-statefulset.yaml index fe90f3d81..48a42f155 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" diff --git a/k8s/seaweedfs/templates/s3-deployment.yaml b/k8s/seaweedfs/templates/s3-deployment.yaml index f7244ad76..82644bde7 100644 --- a/k8s/seaweedfs/templates/s3-deployment.yaml +++ b/k8s/seaweedfs/templates/s3-deployment.yaml @@ -59,6 +59,12 @@ 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" diff --git a/k8s/seaweedfs/templates/volume-statefulset.yaml b/k8s/seaweedfs/templates/volume-statefulset.yaml index 6c519f374..4dcbf634d 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" diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml index 1ae7be731..3737a7bd9 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -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: "" From 5e62f77681c77169111051157230181ef19fba95 Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:16:39 +0200 Subject: [PATCH 4/9] dir.idx volume config enable setting dir.idx for volume server --- k8s/seaweedfs/templates/volume-statefulset.yaml | 3 +++ k8s/seaweedfs/values.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/k8s/seaweedfs/templates/volume-statefulset.yaml b/k8s/seaweedfs/templates/volume-statefulset.yaml index 4dcbf634d..fff48095b 100644 --- a/k8s/seaweedfs/templates/volume-statefulset.yaml +++ b/k8s/seaweedfs/templates/volume-statefulset.yaml @@ -86,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 }} \ diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml index 3737a7bd9..d2b4b1956 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -144,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") From 9ca1787e7ec19d29d9bea518e365f2bb226e1873 Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:17:34 +0200 Subject: [PATCH 5/9] s3 allowEmptyFolder enable setting allowEmptyFolder for s3 server --- k8s/seaweedfs/templates/s3-deployment.yaml | 6 ++++-- k8s/seaweedfs/values.yaml | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/k8s/seaweedfs/templates/s3-deployment.yaml b/k8s/seaweedfs/templates/s3-deployment.yaml index 82644bde7..794d4da30 100644 --- a/k8s/seaweedfs/templates/s3-deployment.yaml +++ b/k8s/seaweedfs/templates/s3-deployment.yaml @@ -87,8 +87,10 @@ 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: {{- if .Values.global.enableSecurity }} - name: security-config diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml index d2b4b1956..632bbd440 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -319,6 +319,8 @@ s3: port: 8333 metricsPort: 9327 loggingOverrideLevel: null + #allow empty folders + allowEmptyFolder: true # Suffix of the host name, {bucket}.{domainName} domainName: "" From e57e6d667702680d19eba6c5a282aafdfbb7d91d Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:18:24 +0200 Subject: [PATCH 6/9] s3 logs set logs to hostpath same as other pods --- k8s/seaweedfs/templates/s3-deployment.yaml | 10 +++++++++- k8s/seaweedfs/values.yaml | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/k8s/seaweedfs/templates/s3-deployment.yaml b/k8s/seaweedfs/templates/s3-deployment.yaml index 794d4da30..46bf91d85 100644 --- a/k8s/seaweedfs/templates/s3-deployment.yaml +++ b/k8s/seaweedfs/templates/s3-deployment.yaml @@ -69,7 +69,7 @@ spec: - "/bin/sh" - "-ec" - | - exec /usr/bin/weed \ + exec /usr/bin/weed -logdir=/logs \ {{- if .Values.s3.loggingOverrideLevel }} -v={{ .Values.s3.loggingOverrideLevel }} \ {{- else }} @@ -92,6 +92,8 @@ spec: {{- end }} -filer={{ template "seaweedfs.name" . }}-filer-client:{{ .Values.filer.port }} volumeMounts: + - name: logs + mountPath: "/logs/" {{- if .Values.global.enableSecurity }} - name: security-config readOnly: true @@ -143,6 +145,12 @@ spec: {{ 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/values.yaml b/k8s/seaweedfs/values.yaml index 632bbd440..cdb9437ee 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -351,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 * * * *" From c1ed647dafae94b1e784c09f9b595105ed69a1f1 Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:23:44 +0200 Subject: [PATCH 7/9] increase timeout reduce unwanted k8s pod restarts on slow response --- k8s/seaweedfs/templates/filer-statefulset.yaml | 4 ++-- k8s/seaweedfs/templates/master-statefulset.yaml | 4 ++-- k8s/seaweedfs/templates/s3-deployment.yaml | 5 ++--- k8s/seaweedfs/templates/volume-statefulset.yaml | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/k8s/seaweedfs/templates/filer-statefulset.yaml b/k8s/seaweedfs/templates/filer-statefulset.yaml index f54d7d455..023b0d5b9 100644 --- a/k8s/seaweedfs/templates/filer-statefulset.yaml +++ b/k8s/seaweedfs/templates/filer-statefulset.yaml @@ -178,7 +178,7 @@ spec: periodSeconds: 15 successThreshold: 1 failureThreshold: 100 - timeoutSeconds: 3 + timeoutSeconds: 10 livenessProbe: httpGet: path: / @@ -188,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-statefulset.yaml b/k8s/seaweedfs/templates/master-statefulset.yaml index 48a42f155..e5a7a537a 100644 --- a/k8s/seaweedfs/templates/master-statefulset.yaml +++ b/k8s/seaweedfs/templates/master-statefulset.yaml @@ -163,7 +163,7 @@ spec: periodSeconds: 45 successThreshold: 2 failureThreshold: 100 - timeoutSeconds: 5 + timeoutSeconds: 10 livenessProbe: httpGet: path: /cluster/status @@ -173,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 46bf91d85..ed01758b8 100644 --- a/k8s/seaweedfs/templates/s3-deployment.yaml +++ b/k8s/seaweedfs/templates/s3-deployment.yaml @@ -116,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 @@ -129,7 +128,7 @@ spec: periodSeconds: 15 successThreshold: 1 failureThreshold: 100 - timeoutSeconds: 3 + timeoutSeconds: 10 livenessProbe: httpGet: path: / @@ -139,7 +138,7 @@ spec: periodSeconds: 60 successThreshold: 1 failureThreshold: 20 - timeoutSeconds: 3 + timeoutSeconds: 10 {{- if .Values.s3.resources }} resources: {{ tpl .Values.s3.resources . | nindent 12 | trim }} diff --git a/k8s/seaweedfs/templates/volume-statefulset.yaml b/k8s/seaweedfs/templates/volume-statefulset.yaml index fff48095b..f9e55e0d3 100644 --- a/k8s/seaweedfs/templates/volume-statefulset.yaml +++ b/k8s/seaweedfs/templates/volume-statefulset.yaml @@ -158,7 +158,7 @@ spec: periodSeconds: 90 successThreshold: 1 failureThreshold: 100 - timeoutSeconds: 5 + timeoutSeconds: 30 livenessProbe: httpGet: path: /status @@ -168,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 }} From d595b35ca7cf16be7024a7d3c971ac775b0ee64c Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:26:50 +0200 Subject: [PATCH 8/9] filer peers & client service in order to start several filers with peers setting, they need to be discoverable by dns name, we need a service with - tolerate-unready-endpoints: "true" - publishNotReadyAddresses: true so the filer will start and "See" each other... added "client" service which expose only ready and line filer changed s3 config to use the new service --- .../templates/filer-service-client.yaml | 31 +++++++++++++++++++ k8s/seaweedfs/templates/filer-service.yaml | 11 +++---- .../templates/filer-statefulset.yaml | 2 +- 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 k8s/seaweedfs/templates/filer-service-client.yaml 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 023b0d5b9..d284e9992 100644 --- a/k8s/seaweedfs/templates/filer-statefulset.yaml +++ b/k8s/seaweedfs/templates/filer-statefulset.yaml @@ -134,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) }} From 95982e0856dcde5cd7542532367c436503d39a7a Mon Sep 17 00:00:00 2001 From: LazyDBA247-Anyvision Date: Wed, 13 Jan 2021 22:27:27 +0200 Subject: [PATCH 9/9] correct master service should have also: publishNotReadyAddresses: true --- k8s/seaweedfs/templates/master-service.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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