Closed b-douglas closed 6 years ago
@b-douglas
In current Helm Chart, we support define the PCV in values.yaml and the PVC will be auto created by helm pre-install hook
PersistenVolumeClaim: AutoCreate: false StorageClass: glusterfs AccessModes: ReadWriteMany StorageSize: 1Gi Force: false ClearPVC: false
as default, it is disabled.
In search template, we have defined the Volume which will mount the PVC if you opened the switch
{{- if .Values.Common.PersistenVolumeClaim.AutoCreate }}
name: {{ .Values.Common.Tenant }}{{ .Values.Common.EnvironmentName}}-search-repeater-index-volume persistentVolumeClaim: claimName: {{ .Values.Common.Tenant }}{{ .Values.Common.EnvironmentName}}-search-repeater-volume {{- end }}
{{- if .Values.Common.PersistenVolumeClaim.AutoCreate }}
Of course, you can define by adding PVC template, but you need to remove the condition for mount the PVC in search template.
How do you think ?
I don't see the search-repeater-index-volume
in the chart for PersistentVolumeClaim.AutoCreate.
Can you add it for that as well?
does it create it?
{{- if .Values.Common.PersistenVolumeClaim.AutoCreate }}
- name: pre-install-job-createpvc-{{ .Values.Common.Tenant | lower}}{{ .Values.Common.Environment_name | lower}}{{ .Values.Common.Environment_Type }}-{{ randAlphaNum 10 | lower }}
image: {{ .Values.Common.Image_repo }}{{ .Values.SupportC.Image }}:{{ .Values.SupportC.Tag }}
args: ['createpvc', '-tenant',{{ .Values.Common.Tenant | quote }},'-env',{{ .Values.Common.Environment_name | quote }},'-envtype',{{ .Values.Common.Environment_Type }},'-namespace',{{ .Values.Common.Namespace | quote }},'-component','search','-storage_class',{{ .Values.Common.PersistenVolumeClaim.StorageClass | quote }},'-access_modes',{{ .Values.Common.PersistenVolumeClaim.AccessModes | quote }},'-storage_size',{{ .Values.Common.PersistenVolumeClaim.StorageSize | quote }},'-force',{{ .Values.Common.PersistenVolumeClaim.Force | quote }}]
{{ end -}}```
I am only see the pre-install.yaml
for the search-master not for the search repeater
@b-douglas
Yes, the logic in pre-install is that. The backend scritps in Support Container will based on the env type be passed in to decide what PVC should be create
Here is the code snippet def _createKubePVC(parser_args,CoreV1Api): if parser_args.component=="search":
if parser_args.envtype == "auth":
_pvc_name=parser_args.tenant+parser_args.env+"-search-master-"+"volume"
elif parser_args.envtype == "live":
_pvc_name=parser_args.tenant+parser_args.env+"-search-repeater-"+"volume"
You can read the code here https://github.com/IBM/wc-devops-utilities/blob/master/scripts/kube/kube_pvc.py
I have validated the pre-install does create the PVC for search repeater as well.
They Helm Charts need a Persistent Volume claim for Search Repeater.