aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--k8s/seaweedfs/templates/master-statefulset.yaml20
-rw-r--r--k8s/seaweedfs/values.yaml24
2 files changed, 44 insertions, 0 deletions
diff --git a/k8s/seaweedfs/templates/master-statefulset.yaml b/k8s/seaweedfs/templates/master-statefulset.yaml
index 32d03a453..fe90f3d81 100644
--- a/k8s/seaweedfs/templates/master-statefulset.yaml
+++ b/k8s/seaweedfs/templates/master-statefulset.yaml
@@ -70,6 +70,12 @@ spec:
fieldPath: metadata.namespace
- name: SEAWEEDFS_FULLNAME
value: "{{ template "seaweedfs.name" . }}"
+ {{- if .Values.master.extraEnvironmentVars }}
+ {{- range $key, $value := .Values.master.extraEnvironmentVars }}
+ - name: {{ $key }}
+ value: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
command:
- "/bin/sh"
- "-ec"
@@ -84,6 +90,11 @@ spec:
-port={{ .Values.master.port }} \
-mdir=/data \
-ip.bind={{ .Values.master.ipBind }} \
+ {{- if .Values.global.enableReplication }}
+ -defaultReplication={{ .Values.global.replicationPlacment }} \
+ {{- else }}
+ -defaultReplication={{ .Values.master.defaultReplication }} \
+ {{- end }}
{{- if .Values.master.volumePreallocate }}
-volumePreallocate \
{{- end }}
@@ -94,6 +105,15 @@ spec:
{{- if .Values.master.disableHttp }}
-disableHttp \
{{- end }}
+ {{- if .Values.master.pulseSeconds }}
+ -pulseSeconds={{ .Values.master.pulseSeconds }} \
+ {{- end }}
+ {{- if .Values.master.garbageThreshold }}
+ -garbageThreshold={{ .Values.master.garbageThreshold }} \
+ {{- end }}
+ {{- if .Values.master.metricsIntervalSec }}
+ -metrics.intervalSeconds={{ .Values.master.metricsIntervalSec }} \
+ {{- end }}
-ip=${POD_NAME}.${SEAWEEDFS_FULLNAME}-master \
-peers={{ 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 }}
volumeMounts:
diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml
index 3e1bce181..4a3c7712d 100644
--- a/k8s/seaweedfs/values.yaml
+++ b/k8s/seaweedfs/values.yaml
@@ -14,6 +14,13 @@ global:
enabled: false
gatewayHost: null
gatewayPort: null
+ # if enabled will use global.replicationPlacment and override master & filer defaultReplicaPlacement config
+ enableReplication: false
+ # replication type is XYZ:
+ # X number of replica in other data centers
+ # 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"
image:
registry: ""
@@ -31,8 +38,20 @@ master:
grpcPort: 19333
ipBind: "0.0.0.0"
volumePreallocate: false
+ #Master stops directing writes to oversized volumes
volumeSizeLimitMB: 30000
loggingOverrideLevel: null
+ #number of seconds between heartbeats, default 5
+ pulseSeconds: null
+ #threshold to vacuum and reclaim spaces, default 0.3 (30%)
+ garbageThreshold: null
+ #Prometheus push interval in seconds, default 15
+ metricsIntervalSec: 15
+ # replication type is XYZ:
+ # X number of replica in other data centers
+ # Y number of replica in other racks in the same data center
+ # Z number of replica in other servers in the same rack
+ defaultReplication: "000"
# Disable http request, only gRpc operations are allowed
disableHttp: false
@@ -87,6 +106,11 @@ master:
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
priorityClassName: ""
+ extraEnvironmentVars:
+ WEED_MASTER_VOLUME_GROWTH_COPY_1: 7
+ WEED_MASTER_VOLUME_GROWTH_COPY_2: 6
+ WEED_MASTER_VOLUME_GROWTH_COPY_3: 3
+ WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
volume:
enabled: true