add option for existingClaim usage to master-statefulset, fix naming in volume-statefulset
This commit is contained in:
@@ -175,6 +175,15 @@ Inject extra environment vars in the format key:value, if populated
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* check if any Master existingClaim is defined */}}
|
||||||
|
{{- define "master.existing_claims" -}}
|
||||||
|
{{- if or (eq .Values.master.data.type "existingClaim") (eq .Values.master.logs.type "existingClaim") -}}
|
||||||
|
{{- printf "true" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/* check if any InitContainers exist for Volumes */}}
|
{{/* check if any InitContainers exist for Volumes */}}
|
||||||
{{- define "volume.initContainers_exists" -}}
|
{{- define "volume.initContainers_exists" -}}
|
||||||
{{- if or (not (empty .Values.volume.dir_idx )) (not (empty .Values.volume.initContainers )) -}}
|
{{- if or (not (empty .Values.volume.dir_idx )) (not (empty .Values.volume.initContainers )) -}}
|
||||||
|
|||||||
@@ -213,7 +213,8 @@ spec:
|
|||||||
{{ tpl .Values.master.resources . | nindent 12 | trim }}
|
{{ tpl .Values.master.resources . | nindent 12 | trim }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $hostpath_exists := include "master.hostpath_exists" . -}}
|
{{- $hostpath_exists := include "master.hostpath_exists" . -}}
|
||||||
{{- if $hostpath_exists }}
|
{{- $existing_claims := include "master.existing_claims" . -}}
|
||||||
|
{{- if or ($hostpath_exists) ($existing_claims) }}
|
||||||
volumes:
|
volumes:
|
||||||
{{- if eq .Values.master.logs.type "hostPath" }}
|
{{- if eq .Values.master.logs.type "hostPath" }}
|
||||||
- name: seaweedfs-master-log-volume
|
- name: seaweedfs-master-log-volume
|
||||||
@@ -221,12 +222,22 @@ spec:
|
|||||||
path: {{ .Values.master.logs.hostPathPrefix }}/logs/seaweedfs/master
|
path: {{ .Values.master.logs.hostPathPrefix }}/logs/seaweedfs/master
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if eq .Values.master.logs.type "existingClaim" }}
|
||||||
|
- name: logs
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Values.master.logs.claimName }}
|
||||||
|
{{- 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:
|
||||||
path: {{ .Values.master.data.hostPathPrefix }}/seaweed-master/
|
path: {{ .Values.master.data.hostPathPrefix }}/seaweed-master/
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if eq .Values.master.data.type "existingClaim" }}
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Values.master.data.claimName }}
|
||||||
|
{{- end }}
|
||||||
- name: master-config
|
- name: master-config
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ template "seaweedfs.name" . }}-master-config
|
name: {{ template "seaweedfs.name" . }}-master-config
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ spec:
|
|||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .Values.volume.idx.type "existingClaim" }}
|
{{- if eq .Values.volume.idx.type "existingClaim" }}
|
||||||
- name: data
|
- name: idx
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ .Values.volume.idx.claimName }}
|
claimName: {{ .Values.volume.idx.claimName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -250,7 +250,7 @@ spec:
|
|||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .Values.volume.logs.type "existingClaim" }}
|
{{- if eq .Values.volume.logs.type "existingClaim" }}
|
||||||
- name: data
|
- name: logs
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ .Values.volume.data.claimName }}
|
claimName: {{ .Values.volume.data.claimName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user