From 321f98bf73ad40d5df1972307ab5ca0f092d1575 Mon Sep 17 00:00:00 2001 From: Bartosz Nowicki <116367402+bn-pass@users.noreply.github.com> Date: Thu, 25 Apr 2024 15:05:30 +0200 Subject: [PATCH] BC-7167 - add missing ConfigMap and concurrencyPolicy (#4959) * add dedicated ConfigMap for the moin.schule users deletion queueing CronJob * add concurrencyPolicy: Forbid to the moin.schule integration CronJobs * add EXIT_ON_ERROR: "true" to both of the moin.schule integration CronJobs --- ansible/roles/moin-schule-sync/tasks/main.yml | 7 +++++++ ...users-deletion-queueing-cronjob-configmap.yml.j2 | 13 +++++++++++++ ...in-schule-users-deletion-queueing-cronjob.yml.j2 | 3 +++ .../moin-schule-users-sync-cronjob-configmap.yml.j2 | 1 + .../templates/moin-schule-users-sync-cronjob.yml.j2 | 1 + 5 files changed, 25 insertions(+) create mode 100644 ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob-configmap.yml.j2 diff --git a/ansible/roles/moin-schule-sync/tasks/main.yml b/ansible/roles/moin-schule-sync/tasks/main.yml index 3e8cc3ff4d5..ec9bd313d8a 100644 --- a/ansible/roles/moin-schule-sync/tasks/main.yml +++ b/ansible/roles/moin-schule-sync/tasks/main.yml @@ -25,3 +25,10 @@ kubeconfig: ~/.kube/config namespace: "{{ NAMESPACE }}" template: moin-schule-users-deletion-queueing-cronjob.yml.j2 + +- name: unsynced moin.schule users deletion queueing CronJob ConfigMap + when: WITH_MOIN_SCHULE is defined and WITH_MOIN_SCHULE|bool == true and WITH_UNSYNCED_ENTITIES_DELETION is defined and WITH_UNSYNCED_ENTITIES_DELETION|bool == true + kubernetes.core.k8s: + kubeconfig: ~/.kube/config + namespace: "{{ NAMESPACE }}" + template: moin-schule-users-deletion-queueing-cronjob-configmap.yml.j2 diff --git a/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob-configmap.yml.j2 b/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob-configmap.yml.j2 new file mode 100644 index 00000000000..e3710d1e61d --- /dev/null +++ b/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob-configmap.yml.j2 @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: {{ NAMESPACE }} + name: moin-schule-users-deletion-queueing-cronjob-configmap + labels: + app: moin-schule-users-deletion-queueing-cronjob +data: + NODE_OPTIONS: "--max-old-space-size=3072" + NEST_LOG_LEVEL: "info" + EXIT_ON_ERROR: "true" + SC_DOMAIN: "{{ DOMAIN }}" + FEATURE_PROMETHEUS_METRICS_ENABLED: "true" diff --git a/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob.yml.j2 b/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob.yml.j2 index 9fff4a9337c..8f9ea5eba94 100644 --- a/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob.yml.j2 +++ b/ansible/roles/moin-schule-sync/templates/moin-schule-users-deletion-queueing-cronjob.yml.j2 @@ -14,6 +14,7 @@ metadata: name: moin-schule-users-deletion-queueing-cronjob spec: schedule: "{{ MOIN_SCHULE_USERS_DELETION_QUEUEING_CRONJOB_SCHEDULE|default("@hourly", true) }}" + concurrencyPolicy: Forbid jobTemplate: spec: template: @@ -22,6 +23,8 @@ spec: - name: moin-schule-users-deletion-queueing-cronjob image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }} envFrom: + - configMapRef: + name: moin-schule-users-deletion-queueing-cronjob-configmap - secretRef: name: moin-schule-sync-secret command: ['/bin/sh','-c'] diff --git a/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob-configmap.yml.j2 b/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob-configmap.yml.j2 index 428b2b65df9..21b3a74cb1f 100644 --- a/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob-configmap.yml.j2 +++ b/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob-configmap.yml.j2 @@ -8,5 +8,6 @@ metadata: data: NODE_OPTIONS: "--max-old-space-size=3072" NEST_LOG_LEVEL: "info" + EXIT_ON_ERROR: "true" SC_DOMAIN: "{{ DOMAIN }}" FEATURE_PROMETHEUS_METRICS_ENABLED: "true" diff --git a/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob.yml.j2 b/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob.yml.j2 index 7182999e1b1..d11a061af9b 100644 --- a/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob.yml.j2 +++ b/ansible/roles/moin-schule-sync/templates/moin-schule-users-sync-cronjob.yml.j2 @@ -14,6 +14,7 @@ metadata: name: moin-schule-users-sync-cronjob spec: schedule: "{{ MOIN_SCHULE_USERS_SYNC_CRONJOB_SCHEDULE|default("@hourly", true) }}" + concurrencyPolicy: Forbid jobTemplate: spec: template: