From 6ad259a4739973e54cf54fd70d54c025d6a5e0c1 Mon Sep 17 00:00:00 2001 From: t-akervik-ericsson <22633193+tobiasake@users.noreply.github.com> Date: Fri, 20 Nov 2020 16:01:01 +0100 Subject: [PATCH] Add Persistence storage configuration handling (#57) * Add Persitence storage configuration and update Eiffel bundle to handle the new configuration configuration * add storage class parameter * Removed Size config parameter --- bundles/Eiffel/K8S/k8s_bundle_functions.bash | 4 ++++ config-default.bash | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/bundles/Eiffel/K8S/k8s_bundle_functions.bash b/bundles/Eiffel/K8S/k8s_bundle_functions.bash index adaa242..358611b 100644 --- a/bundles/Eiffel/K8S/k8s_bundle_functions.bash +++ b/bundles/Eiffel/K8S/k8s_bundle_functions.bash @@ -37,6 +37,8 @@ function execute_k8s_command_on_services { image.tag="$EIFFEL_MONGODB_VERSION" fullnameOverride="$K8S_SERVICE_EIFFEL_MONGODB" service.port="$EIFFEL_MONGODB_EXTERNAL_PORT" + persistence.enabled="$K8S_PVC_ENABLE" + persistence.storageClass="$K8S_PVC_STORAGE_CLASS" ) local valuefile="charts/charts_values/mongodb-values.yaml" local chart="charts/mongodb-9.3.1.tgz" @@ -66,6 +68,8 @@ function execute_k8s_command_on_services { fullnameOverride="$K8S_SERVICE_EIFFEL_RABBITMQ" service.nodePort="$EIFFEL_RABBITMQ_AMQP_EXTERNAL_PORT" service.managerPort="$EIFFEL_RABBITMQ_WEB_EXTERNAL_PORT" + persistence.enabled="$K8S_PVC_ENABLE" + persistence.storageClass="$K8S_PVC_STORAGE_CLASS" ) local valuefile="charts/charts_values/rabbitmq-values.yaml" local chart="charts/rabbitmq-7.7.1.tgz" diff --git a/config-default.bash b/config-default.bash index b019bf0..917538f 100644 --- a/config-default.bash +++ b/config-default.bash @@ -109,3 +109,20 @@ HELM_VERSION=V3 # ------------------------------------------------------------------------------ K8S_INGRESS_TLS_ENABLE=false K8S_INGRESS_CERT_SECRET_NAME="" + + +# ----------- Services Persistence Storage (PVC) configurations ------------------------------------- +# Some components support persitent storage in Kubernetes, e.g. MongoDb and RabbitMq in Eiffel bundle. +# When persistence storage (PVC - PersistenceVolumeClaim) is enabled, data is not lossed in case of restart of pod/container. +# There is two configurations: +# K8S_PVC_ENABLE : if set to true, then persistence storage will be used for components that support that. +# K8S_PVC_STORAGE_CLASS : If defined, storageClassName: +# If set to "-", storageClassName: "", which disables dynamic provisioning +# If undefined (the default) or set to null, no storageClassName spec is +# set, choosing the default provisioner. (gp2 on AWS, standard on +# GKE, AWS & OpenStack) +# storageClass: "-" +# +# ------------------------------------------------------------------------------ +K8S_PVC_ENABLE=false +K8S_PVC_STORAGE_CLASS="null"