From 12dc9146f86f7bf80698558668c6a194168dced6 Mon Sep 17 00:00:00 2001 From: Claude Dioudonnat Date: Mon, 28 Aug 2023 16:16:49 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(apps)=20add=20variable=20to=20customi?= =?UTF-8?q?ze=20PVC=20name=20(#780)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NAS migration will change the PVC name, but the PVC name are hard coded in the resource definition. For all PVC a variable is add to allow the override the persistent volume name or use the original name. --- CHANGELOG.md | 4 ++++ apps/ashley/templates/services/app/deploy.yml.j2 | 4 ++-- .../templates/services/app/job_01_collectstatic.yml.j2 | 2 +- apps/ashley/templates/services/nginx/deploy.yml.j2 | 4 ++-- apps/ashley/templates/volumes/media.yml.j2 | 2 +- apps/ashley/templates/volumes/static.yml.j2 | 2 +- apps/ashley/vars/all/main.yml | 2 ++ apps/edxapp/templates/services/cms/_deploy_base.yml.j2 | 8 ++++---- .../services/cms/job_01_create_directories.yml.j2 | 8 ++++---- .../services/cms/job_02_internationalization.yml.j2 | 2 +- .../templates/services/cms/job_04_db_migrate.yml.j2 | 2 +- .../templates/services/cms/job_05_load_fixtures.yml.j2 | 4 ++-- .../templates/services/lms/job_03_db_migrate.yml.j2 | 2 +- apps/edxapp/templates/services/nginx/deploy.yml.j2 | 4 ++-- apps/edxapp/templates/volumes/data.yml.j2 | 2 +- apps/edxapp/templates/volumes/export.yml.j2 | 2 +- apps/edxapp/templates/volumes/locale.yml.j2 | 2 +- apps/edxapp/templates/volumes/media.yml.j2 | 2 +- apps/edxapp/vars/all/main.yml | 10 ++++++++++ apps/edxec/templates/services/app/deploy.yml.j2 | 4 ++-- .../templates/services/app/job_00_collectstatic.yml.j2 | 2 +- apps/edxec/templates/services/nginx/deploy.yml.j2 | 4 ++-- apps/edxec/templates/volumes/media.yml.j2 | 2 +- apps/edxec/templates/volumes/static.yml.j2 | 2 +- apps/edxec/vars/all/main.yml | 4 ++++ .../services/app/job_01_set_index_template.yml.j2 | 2 +- .../templates/services/app/job_02_set_passwords.yml.j2 | 2 +- apps/elasticsearch/templates/services/app/sts.yml.j2 | 4 ++-- apps/elasticsearch/templates/volumes/bootstrap.yml.j2 | 2 +- apps/elasticsearch/vars/all/main.yml | 1 + .../templates/services/app/job_writevolume.yml.j2 | 2 +- apps/hello/templates/volumes/hello.yml.j2 | 2 +- apps/hello/vars/all/main.yml | 3 +++ .../templates/services/app/job_01_install.yml.j2 | 2 +- apps/nextcloud/templates/volumes/install.yml.j2 | 2 +- apps/nextcloud/vars/all/main.yml | 1 + apps/prosody/templates/services/app/deploy.yml.j2 | 2 +- apps/prosody/templates/volumes/storage.yml.j2 | 2 +- apps/prosody/vars/all/main.yml | 1 + apps/redis-sentinel/templates/services/app/svc.yml.j2 | 4 ++-- apps/redis-sentinel/vars/all/main.yml | 7 +++++++ apps/redis/templates/services/app/deploy.yml.j2 | 2 +- apps/redis/templates/volumes/data.yml.j2 | 2 +- apps/redis/vars/all/main.yml | 4 ++++ apps/richie/templates/services/app/deploy.yml.j2 | 2 +- .../services/app/job_03_bootstrap_elasticsearch.yml.j2 | 2 +- apps/richie/templates/services/nginx/deploy.yml.j2 | 2 +- apps/richie/templates/volumes/media.yml.j2 | 2 +- apps/richie/vars/all/main.yml | 1 + 49 files changed, 90 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfc73dcc6..4b323c20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +### Changed + +- Add variables to override persistent volume names + ## [6.18.0] - 2023-07-03 ### Changed diff --git a/apps/ashley/templates/services/app/deploy.yml.j2 b/apps/ashley/templates/services/app/deploy.yml.j2 index 88e4abef8..2764edf49 100644 --- a/apps/ashley/templates/services/app/deploy.yml.j2 +++ b/apps/ashley/templates/services/app/deploy.yml.j2 @@ -91,12 +91,12 @@ spec: {% if ashley_should_activate_media_volume %} - name: ashley-v-media persistentVolumeClaim: - claimName: ashley-pvc-media + claimName: "{{ ashley_pvc_media_name }}" {% endif %} {% if ashley_should_activate_static_volume %} - name: ashley-v-static persistentVolumeClaim: - claimName: ashley-pvc-static + claimName: "{{ ashley_pvc_static_name }}" {% endif %} securityContext: runAsUser: {{ container_uid }} diff --git a/apps/ashley/templates/services/app/job_01_collectstatic.yml.j2 b/apps/ashley/templates/services/app/job_01_collectstatic.yml.j2 index 3469d3b5a..54e258757 100644 --- a/apps/ashley/templates/services/app/job_01_collectstatic.yml.j2 +++ b/apps/ashley/templates/services/app/job_01_collectstatic.yml.j2 @@ -55,7 +55,7 @@ spec: name: ashley-app-{{ deployment_stamp }} - name: ashley-v-static persistentVolumeClaim: - claimName: ashley-pvc-static + claimName: "{{ ashley_pvc_static_name }}" {% endif %} securityContext: runAsUser: {{ container_uid }} diff --git a/apps/ashley/templates/services/nginx/deploy.yml.j2 b/apps/ashley/templates/services/nginx/deploy.yml.j2 index 6169da97a..5958d66bd 100644 --- a/apps/ashley/templates/services/nginx/deploy.yml.j2 +++ b/apps/ashley/templates/services/nginx/deploy.yml.j2 @@ -92,12 +92,12 @@ spec: {% if ashley_should_activate_media_volume %} - name: ashley-v-media persistentVolumeClaim: - claimName: ashley-pvc-media + claimName: "{{ ashley_pvc_media_name }}" {% endif %} {% if ashley_should_activate_static_volume %} - name: ashley-v-static persistentVolumeClaim: - claimName: ashley-pvc-static + claimName: "{{ ashley_pvc_static_name }}" {% endif %} {% if activate_http_basic_auth or ashley_activate_http_basic_auth %} - name: ashley-htpasswd diff --git a/apps/ashley/templates/volumes/media.yml.j2 b/apps/ashley/templates/volumes/media.yml.j2 index d6e5ad363..a4cdcb79f 100644 --- a/apps/ashley/templates/volumes/media.yml.j2 +++ b/apps/ashley/templates/volumes/media.yml.j2 @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: ashley-pvc-media + name: "{{ ashley_pvc_media_name }}" namespace: "{{ namespace_name }}" labels: app: ashley diff --git a/apps/ashley/templates/volumes/static.yml.j2 b/apps/ashley/templates/volumes/static.yml.j2 index 7fdcc17d2..f0451d718 100644 --- a/apps/ashley/templates/volumes/static.yml.j2 +++ b/apps/ashley/templates/volumes/static.yml.j2 @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: ashley-pvc-static + name: "{{ ashley_pvc_static_name }}" namespace: "{{ namespace_name }}" labels: app: ashley diff --git a/apps/ashley/vars/all/main.yml b/apps/ashley/vars/all/main.yml index 2e9e64f4f..148bdcc0c 100644 --- a/apps/ashley/vars/all/main.yml +++ b/apps/ashley/vars/all/main.yml @@ -69,6 +69,8 @@ ashley_media_volume_size: 2Gi ashley_static_volume_size: 1Gi ashley_should_activate_media_volume: true ashley_should_activate_static_volume: true +ashley_pvc_media_name: "ashley-pvc-media" +ashley_pvc_static_name: "ashley-pvc-static" # -- resources requests {% set app_resources = { diff --git a/apps/edxapp/templates/services/cms/_deploy_base.yml.j2 b/apps/edxapp/templates/services/cms/_deploy_base.yml.j2 index f147d7ed6..0d3cd8d4c 100644 --- a/apps/edxapp/templates/services/cms/_deploy_base.yml.j2 +++ b/apps/edxapp/templates/services/cms/_deploy_base.yml.j2 @@ -174,15 +174,15 @@ spec: secretName: "{{ edxapp_secret_name }}" - name: edxapp-v-media persistentVolumeClaim: - claimName: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + claimName: "{{ edxapp_pvc_media_name }}" - name: edxapp-v-data persistentVolumeClaim: - claimName: edxapp-pvc-data + claimName: "{{ edxapp_pvc_data_name }}" - name: edxapp-v-export persistentVolumeClaim: - claimName: edxapp-pvc-export + claimName: "{{ edxapp_pvc_export_name }}" {% if edxapp_should_update_i18n %} - name: edxapp-v-locale persistentVolumeClaim: - claimName: edxapp-pvc-locale + claimName: "{{ edxapp_pvc_locale_name }}" {% endif %} diff --git a/apps/edxapp/templates/services/cms/job_01_create_directories.yml.j2 b/apps/edxapp/templates/services/cms/job_01_create_directories.yml.j2 index 290d390c8..e805bbf27 100644 --- a/apps/edxapp/templates/services/cms/job_01_create_directories.yml.j2 +++ b/apps/edxapp/templates/services/cms/job_01_create_directories.yml.j2 @@ -54,15 +54,15 @@ spec: volumes: - name: edxapp-v-media persistentVolumeClaim: - claimName: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + claimName: "{{ edxapp_pvc_media_name }}" - name: edxapp-v-data persistentVolumeClaim: - claimName: edxapp-pvc-data + claimName: "{{ edxapp_pvc_data_name }}" - name: edxapp-v-export persistentVolumeClaim: - claimName: edxapp-pvc-export + claimName: "{{ edxapp_pvc_export_name }}" {% if edxapp_should_update_i18n %} - name: edxapp-v-locale persistentVolumeClaim: - claimName: edxapp-pvc-locale + claimName: "{{ edxapp_pvc_locale_name }}" {% endif %} diff --git a/apps/edxapp/templates/services/cms/job_02_internationalization.yml.j2 b/apps/edxapp/templates/services/cms/job_02_internationalization.yml.j2 index 39b4fe834..12e261b1a 100644 --- a/apps/edxapp/templates/services/cms/job_02_internationalization.yml.j2 +++ b/apps/edxapp/templates/services/cms/job_02_internationalization.yml.j2 @@ -75,6 +75,6 @@ spec: volumes: - name: edxapp-v-locale persistentVolumeClaim: - claimName: edxapp-pvc-locale + claimName: "{{ edxapp_pvc_locale_name }}" restartPolicy: Never {% endif %} diff --git a/apps/edxapp/templates/services/cms/job_04_db_migrate.yml.j2 b/apps/edxapp/templates/services/cms/job_04_db_migrate.yml.j2 index 25a6856db..8e3831003 100644 --- a/apps/edxapp/templates/services/cms/job_04_db_migrate.yml.j2 +++ b/apps/edxapp/templates/services/cms/job_04_db_migrate.yml.j2 @@ -85,5 +85,5 @@ spec: secretName: "{{ edxapp_secret_name }}" - name: edxapp-v-media persistentVolumeClaim: - claimName: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + claimName: "{{ edxapp_pvc_media_name }}" restartPolicy: Never diff --git a/apps/edxapp/templates/services/cms/job_05_load_fixtures.yml.j2 b/apps/edxapp/templates/services/cms/job_05_load_fixtures.yml.j2 index 9c6b0494d..6717ab77a 100644 --- a/apps/edxapp/templates/services/cms/job_05_load_fixtures.yml.j2 +++ b/apps/edxapp/templates/services/cms/job_05_load_fixtures.yml.j2 @@ -101,9 +101,9 @@ spec: secretName: "{{ edxapp_secret_name }}" - name: edxapp-v-media persistentVolumeClaim: - claimName: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + claimName: "{{ edxapp_pvc_media_name }}" - name: edxapp-v-data persistentVolumeClaim: - claimName: edxapp-pvc-data + claimName: "{{ edxapp_pvc_data_name }}" restartPolicy: Never {% endif %} diff --git a/apps/edxapp/templates/services/lms/job_03_db_migrate.yml.j2 b/apps/edxapp/templates/services/lms/job_03_db_migrate.yml.j2 index 8258cbd17..54d5034d8 100644 --- a/apps/edxapp/templates/services/lms/job_03_db_migrate.yml.j2 +++ b/apps/edxapp/templates/services/lms/job_03_db_migrate.yml.j2 @@ -85,5 +85,5 @@ spec: secretName: "{{ edxapp_secret_name }}" - name: edxapp-v-media persistentVolumeClaim: - claimName: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + claimName: "{{ edxapp_pvc_media_name }}" restartPolicy: Never diff --git a/apps/edxapp/templates/services/nginx/deploy.yml.j2 b/apps/edxapp/templates/services/nginx/deploy.yml.j2 index 382abc459..fad17825d 100644 --- a/apps/edxapp/templates/services/nginx/deploy.yml.j2 +++ b/apps/edxapp/templates/services/nginx/deploy.yml.j2 @@ -87,10 +87,10 @@ spec: name: "edxapp-nginx-{{ deployment_stamp }}" - name: edxapp-v-media persistentVolumeClaim: - claimName: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + claimName: "{{ edxapp_pvc_media_name }}" - name: edxapp-v-export persistentVolumeClaim: - claimName: edxapp-pvc-export + claimName: "{{ edxapp_pvc_export_name }}" {% if activate_http_basic_auth or edxapp_activate_http_basic_auth -%} - name: edxapp-htpasswd secret: diff --git a/apps/edxapp/templates/volumes/data.yml.j2 b/apps/edxapp/templates/volumes/data.yml.j2 index 0f7f7455a..8889c4c57 100644 --- a/apps/edxapp/templates/volumes/data.yml.j2 +++ b/apps/edxapp/templates/volumes/data.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: edxapp-pvc-data + name: "{{ edxapp_pvc_data_name }}" namespace: "{{ namespace_name }}" labels: app: edxapp diff --git a/apps/edxapp/templates/volumes/export.yml.j2 b/apps/edxapp/templates/volumes/export.yml.j2 index 7a7f007fc..472232c98 100644 --- a/apps/edxapp/templates/volumes/export.yml.j2 +++ b/apps/edxapp/templates/volumes/export.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: edxapp-pvc-export + name: "{{ edxapp_pvc_export_name }}" namespace: "{{ namespace_name }}" labels: app: edxapp diff --git a/apps/edxapp/templates/volumes/locale.yml.j2 b/apps/edxapp/templates/volumes/locale.yml.j2 index 8307a0aac..25bb023b4 100644 --- a/apps/edxapp/templates/volumes/locale.yml.j2 +++ b/apps/edxapp/templates/volumes/locale.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: edxapp-pvc-locale + name: "{{ edxapp_pvc_locale_name }}" namespace: "{{ namespace_name }}" labels: app: edxapp diff --git a/apps/edxapp/templates/volumes/media.yml.j2 b/apps/edxapp/templates/volumes/media.yml.j2 index 24e86ffcc..196756555 100644 --- a/apps/edxapp/templates/volumes/media.yml.j2 +++ b/apps/edxapp/templates/volumes/media.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: "{{ edxapp_pvc_media_name | default("edxapp-pvc-media") }}" + name: "{{ edxapp_pvc_media_name }}" namespace: "{{ namespace_name }}" labels: app: edxapp diff --git a/apps/edxapp/vars/all/main.yml b/apps/edxapp/vars/all/main.yml index 0aa94fe0c..54f3302c7 100644 --- a/apps/edxapp/vars/all/main.yml +++ b/apps/edxapp/vars/all/main.yml @@ -26,6 +26,16 @@ edxapp_i18n_languages: - fr edxapp_tx_secret_name: "edxapp-tx-{{ edxapp_vault_checksum | default('undefined_edxapp_vault_checksum') }}" +# -- pvc +# Persitent volume name use for media +edxapp_pvc_media_name: "edxapp-pvc-media" +edxapp_pvc_data_name: "edxapp-pvc-data" +edxapp_pvc_export_name: "edxapp-pvc-export" +edxapp_pvc_locale_name: "edxapp-pvc-locale" + +# -- volumes + + # -- volumes size edxapp_data_volume_size: 2Gi edxapp_media_volume_size: 2Gi diff --git a/apps/edxec/templates/services/app/deploy.yml.j2 b/apps/edxec/templates/services/app/deploy.yml.j2 index fb81d7919..16e9c6a77 100644 --- a/apps/edxec/templates/services/app/deploy.yml.j2 +++ b/apps/edxec/templates/services/app/deploy.yml.j2 @@ -94,7 +94,7 @@ spec: secretName: "{{ edxec_secret_name }}" - name: edxec-v-media persistentVolumeClaim: - claimName: edxec-pvc-media + claimName: "{{ edxec_pvc_media_name }}" - name: edxec-v-static persistentVolumeClaim: - claimName: edxec-pvc-static + claimName: "{{ edxec_pvc_static_name }}" \ No newline at end of file diff --git a/apps/edxec/templates/services/app/job_00_collectstatic.yml.j2 b/apps/edxec/templates/services/app/job_00_collectstatic.yml.j2 index 08f2cae88..d6017e1e6 100644 --- a/apps/edxec/templates/services/app/job_00_collectstatic.yml.j2 +++ b/apps/edxec/templates/services/app/job_00_collectstatic.yml.j2 @@ -80,5 +80,5 @@ spec: secretName: "{{ edxec_secret_name }}" - name: edxec-v-static persistentVolumeClaim: - claimName: edxec-pvc-static + claimName: "{{ edxec_pvc_static_name }}" restartPolicy: Never diff --git a/apps/edxec/templates/services/nginx/deploy.yml.j2 b/apps/edxec/templates/services/nginx/deploy.yml.j2 index 1e965a1be..1c29f2156 100644 --- a/apps/edxec/templates/services/nginx/deploy.yml.j2 +++ b/apps/edxec/templates/services/nginx/deploy.yml.j2 @@ -87,10 +87,10 @@ spec: name: edxec-nginx-{{ deployment_stamp }} - name: edxec-v-media persistentVolumeClaim: - claimName: edxec-pvc-media + claimName: "{{ edxec_pvc_media_name }}" - name: edxec-v-static persistentVolumeClaim: - claimName: edxec-pvc-static + claimName: "{{ edxec_pvc_static_name }}" {% if activate_http_basic_auth or edxec_activate_http_basic_auth %} - name: edxec-htpasswd secret: diff --git a/apps/edxec/templates/volumes/media.yml.j2 b/apps/edxec/templates/volumes/media.yml.j2 index 546c95f63..ce3c90cc8 100644 --- a/apps/edxec/templates/volumes/media.yml.j2 +++ b/apps/edxec/templates/volumes/media.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: edxec-pvc-media + name: "{{ edxec_pvc_media_name }}" namespace: "{{ namespace_name }}" labels: app: edxec diff --git a/apps/edxec/templates/volumes/static.yml.j2 b/apps/edxec/templates/volumes/static.yml.j2 index 753b79716..160683b85 100644 --- a/apps/edxec/templates/volumes/static.yml.j2 +++ b/apps/edxec/templates/volumes/static.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: edxec-pvc-static + name: "{{ edxec_pvc_static_name }}" namespace: "{{ namespace_name }}" labels: app: edxec diff --git a/apps/edxec/vars/all/main.yml b/apps/edxec/vars/all/main.yml index 3ef8bdaa6..89442b4bf 100644 --- a/apps/edxec/vars/all/main.yml +++ b/apps/edxec/vars/all/main.yml @@ -35,6 +35,10 @@ edxec_mysql_image_tag: "5.7" edxec_mysql_port: 3306 edxec_mysql_secret_name: "edxec-mysql-{{ edxec_vault_checksum | default('undefined_edxec_vault_checksum') }}" +# -- pvc +edxec_pvc_media_name: "edxec-pvc-media" +edxec_pvc_static_name: "edxec-pvc-static" + # -- volumes size edxec_static_volume_size: 2Gi edxec_media_volume_size: 2Gi diff --git a/apps/elasticsearch/templates/services/app/job_01_set_index_template.yml.j2 b/apps/elasticsearch/templates/services/app/job_01_set_index_template.yml.j2 index 646801b07..ca642053e 100644 --- a/apps/elasticsearch/templates/services/app/job_01_set_index_template.yml.j2 +++ b/apps/elasticsearch/templates/services/app/job_01_set_index_template.yml.j2 @@ -65,7 +65,7 @@ spec: {% if elasticsearch_security_enabled %} - name: elasticsearch-v-bootstrap persistentVolumeClaim: - claimName: elasticsearch-pvc-bootstrap + claimName: "{{ elasticsearch_pvc_bootstrap_name }}" {% endif %} securityContext: runAsUser: {{ elasticsearch_container_uid }} diff --git a/apps/elasticsearch/templates/services/app/job_02_set_passwords.yml.j2 b/apps/elasticsearch/templates/services/app/job_02_set_passwords.yml.j2 index 35158450e..f4bf0d587 100644 --- a/apps/elasticsearch/templates/services/app/job_02_set_passwords.yml.j2 +++ b/apps/elasticsearch/templates/services/app/job_02_set_passwords.yml.j2 @@ -52,7 +52,7 @@ spec: path: set-passwords.sh - name: elasticsearch-v-bootstrap persistentVolumeClaim: - claimName: elasticsearch-pvc-bootstrap + claimName: "{{ elasticsearch_pvc_bootstrap_name }}" securityContext: runAsUser: {{ elasticsearch_container_uid }} runAsGroup: {{ elasticsearch_container_gid }} diff --git a/apps/elasticsearch/templates/services/app/sts.yml.j2 b/apps/elasticsearch/templates/services/app/sts.yml.j2 index eafa81c3c..1397e51c2 100644 --- a/apps/elasticsearch/templates/services/app/sts.yml.j2 +++ b/apps/elasticsearch/templates/services/app/sts.yml.j2 @@ -170,7 +170,7 @@ spec: secretName: "{{ elasticsearch_ca_secret_name }}" - name: elasticsearch-v-bootstrap persistentVolumeClaim: - claimName: elasticsearch-pvc-bootstrap + claimName: "{{ elasticsearch_pvc_bootstrap_name }}" - name: config-dir emptyDir: {} {% endif %} @@ -182,7 +182,7 @@ spec: {% if elasticsearch_persistent_volume_enabled %} volumeClaimTemplates: - metadata: - name: elasticsearch-pvc-data + name: "{{ elasticsearch_pvc_bootstrap_name }}" labels: app: elasticsearch spec: diff --git a/apps/elasticsearch/templates/volumes/bootstrap.yml.j2 b/apps/elasticsearch/templates/volumes/bootstrap.yml.j2 index 2db0a40f6..94f12cb11 100644 --- a/apps/elasticsearch/templates/volumes/bootstrap.yml.j2 +++ b/apps/elasticsearch/templates/volumes/bootstrap.yml.j2 @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: elasticsearch-pvc-bootstrap + name: "{{ elasticsearch_pvc_bootstrap_name }}" namespace: "{{ namespace_name }}" labels: app: elasticsearch diff --git a/apps/elasticsearch/vars/all/main.yml b/apps/elasticsearch/vars/all/main.yml index 00a256cbf..a69176b0c 100644 --- a/apps/elasticsearch/vars/all/main.yml +++ b/apps/elasticsearch/vars/all/main.yml @@ -71,6 +71,7 @@ elasticsearch_credentials_secret_name: "elasticsearch-credentials-{{ elasticsear elasticsearch_persistent_volume_enabled: false elasticsearch_persistent_volume_size: 1Gi elasticsearch_persistent_volume_storageclass: "{{ default_storage_class_rwo }}" +elasticsearch_pvc_bootstrap_name: "elasticsearch-pvc-bootstrap" # -- resources requests elasticsearch_app_resources: diff --git a/apps/hello/templates/services/app/job_writevolume.yml.j2 b/apps/hello/templates/services/app/job_writevolume.yml.j2 index bc0315d14..0508beb00 100644 --- a/apps/hello/templates/services/app/job_writevolume.yml.j2 +++ b/apps/hello/templates/services/app/job_writevolume.yml.j2 @@ -40,7 +40,7 @@ spec: volumes: - name: hello-volume persistentVolumeClaim: - claimName: hello-pvc + claimName: "{{ hello_pvc_hello_volume_name }}" restartPolicy: Never securityContext: runAsUser: {{ container_uid }} diff --git a/apps/hello/templates/volumes/hello.yml.j2 b/apps/hello/templates/volumes/hello.yml.j2 index 794ecc7da..3bb3090e8 100644 --- a/apps/hello/templates/volumes/hello.yml.j2 +++ b/apps/hello/templates/volumes/hello.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: hello-pvc + name: "{{ hello_pvc_hello_volume_name }}" namespace: "{{ namespace_name }}" labels: app: hello diff --git a/apps/hello/vars/all/main.yml b/apps/hello/vars/all/main.yml index 0f61dc74c..898c6fd11 100644 --- a/apps/hello/vars/all/main.yml +++ b/apps/hello/vars/all/main.yml @@ -18,3 +18,6 @@ hello_app_msg: "Hello Kubernetes! by Arnold" hello_app_resources: "{{ app_resources }}" hello_app_job_writevolume_resources: "{{ app_resources }}" hello_app_cronjob_resources: "{{ app_resources }}" + +# -- pvc +hello_pvc_hello_volume_name: "hello-pvc" \ No newline at end of file diff --git a/apps/nextcloud/templates/services/app/job_01_install.yml.j2 b/apps/nextcloud/templates/services/app/job_01_install.yml.j2 index c825eeb8e..bcf5594b7 100644 --- a/apps/nextcloud/templates/services/app/job_01_install.yml.j2 +++ b/apps/nextcloud/templates/services/app/job_01_install.yml.j2 @@ -49,7 +49,7 @@ spec: volumes: - name: nextcloud-v-install persistentVolumeClaim: - claimName: nextcloud-pvc-install + claimName: "{{ nextcloud_pvc_install_name }}" securityContext: runAsUser: {{ container_uid }} runAsGroup: {{ container_gid }} diff --git a/apps/nextcloud/templates/volumes/install.yml.j2 b/apps/nextcloud/templates/volumes/install.yml.j2 index d1a329b57..ecd869e56 100644 --- a/apps/nextcloud/templates/volumes/install.yml.j2 +++ b/apps/nextcloud/templates/volumes/install.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: nextcloud-pvc-install + name: "{{ nextcloud_pvc_install_name }}" namespace: "{{ namespace_name }}" labels: app: nextcloud diff --git a/apps/nextcloud/vars/all/main.yml b/apps/nextcloud/vars/all/main.yml index 0eb45e8af..98298a443 100644 --- a/apps/nextcloud/vars/all/main.yml +++ b/apps/nextcloud/vars/all/main.yml @@ -50,6 +50,7 @@ nextcloud_container_home_dir: "/home/openfun" # -- volumes nextcloud_install_volume_size: 2Mi +nextcloud_pvc_install_name: "nextcloud-pvc-install" # -- resources requests {% set app_resources = { diff --git a/apps/prosody/templates/services/app/deploy.yml.j2 b/apps/prosody/templates/services/app/deploy.yml.j2 index a9a5354d0..5d7e833c9 100644 --- a/apps/prosody/templates/services/app/deploy.yml.j2 +++ b/apps/prosody/templates/services/app/deploy.yml.j2 @@ -66,5 +66,5 @@ spec: {% if prosody_storage == "internal" %} - name: prosody-v-storage persistentVolumeClaim: - claimName: prosody-pvc-storage + claimName: "{{ prosody_pvc_storage_name }}" {% endif %} diff --git a/apps/prosody/templates/volumes/storage.yml.j2 b/apps/prosody/templates/volumes/storage.yml.j2 index bee9e4775..a18e22a64 100644 --- a/apps/prosody/templates/volumes/storage.yml.j2 +++ b/apps/prosody/templates/volumes/storage.yml.j2 @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: prosody-pvc-storage + name: "{{ prosody_pvc_storage_name }}" namespace: "{{ namespace_name }}" labels: app: prosody diff --git a/apps/prosody/vars/all/main.yml b/apps/prosody/vars/all/main.yml index 5c8ed5478..5f9f6bbfa 100644 --- a/apps/prosody/vars/all/main.yml +++ b/apps/prosody/vars/all/main.yml @@ -61,6 +61,7 @@ prosody_secret_name: "prosody-{{ prosody_vault_checksum | default('undefined_pro # -- Volumes # The storage volume is used only when the prosody storage is internal. prosody_storage_volume_size: 1Gi +prosody_pvc_storage_name: "prosody-pvc-storage" # -- Nginx prosody_nginx_image_name: "fundocker/openshift-nginx" diff --git a/apps/redis-sentinel/templates/services/app/svc.yml.j2 b/apps/redis-sentinel/templates/services/app/svc.yml.j2 index fdacb805b..873e70c47 100644 --- a/apps/redis-sentinel/templates/services/app/svc.yml.j2 +++ b/apps/redis-sentinel/templates/services/app/svc.yml.j2 @@ -64,7 +64,7 @@ spec: keepAfterDeletion: true persistentVolumeClaim: metadata: - name: redis-sentinel-pvc-data + name: "{{ redis_sentinel_pvc_data_name }}" namespace: "{{ namespace_name }}" labels: app: redis-sentinel @@ -75,7 +75,7 @@ spec: resources: requests: storage: {{ redis_sentinel_redis_data_volume_size }} - storageClassName: "{{ default_storage_class_rwo }}" + storageClassName: "{{ redis_sentinel_storage_class_rwo }}" {% endif %} securityContext: runAsUser: {{ container_uid }} diff --git a/apps/redis-sentinel/vars/all/main.yml b/apps/redis-sentinel/vars/all/main.yml index 818dbefd4..7434d0365 100644 --- a/apps/redis-sentinel/vars/all/main.yml +++ b/apps/redis-sentinel/vars/all/main.yml @@ -29,3 +29,10 @@ redis_sentinel_resources: requests: cpu: 20m memory: 100Mi + +# -- pvc +redis_sentinel_storage_class_rwo: "{{ default_storage_class_rwo }}" + + +# -- volumes +redis_sentinel_pvc_data_name: "redis-sentinel-pvc-data" diff --git a/apps/redis/templates/services/app/deploy.yml.j2 b/apps/redis/templates/services/app/deploy.yml.j2 index e124da6b3..6dcc5421e 100644 --- a/apps/redis/templates/services/app/deploy.yml.j2 +++ b/apps/redis/templates/services/app/deploy.yml.j2 @@ -69,7 +69,7 @@ spec: volumes: - name: redis-v-data persistentVolumeClaim: - claimName: redis-pvc-data + claimName: "{{ redis_pvc_data_name }}" - name: redis-v-config configMap: name: "redis-app-{{ deployment_stamp }}" diff --git a/apps/redis/templates/volumes/data.yml.j2 b/apps/redis/templates/volumes/data.yml.j2 index fb82a738e..0608f3db8 100644 --- a/apps/redis/templates/volumes/data.yml.j2 +++ b/apps/redis/templates/volumes/data.yml.j2 @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: redis-pvc-data + name: "{{ redis_pvc_data_name }}" namespace: "{{ namespace_name }}" labels: app: redis diff --git a/apps/redis/vars/all/main.yml b/apps/redis/vars/all/main.yml index d59dc2a21..4ab5b680a 100644 --- a/apps/redis/vars/all/main.yml +++ b/apps/redis/vars/all/main.yml @@ -7,6 +7,10 @@ redis_app_port: 6379 # -- volume size redis_data_volume_size: 2Gi +# -- volumes +# Name of the persitent volume use by redis's data volume +redis_pvc_data_name: "redis-pvc-data" + # -- resources requests redis_app_resources: requests: diff --git a/apps/richie/templates/services/app/deploy.yml.j2 b/apps/richie/templates/services/app/deploy.yml.j2 index 98f744497..d0d26c441 100644 --- a/apps/richie/templates/services/app/deploy.yml.j2 +++ b/apps/richie/templates/services/app/deploy.yml.j2 @@ -96,7 +96,7 @@ spec: volumes: - name: richie-v-media persistentVolumeClaim: - claimName: richie-pvc-media + claimName: "{{ richie_pvc_media_name }}" {% endif %} securityContext: runAsUser: {{ container_uid }} diff --git a/apps/richie/templates/services/app/job_03_bootstrap_elasticsearch.yml.j2 b/apps/richie/templates/services/app/job_03_bootstrap_elasticsearch.yml.j2 index 6c316a8f0..02c1b3e3f 100644 --- a/apps/richie/templates/services/app/job_03_bootstrap_elasticsearch.yml.j2 +++ b/apps/richie/templates/services/app/job_03_bootstrap_elasticsearch.yml.j2 @@ -62,7 +62,7 @@ spec: volumes: - name: richie-v-media persistentVolumeClaim: - claimName: richie-pvc-media + claimName: "{{ richie_pvc_media_name }}" {% endif %} securityContext: runAsUser: {{ container_uid }} diff --git a/apps/richie/templates/services/nginx/deploy.yml.j2 b/apps/richie/templates/services/nginx/deploy.yml.j2 index 6d7d81b14..0cead56ef 100644 --- a/apps/richie/templates/services/nginx/deploy.yml.j2 +++ b/apps/richie/templates/services/nginx/deploy.yml.j2 @@ -87,7 +87,7 @@ spec: {% if richie_should_activate_media_volume %} - name: richie-v-media persistentVolumeClaim: - claimName: richie-pvc-media + claimName: "{{ richie_pvc_media_name }}" {% endif %} {% if activate_http_basic_auth or richie_activate_http_basic_auth %} - name: richie-htpasswd diff --git a/apps/richie/templates/volumes/media.yml.j2 b/apps/richie/templates/volumes/media.yml.j2 index 15badeea9..14d46ef49 100644 --- a/apps/richie/templates/volumes/media.yml.j2 +++ b/apps/richie/templates/volumes/media.yml.j2 @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: richie-pvc-media + name: "{{ richie_pvc_media_name }}" namespace: "{{ namespace_name }}" labels: app: richie diff --git a/apps/richie/vars/all/main.yml b/apps/richie/vars/all/main.yml index 70d6e1dc8..5f7ebe414 100644 --- a/apps/richie/vars/all/main.yml +++ b/apps/richie/vars/all/main.yml @@ -51,6 +51,7 @@ richie_activate_http_basic_auth: false # volume sizes with power of 2 suffices (Ki, Mi, Gi, Ti...) e.g 2Gi and 0 for no volume. richie_media_volume_size: 2Gi richie_should_activate_media_volume: true +richie_pvc_media_name: "richie-pvc-media" # -- resources requests {% set app_resources = {