IBM / wc-helmchart

Apache License 2.0
5 stars 7 forks source link

Helm charts need a PVC for Search Repeater #4

Closed b-douglas closed 6 years ago

b-douglas commented 6 years ago

They Helm Charts need a Persistent Volume claim for Search Repeater.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ .Values.Common.Tenant }}{{ .Values.Common.Environment_name}}-search-repeater-volume
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
kongyi-ibm commented 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

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 }}

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 ?

b-douglas commented 6 years ago

I don't see the search-repeater-index-volume in the chart for PersistentVolumeClaim.AutoCreate.

Can you add it for that as well?

b-douglas commented 6 years ago

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 -}}```
b-douglas commented 6 years ago

I am only see the pre-install.yaml for the search-master not for the search repeater

kongyi-ibm commented 6 years ago

@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

b-douglas commented 6 years ago

I have validated the pre-install does create the PVC for search repeater as well.