update and add options to the master statefulset & master cmd

support "global" setting for replication, effecting filer&master from "global" in values.yaml
This commit is contained in:
LazyDBA247-Anyvision 2020-09-10 09:27:51 +03:00
parent 2bed15f1dc
commit 138e5918fb
2 changed files with 44 additions and 0 deletions

View file

@ -70,6 +70,12 @@ spec:
fieldPath: metadata.namespace fieldPath: metadata.namespace
- name: SEAWEEDFS_FULLNAME - name: SEAWEEDFS_FULLNAME
value: "{{ template "seaweedfs.name" . }}" value: "{{ template "seaweedfs.name" . }}"
{{- if .Values.master.extraEnvironmentVars }}
{{- range $key, $value := .Values.master.extraEnvironmentVars }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- end }}
command: command:
- "/bin/sh" - "/bin/sh"
- "-ec" - "-ec"
@ -84,6 +90,11 @@ spec:
-port={{ .Values.master.port }} \ -port={{ .Values.master.port }} \
-mdir=/data \ -mdir=/data \
-ip.bind={{ .Values.master.ipBind }} \ -ip.bind={{ .Values.master.ipBind }} \
{{- if .Values.global.enableReplication }}
-defaultReplication={{ .Values.global.replicationPlacment }} \
{{- else }}
-defaultReplication={{ .Values.master.defaultReplication }} \
{{- end }}
{{- if .Values.master.volumePreallocate }} {{- if .Values.master.volumePreallocate }}
-volumePreallocate \ -volumePreallocate \
{{- end }} {{- end }}
@ -94,6 +105,15 @@ spec:
{{- if .Values.master.disableHttp }} {{- if .Values.master.disableHttp }}
-disableHttp \ -disableHttp \
{{- end }} {{- 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 \ -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 }} -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: volumeMounts:

View file

@ -14,6 +14,13 @@ global:
enabled: false enabled: false
gatewayHost: null gatewayHost: null
gatewayPort: 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: image:
registry: "" registry: ""
@ -31,8 +38,20 @@ master:
grpcPort: 19333 grpcPort: 19333
ipBind: "0.0.0.0" ipBind: "0.0.0.0"
volumePreallocate: false volumePreallocate: false
#Master stops directing writes to oversized volumes
volumeSizeLimitMB: 30000 volumeSizeLimitMB: 30000
loggingOverrideLevel: null 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 # Disable http request, only gRpc operations are allowed
disableHttp: false disableHttp: false
@ -87,6 +106,11 @@ master:
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ # ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
priorityClassName: "" 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: volume:
enabled: true enabled: true