From e7a9dcf13a4243442b05a831dc99e2186de1d1a8 Mon Sep 17 00:00:00 2001 From: Krzysztof Hoffmann Date: Thu, 30 Nov 2023 08:49:35 +0100 Subject: [PATCH 1/3] fix: add paymentprocessors.json to k8s deployments and kustomization-configmapgenerator --- tutorecommerce/patches/k8s-deployments | 6 ++++++ tutorecommerce/patches/k8s-jobs | 5 ++++- tutorecommerce/patches/kustomization-configmapgenerator | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tutorecommerce/patches/k8s-deployments b/tutorecommerce/patches/k8s-deployments index 27041f2f..4ee6167f 100644 --- a/tutorecommerce/patches/k8s-deployments +++ b/tutorecommerce/patches/k8s-deployments @@ -29,6 +29,9 @@ spec: - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/production.py name: settings subPath: production.py + - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/paymentprocessors.json + name: settings + subPath: paymentprocessors.json securityContext: allowPrivilegeEscalation: false volumes: @@ -68,6 +71,9 @@ spec: - mountPath: /openedx/ecommerce_worker/ecommerce_worker/configuration/tutor/production.py name: settings subPath: production.py + - mountPath: /openedx/ecommerce_worker/ecommerce_worker/configuration/tutor/paymentprocessors.json + name: settings + subPath: paymentprocessors.json securityContext: allowPrivilegeEscalation: false volumes: diff --git a/tutorecommerce/patches/k8s-jobs b/tutorecommerce/patches/k8s-jobs index e1852e5e..f628d9f4 100644 --- a/tutorecommerce/patches/k8s-jobs +++ b/tutorecommerce/patches/k8s-jobs @@ -19,7 +19,10 @@ spec: - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/production.py name: settings subPath: production.py + - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/paymentprocessors.json + name: settings + subPath: paymentprocessors.json volumes: - name: settings configMap: - name: ecommerce-settings \ No newline at end of file + name: ecommerce-settings diff --git a/tutorecommerce/patches/kustomization-configmapgenerator b/tutorecommerce/patches/kustomization-configmapgenerator index 3ede00d4..6625f5e2 100644 --- a/tutorecommerce/patches/kustomization-configmapgenerator +++ b/tutorecommerce/patches/kustomization-configmapgenerator @@ -1,6 +1,8 @@ - name: ecommerce-settings files: - plugins/ecommerce/apps/ecommerce/settings/production.py + - plugins/ecommerce/apps/ecommerce/settings/paymentprocessors.json - name: ecommerce-worker-settings files: - - plugins/ecommerce/apps/ecommerce-worker/settings/production.py \ No newline at end of file + - plugins/ecommerce/apps/ecommerce-worker/settings/production.py + - plugins/ecommerce/apps/ecommerce/settings/paymentprocessors.json From b6289a150250da36bd7a0c68f752889bd73bd61e Mon Sep 17 00:00:00 2001 From: Krzysztof Hoffmann Date: Thu, 7 Dec 2023 21:56:18 +0100 Subject: [PATCH 2/3] feat: add all files from directory --- tutorecommerce/patches/k8s-deployments | 12 ++---------- tutorecommerce/patches/k8s-jobs | 6 +----- .../patches/kustomization-configmapgenerator | 10 ++++------ 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/tutorecommerce/patches/k8s-deployments b/tutorecommerce/patches/k8s-deployments index 4ee6167f..bc806b35 100644 --- a/tutorecommerce/patches/k8s-deployments +++ b/tutorecommerce/patches/k8s-deployments @@ -26,12 +26,8 @@ spec: - name: DJANGO_SETTINGS_MODULE value: ecommerce.settings.tutor.production volumeMounts: - - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/production.py + - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/ name: settings - subPath: production.py - - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/paymentprocessors.json - name: settings - subPath: paymentprocessors.json securityContext: allowPrivilegeEscalation: false volumes: @@ -68,12 +64,8 @@ spec: - name: C_FORCE_ROOT value: "1" volumeMounts: - - mountPath: /openedx/ecommerce_worker/ecommerce_worker/configuration/tutor/production.py - name: settings - subPath: production.py - - mountPath: /openedx/ecommerce_worker/ecommerce_worker/configuration/tutor/paymentprocessors.json + - mountPath: /openedx/ecommerce_worker/ecommerce_worker/configuration/tutor/ name: settings - subPath: paymentprocessors.json securityContext: allowPrivilegeEscalation: false volumes: diff --git a/tutorecommerce/patches/k8s-jobs b/tutorecommerce/patches/k8s-jobs index f628d9f4..ef5cb8a1 100644 --- a/tutorecommerce/patches/k8s-jobs +++ b/tutorecommerce/patches/k8s-jobs @@ -16,12 +16,8 @@ spec: - name: DJANGO_SETTINGS_MODULE value: ecommerce.settings.tutor.production volumeMounts: - - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/production.py + - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/ name: settings - subPath: production.py - - mountPath: /openedx/ecommerce/ecommerce/settings/tutor/paymentprocessors.json - name: settings - subPath: paymentprocessors.json volumes: - name: settings configMap: diff --git a/tutorecommerce/patches/kustomization-configmapgenerator b/tutorecommerce/patches/kustomization-configmapgenerator index 6625f5e2..6c1537fb 100644 --- a/tutorecommerce/patches/kustomization-configmapgenerator +++ b/tutorecommerce/patches/kustomization-configmapgenerator @@ -1,8 +1,6 @@ - name: ecommerce-settings - files: - - plugins/ecommerce/apps/ecommerce/settings/production.py - - plugins/ecommerce/apps/ecommerce/settings/paymentprocessors.json + files:{% for file in "ecommerce/apps/ecommerce/settings"|walk_templates %} + - plugins/{{ file }}{% endfor %} - name: ecommerce-worker-settings - files: - - plugins/ecommerce/apps/ecommerce-worker/settings/production.py - - plugins/ecommerce/apps/ecommerce/settings/paymentprocessors.json + files:{% for file in "ecommerce/apps/ecommerce-worker/settings"|walk_templates %} + - plugins/{{ file }}{% endfor %} From c3dbac8493c3cbe6786120b66c61e417d3d55de1 Mon Sep 17 00:00:00 2001 From: Krzysztof Hoffmann Date: Sat, 9 Dec 2023 16:24:44 +0100 Subject: [PATCH 3/3] feat: add changelog --- changelog.d/20231209_161942_krzysiekpl.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/20231209_161942_krzysiekpl.md diff --git a/changelog.d/20231209_161942_krzysiekpl.md b/changelog.d/20231209_161942_krzysiekpl.md new file mode 100644 index 00000000..f866c283 --- /dev/null +++ b/changelog.d/20231209_161942_krzysiekpl.md @@ -0,0 +1 @@ +[Fix] Change mounting volumes entries for ecommerce and worker while using k8s setup. (by @hoffmannkrzysztof)