From 5a98e35273dde059e12c90b15253128cd622dcdc Mon Sep 17 00:00:00 2001 From: sido Date: Mon, 10 Sep 2018 21:41:54 +0200 Subject: [PATCH] added persistence properties to values and deployment --- molgenis/questions.yml | 7 +++++++ molgenis/templates/deployment.yaml | 9 ++++++--- molgenis/templates/persistence/molgenisPVC.yaml | 15 +++++++++++++++ .../persistence/molgenisPersistenceClaim.yaml | 15 --------------- molgenis/values.yaml | 7 +------ 5 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 molgenis/templates/persistence/molgenisPVC.yaml delete mode 100644 molgenis/templates/persistence/molgenisPersistenceClaim.yaml diff --git a/molgenis/questions.yml b/molgenis/questions.yml index cd0c528..278368a 100644 --- a/molgenis/questions.yml +++ b/molgenis/questions.yml @@ -101,3 +101,10 @@ questions: required: true group: "Persistence" label: Persistence + show_subquestion_if: true + - variable: molgenis.persistence.size + default: "10Gi" + description: "Size of MOLGENIS filestore (not the database size)" + type: string + label: Size filestore + diff --git a/molgenis/templates/deployment.yaml b/molgenis/templates/deployment.yaml index 5aeeff0..06708a9 100644 --- a/molgenis/templates/deployment.yaml +++ b/molgenis/templates/deployment.yaml @@ -49,10 +49,11 @@ spec: value: {{ .javaOpts }} ports: - containerPort: 8080 + {{- if .persistence.enabled }} volumeMounts: - name: molgenis-nfs - mountPath: "/home/molgenis" - restartPolicy: "Never" + mountPath: /home/molgenis + {{- end }} livenessProbe: httpGet: path: / @@ -67,10 +68,12 @@ spec: periodSeconds: 5 resources: {{ toYaml .resources | indent 12 }} + {{- if .persistence.enabled }} volumes: - name: molgenis-nfs persistentVolumeClaim: - claimName: molgenis-nfs-claim + claimName: {{ .Values.persistence.name }} + {{- end }} {{- end }} - name: elasticsearch diff --git a/molgenis/templates/persistence/molgenisPVC.yaml b/molgenis/templates/persistence/molgenisPVC.yaml new file mode 100644 index 0000000..65c07ba --- /dev/null +++ b/molgenis/templates/persistence/molgenisPVC.yaml @@ -0,0 +1,15 @@ +{{- if .Values.molgenis.persistence.enabled }} +apiVersion: extensions/v1beta1 +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.molgenis.persistence.name }} + annotations: + volume.beta.kubernetes.io/storage-class: "nfs-provisioner" + spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .Values.molgenis.persistence.size }} +{{- end }} \ No newline at end of file diff --git a/molgenis/templates/persistence/molgenisPersistenceClaim.yaml b/molgenis/templates/persistence/molgenisPersistenceClaim.yaml deleted file mode 100644 index 8c02e3d..0000000 --- a/molgenis/templates/persistence/molgenisPersistenceClaim.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.molgenis.persistence.enabled -}} -apiVersion: extensions/v1beta1 -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: molgenis-nfs-claim - annotations: - volume.beta.kubernetes.io/storage-class: "nfs-provisioner" -spec: - accessModes: - - ReadWriteMany - resources: - requests: -storage: 1Gi -{{- end }} \ No newline at end of file diff --git a/molgenis/values.yaml b/molgenis/values.yaml index 6aa4016..a0151d7 100644 --- a/molgenis/values.yaml +++ b/molgenis/values.yaml @@ -32,13 +32,8 @@ molgenis: memory: 1Gi persistence: enabled: false - name: molgenis-nexus-data - storageClass: nfs-class + name: molgenis-nfs-claim size: 30G - reclaimPolicy: Retain - server: 192.168.64.12 - accessMode: ReadWriteMany - mountPath: /gcc/molgenis/nexus services: opencpu: host: localhost