1
0

added elasticsearch persistence

This commit is contained in:
sido 2018-09-12 08:04:59 +02:00
parent 34c8f048b9
commit d17c137dd5
6 changed files with 81 additions and 25 deletions

View File

@ -80,13 +80,27 @@ Specify memory usage for Java JVM:
Select the resources you need dependant on the customer you need to serve. Select the resources you need dependant on the customer you need to serve.
## Persistence ## Persistence
You can define your own volume by enabling persistence on your MOLGENIS instance. You can also choose to retain the volume of the NFS and specify the size of the volume. You can enable persistence on your MOLGENIS stack by specifying the following property.
The following properties will setup the persistence for you.
- ```molgenis.persistence.enabled``` - ```persistence.enabled```
- ```molgenis.persistence.retain```
You can also choose to retain the volume of the NFS.
- ```persistence.retain```
The size and claim name can be specified per service. There are now two services that can be persist.
- MOLGENIS
- ElasticSearch
MOLGENIS persistent properties.
- ```molgenis.persistence.claim```
- ```molgenis.persistence.size``` - ```molgenis.persistence.size```
ElasticSearch persistent properties.
- ```elasticsearch.persistence.claim```
- ```elasticsearch.persistence.size```
### Resolve you persistent volume ### Resolve you persistent volume
You do not know which volume is attached to your MOLGENIS instance. You can resolve this by executing: You do not know which volume is attached to your MOLGENIS instance. You can resolve this by executing:

View File

@ -97,7 +97,7 @@ questions:
- "1g" - "1g"
- "2g" - "2g"
group: "Resources" group: "Resources"
- variable: molgenis.persistence.enabled - variable: persistence.enabled
default: false default: false
description: "Do you want to use persistence" description: "Do you want to use persistence"
type: boolean type: boolean
@ -106,18 +106,26 @@ questions:
label: Persistence label: Persistence
show_subquestion_if: true show_subquestion_if: true
subquestions: subquestions:
- variable: persistence.retain
default: false
description: "Do you want to retain the persistent volume"
type: boolean
label: Retain volume
- variable: molgenis.persistence.size - variable: molgenis.persistence.size
default: "30Gi"
description: "Size of MOLGENIS filestore"
type: enum
options:
- "30Gi"
- "50Gi"
- "100Gi"
label: Size filestore
- variable: elasticsearch.persistence.size
default: "50Gi" default: "50Gi"
description: "Size of MOLGENIS filestore (not the database size)" description: "Size of ElasticSearch data"
type: enum type: enum
options: options:
- "50Gi" - "50Gi"
- "100Gi" - "100Gi"
- "200Gi" - "200Gi"
- "300Gi" label: Size for ElasticSearch data
label: Size filestore
- variable: molgenis.persistence.retain
default: false
description: "Do you want to retain the persistence volume"
type: boolean
label: Retain volume

View File

@ -49,7 +49,7 @@ spec:
value: "-Xmx{{ .javaOpts.maxHeapSpace }} -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled" value: "-Xmx{{ .javaOpts.maxHeapSpace }} -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
ports: ports:
- containerPort: 8080 - containerPort: 8080
{{- if .persistence.enabled }} {{- if $.Values.persistence.enabled }}
volumeMounts: volumeMounts:
- name: molgenis-nfs - name: molgenis-nfs
mountPath: /home/molgenis mountPath: /home/molgenis
@ -92,15 +92,25 @@ spec:
ports: ports:
- containerPort: 9200 - containerPort: 9200
- containerPort: 9300 - containerPort: 9300
{{- if $.Values.persistence.enabled }}
volumeMounts:
- name: elastic-nfs
mountPath: /usr/share/elasticsearch/data
{{- end }}
resources: resources:
{{ toYaml .resources | indent 12 }} {{ toYaml .resources | indent 12 }}
{{- end }} {{- end }}
{{- if .Values.molgenis.persistence.enabled }} {{- if .Values.persistence.enabled }}
volumes: volumes:
- name: molgenis-nfs - name: molgenis-nfs
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Values.molgenis.persistence.name }} claimName: {{ .Values.molgenis.persistence.claim }}
volumes:
- name: elasticsearch-nfs
persistentVolumeClaim:
claimName: {{ .Values.elasticsearch.persistence.claim }}
{{- end }} {{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}

View File

@ -0,0 +1,20 @@
{{- if .Values.persistence.enabled -}}
apiVersion: extensions/v1beta1
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.elasticsearch.persistence.claim }}
annotations:
{{- if .Values.persistence.retain }}
volume.beta.kubernetes.io/storage-class: "nfs-provisioner-retain"
{{- else }}
volume.beta.kubernetes.io/storage-class: "nfs-provisioner"
{{- end }}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: {{ .Values.elasticsearch.persistence.size }}
{{- end }}
{{- end }}

View File

@ -1,12 +1,11 @@
{{- with .Values.molgenis.persistence }} {{- if .Values.persistence.enabled -}}
{{- if .enabled -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: {{ .name }} name: {{ .Values.molgenis.persistence.claim }}
annotations: annotations:
{{- if .retain }} {{- if .Values.persistence.retain }}
volume.beta.kubernetes.io/storage-class: "nfs-provisioner-retain" volume.beta.kubernetes.io/storage-class: "nfs-provisioner-retain"
{{- else }} {{- else }}
volume.beta.kubernetes.io/storage-class: "nfs-provisioner" volume.beta.kubernetes.io/storage-class: "nfs-provisioner"
@ -16,6 +15,6 @@ spec:
- ReadWriteMany - ReadWriteMany
resources: resources:
requests: requests:
storage: {{ .size }} storage: {{ .Values.molgenis.persistence.size }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -32,10 +32,8 @@ molgenis:
cpu: 200m cpu: 200m
memory: 1250Mi memory: 1250Mi
persistence: persistence:
enabled: false claim: molgenis-nfs-claim
retain: false size: 30Gi
name: molgenis-nfs-claim
size: 50Gi
services: services:
opencpu: opencpu:
host: localhost host: localhost
@ -62,6 +60,13 @@ elasticsearch:
requests: requests:
cpu: 100m cpu: 100m
memory: 1Gi memory: 1Gi
persistence:
claim: elasticsearch-nfs-claim
size: 50Gi
persistence:
enabled: false
retain: false
nodeSelector: { nodeSelector: {
deployPod: "true" deployPod: "true"