From afa3a1e118e1d69dc520a19c4e9de80c7f502b27 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:46:54 +0000 Subject: [PATCH 01/19] [patch] initial attempt at a manage job that execs into db2 pod --- .../templates/05-postsync-db2-manage.yaml | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml new file mode 100644 index 00000000..2cae3c6c --- /dev/null +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -0,0 +1,155 @@ +{{- if eq .Values.mas_app_id "manage" }} + +{{ $db2_namespace := printf "db2u-%s" .Values.mas_instance_id }} +{{ $db2_instance_name := printf "%s-manage-db2u" .Values.mas_instance_id }} +{{ $ns := .Values.mas_app_namespace }} +{{ $role_name := printf "postsync-manage-db2-role-%s" .Values.mas_app_id }} +{{ $sa_name := "postsync-manage-db2-sa" }} +{{ $rb_name := printf "postsync-manage-db2-rb-%s" .Values.mas_app_id }} +{{ $job_name := "postsync-manage-db2-job" }} + +# TODO: hard-coded for now, but should be passing this in +{{ $db2_dbname := "BLUDB" }} + + +# TODO: set all syncwaves to low values so this runs first for testing +# change this before delivery! + +--- +# Service account that is authorized to exec into db2u pod +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "{{ $sa_name }}" + namespace: "{{ $ns }}" + annotations: + argocd.argoproj.io/sync-wave: "0" +{{- if .Values.custom_labels }} + labels: +{{ .Values.custom_labels | toYaml | indent 4 }} +{{- end }} + + +--- +# Role permitting exec into db2u pod +# NOTE: created in db2u namespace +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: "{{ $role_name }}" + namespace: "{{ $db2_namespace }}" + annotations: + argocd.argoproj.io/sync-wave: "0" +{{- if .Values.custom_labels }} + labels: +{{ .Values.custom_labels | toYaml | indent 4 }} +{{- end }} +rules: +- apiGroups: + - "" + resources: + - pods + verbs: + - get + - list +- apiGroups: + - "" + resources: + - pods/exec + verbs: + - create + - get + - list + +--- +# RoleBinding from the Role in the db2u namespace to the Job's ServiceAccount in the app namespace +# NOTE: created in db2u namespace +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: "{{ $rb_name }}" + namespace: "{{ $db2_namespace }}" + annotations: + argocd.argoproj.io/sync-wave: "0" +{{- if .Values.custom_labels }} + labels: +{{ .Values.custom_labels | toYaml | indent 4 }} +{{- end }} +subjects: + - kind: ServiceAccount + name: "{{ $sa_name }}" + namespace: "{{ $ns }}" +roleRef: + kind: Role + name: "{{ $role_name }}" + apiGroup: rbac.authorization.k8s.io + + +--- +apiVersion: batch/v1 +kind: Job +metadata: + # Suffix the Job name with a hash of all chart values + # This is to ensure that ArgoCD will delete and recreate the job if anything changes in the application config + # The job is idempotent + name: {{ $job_name }}-v1-{{ omit .Values "junitreporter" | toYaml | adler32sum }} + namespace: "{{ $ns }}" + annotations: + argocd.argoproj.io/sync-wave: "1" +{{- if .Values.custom_labels }} + labels: +{{ .Values.custom_labels | toYaml | indent 4 }} +{{- end }} +spec: + template: +{{- if .Values.custom_labels }} + metadata: + labels: +{{ .Values.custom_labels | toYaml | indent 8 }} +{{- end }} + spec: + containers: + - name: run + image: quay.io/ibmmas/cli:latest + imagePullPolicy: IfNotPresent + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 10m + memory: 64Mi + env: + # Hard-coded for now: + - name: AVP_TYPE + value: "aws" + - name: DB2_NAMESPACE + value: "{{ $db2_namespace }}" + - name: DB2_INSTANCE_NAME + value: "{{ $db2_instance_name }}" + - name: DB2_DBNAME + value: "{{ $db2_dbname }}" + + volumeMounts: [] + command: + - /bin/sh + - -c + - | + + set -e + + source /mascli/functions/gitops_utils + + oc exec -n ${DB2_NAMESPACE} c-${DB2_INSTANCE_NAME}-db2u-0 -- su -lc 'echo "hello world"' db2inst1 + + # su - db2inst1 + # db2 connect to bludb + # db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > AlterSEQ.sql + # echo "alter sequence maximo.maxseq cache 2000;" >> AlterSEQ.sql + # db2 -tvf AlterSEQ.sql | tee AlterSEQ.OUT + + restartPolicy: Never + serviceAccountName: "{{ $sa_name }}" + volumes: [] + backoffLimit: 4 +{{- end }} From ebfdbf40e81adcd977d34ae870a9bbc347049a5b Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:49:03 +0000 Subject: [PATCH 02/19] fix --- .../templates/05-postsync-db2-manage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 2cae3c6c..647dc52d 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -1,7 +1,7 @@ {{- if eq .Values.mas_app_id "manage" }} -{{ $db2_namespace := printf "db2u-%s" .Values.mas_instance_id }} -{{ $db2_instance_name := printf "%s-manage-db2u" .Values.mas_instance_id }} +{{ $db2_namespace := printf "db2u-%s" .Values.instance_id }} +{{ $db2_instance_name := printf "%s-manage-db2u" .Values.instance_id }} {{ $ns := .Values.mas_app_namespace }} {{ $role_name := printf "postsync-manage-db2-role-%s" .Values.mas_app_id }} {{ $sa_name := "postsync-manage-db2-sa" }} From 1eaf1f1e20d5775330a47085659a8b3e6550bd94 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:56:46 +0000 Subject: [PATCH 03/19] add networkpolicy --- .../templates/05-postsync-db2-manage.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 647dc52d..b57d0356 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -3,6 +3,7 @@ {{ $db2_namespace := printf "db2u-%s" .Values.instance_id }} {{ $db2_instance_name := printf "%s-manage-db2u" .Values.instance_id }} {{ $ns := .Values.mas_app_namespace }} +{{ $np_name := "postsync-manage-db2-np" }} {{ $role_name := printf "postsync-manage-db2-role-%s" .Values.mas_app_id }} {{ $sa_name := "postsync-manage-db2-sa" }} {{ $rb_name := printf "postsync-manage-db2-rb-%s" .Values.mas_app_id }} @@ -15,6 +16,29 @@ # TODO: set all syncwaves to low values so this runs first for testing # change this before delivery! +--- +# Permit outbound communication by the Job pod +# (Needed to communicate with the K8S HTTP API, PyPI, manage Route) +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: {{ $np_name }} + namespace: {{ $ns }} + annotations: + argocd.argoproj.io/sync-wave: "0" +{{- if .Values.custom_labels }} + labels: +{{ .Values.custom_labels | toYaml | indent 4 }} +{{- end }} +spec: + podSelector: + matchLabels: + app: {{ $job_name }} + egress: + - {} + policyTypes: + - Egress + --- # Service account that is authorized to exec into db2u pod kind: ServiceAccount From 11984e684dd656a5587d4e81c6bf9dbc1f4ecd10 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:59:23 +0000 Subject: [PATCH 04/19] fix --- .../templates/05-postsync-db2-manage.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index b57d0356..da0e6792 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -18,7 +18,7 @@ --- # Permit outbound communication by the Job pod -# (Needed to communicate with the K8S HTTP API, PyPI, manage Route) +# (Needed to communicate with the K8S HTTP API) kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: @@ -126,9 +126,10 @@ metadata: {{- end }} spec: template: -{{- if .Values.custom_labels }} metadata: labels: + app: {{ $job_name }} +{{- if .Values.custom_labels }} {{ .Values.custom_labels | toYaml | indent 8 }} {{- end }} spec: From 04a4eb667c0f9e356915fe7b501442a4ed3bc0bf Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:07:30 +0000 Subject: [PATCH 05/19] fix --- .../templates/05-postsync-db2-manage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index da0e6792..61ed2fde 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -1,7 +1,7 @@ {{- if eq .Values.mas_app_id "manage" }} {{ $db2_namespace := printf "db2u-%s" .Values.instance_id }} -{{ $db2_instance_name := printf "%s-manage-db2u" .Values.instance_id }} +{{ $db2_instance_name := printf "%s-manage" .Values.instance_id }} {{ $ns := .Values.mas_app_namespace }} {{ $np_name := "postsync-manage-db2-np" }} {{ $role_name := printf "postsync-manage-db2-role-%s" .Values.mas_app_id }} From 7129134eebc1493bcd578f7949e58b7ad3e1f1f8 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:31:06 +0000 Subject: [PATCH 06/19] fix --- .../templates/05-postsync-db2-manage.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 61ed2fde..7a089cec 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -1,7 +1,6 @@ {{- if eq .Values.mas_app_id "manage" }} {{ $db2_namespace := printf "db2u-%s" .Values.instance_id }} -{{ $db2_instance_name := printf "%s-manage" .Values.instance_id }} {{ $ns := .Values.mas_app_namespace }} {{ $np_name := "postsync-manage-db2-np" }} {{ $role_name := printf "postsync-manage-db2-role-%s" .Values.mas_app_id }} @@ -150,10 +149,10 @@ spec: value: "aws" - name: DB2_NAMESPACE value: "{{ $db2_namespace }}" - - name: DB2_INSTANCE_NAME - value: "{{ $db2_instance_name }}" - name: DB2_DBNAME value: "{{ $db2_dbname }}" + - name: INSTANCE_ID + value: "{{ .Values.instance_id }}" volumeMounts: [] command: @@ -164,8 +163,7 @@ spec: set -e source /mascli/functions/gitops_utils - - oc exec -n ${DB2_NAMESPACE} c-${DB2_INSTANCE_NAME}-db2u-0 -- su -lc 'echo "hello world"' db2inst1 + oc exec -n ${DB2_NAMESPACE} c-db2wh-${INSTANCE_ID}-manage-db2u-0 -- su -lc 'echo "hello world"' db2inst1 # su - db2inst1 # db2 connect to bludb From 4340ccd1532b0cc73ce3e6b8b00b755912a5875c Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:58:02 +0000 Subject: [PATCH 07/19] job implementation --- .../templates/05-postsync-db2-manage.yaml | 62 ++++++++++++++++--- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 7a089cec..6120b288 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -151,7 +151,7 @@ spec: value: "{{ $db2_namespace }}" - name: DB2_DBNAME value: "{{ $db2_dbname }}" - - name: INSTANCE_ID + - name: MAS_INSTANCE_ID value: "{{ .Values.instance_id }}" volumeMounts: [] @@ -159,17 +159,61 @@ spec: - /bin/sh - -c - | - set -e - source /mascli/functions/gitops_utils - oc exec -n ${DB2_NAMESPACE} c-db2wh-${INSTANCE_ID}-manage-db2u-0 -- su -lc 'echo "hello world"' db2inst1 - # su - db2inst1 - # db2 connect to bludb - # db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > AlterSEQ.sql - # echo "alter sequence maximo.maxseq cache 2000;" >> AlterSEQ.sql - # db2 -tvf AlterSEQ.sql | tee AlterSEQ.OUT + DB2_POD_NAME="c-db2wh-${INSTANCE_ID}-manage-db2u-0" + + echo "" + echo "================================================================================" + echo "Settings" + echo "================================================================================" + echo "MAS_INSTANCE_ID ..................... ${MAS_INSTANCE_ID}" + echo "DB2_DBNAME .......................... ${DB2_DBNAME}" + echo "AVP_TYPE ............................ ${AVP_TYPE}" + echo "DB2_NAMESPACE ....................... ${DB2_NAMESPACE}" + echo "DB2_POD_NAME ........................ ${DB2_POD_NAME}" + + # Path to the generated script, on both this pod and on the db2u pod + ALTERSEQ_SH_PATH="/tmp/alterseq.sh" + + echo "" + echo "Create ${ALTERSEQ_SH_PATH}" + echo "--------------------------------------------------------------------------------" + + # Generate a script to copy and run on the db2u pod + cat > ${ALTERSEQ_SH_PATH} << EOF + #!/bin/bash + db2 connect to ${DB2_DBNAME} + if [ \$? != 0 ]; then + echo "Failed to connect to database!" + exit 1 + fi + + SQL_PATH="${ALTERSEQ_SH_PATH}.sql" + + db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > ${SQL_PATH} + echo "alter sequence maximo.maxseq cache 2000;" >> ${SQL_PATH} + + cat ${SQL_PATH} + + # db2 -tvf ${SQL_PATH} | tee ${SQL_PATH}.log + EOF + # IMPORTANT: Do not make any changes to the "EOF" line above (including its indentation) + + cat ${ALTERSEQ_SH_PATH} + + chmod +x ${ALTERSEQ_SH_PATH} + + echo "" + echo "Copy ${ALTERSEQ_SH_PATH} to ${DB2_NAMESPACE}/${DB2_POD_NAME}" + echo "--------------------------------------------------------------------------------" + oc cp ${ALTERSEQ_SH_PATH} ${DB2_NAMESPACE}/${DB2_POD_NAME}:${ALTERSEQ_SH_PATH} -c db2u || exit $? + + echo "" + echo "Executing ${ALTERSEQ_SH_PATH} file on ${DB2_NAMESPACE}/${DB2_POD_NAME}" + echo "--------------------------------------------------------------------------------" + oc exec -n ${DB2_NAMESPACE} ${DB2_POD_NAME} -- su -lc "${ALTERSEQ_SH_PATH} | tee ${ALTERSEQ_SH_PATH}.log" db2inst1 || exit $? restartPolicy: Never serviceAccountName: "{{ $sa_name }}" From cf5c7a8bdaf416620e59ad0b78e7e920f0107432 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:03:55 +0000 Subject: [PATCH 08/19] fix? --- .../templates/05-postsync-db2-manage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 6120b288..9005063c 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -159,6 +159,7 @@ spec: - /bin/sh - -c - | + set -e source /mascli/functions/gitops_utils From 48fffff9b38ef94c9323fa54e763aa46e7623f22 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:11:45 +0000 Subject: [PATCH 09/19] fix? --- .../templates/05-postsync-db2-manage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 9005063c..1b1d63bf 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -199,7 +199,7 @@ spec: cat ${SQL_PATH} # db2 -tvf ${SQL_PATH} | tee ${SQL_PATH}.log - EOF + EOF # IMPORTANT: Do not make any changes to the "EOF" line above (including its indentation) cat ${ALTERSEQ_SH_PATH} From ed3efcf0959abdc9cba91fbf8bb99b9193c29be9 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:15:33 +0000 Subject: [PATCH 10/19] fix --- .../templates/05-postsync-db2-manage.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 1b1d63bf..7a706b88 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -163,7 +163,7 @@ spec: set -e source /mascli/functions/gitops_utils - DB2_POD_NAME="c-db2wh-${INSTANCE_ID}-manage-db2u-0" + DB2_POD_NAME="c-db2wh-${MAS_INSTANCE_ID}-manage-db2u-0" echo "" echo "================================================================================" @@ -191,14 +191,12 @@ spec: exit 1 fi - SQL_PATH="${ALTERSEQ_SH_PATH}.sql" + db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > "${ALTERSEQ_SH_PATH}.sql" + echo "alter sequence maximo.maxseq cache 2000;" >> "${ALTERSEQ_SH_PATH}.sql" - db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > ${SQL_PATH} - echo "alter sequence maximo.maxseq cache 2000;" >> ${SQL_PATH} + cat "${ALTERSEQ_SH_PATH}.sql" - cat ${SQL_PATH} - - # db2 -tvf ${SQL_PATH} | tee ${SQL_PATH}.log + # db2 -tvf "${ALTERSEQ_SH_PATH}.sql" | tee "${ALTERSEQ_SH_PATH}.sql.log EOF # IMPORTANT: Do not make any changes to the "EOF" line above (including its indentation) From 3a02248b632c74f914501fb425768623f002c949 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:35:30 +0000 Subject: [PATCH 11/19] execute sql --- .../templates/05-postsync-db2-manage.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 7a706b88..1f3f460b 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -194,9 +194,7 @@ spec: db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > "${ALTERSEQ_SH_PATH}.sql" echo "alter sequence maximo.maxseq cache 2000;" >> "${ALTERSEQ_SH_PATH}.sql" - cat "${ALTERSEQ_SH_PATH}.sql" - - # db2 -tvf "${ALTERSEQ_SH_PATH}.sql" | tee "${ALTERSEQ_SH_PATH}.sql.log + db2 -tvf "${ALTERSEQ_SH_PATH}.sql" | tee "${ALTERSEQ_SH_PATH}.sql.log EOF # IMPORTANT: Do not make any changes to the "EOF" line above (including its indentation) @@ -208,6 +206,7 @@ spec: echo "Copy ${ALTERSEQ_SH_PATH} to ${DB2_NAMESPACE}/${DB2_POD_NAME}" echo "--------------------------------------------------------------------------------" oc cp ${ALTERSEQ_SH_PATH} ${DB2_NAMESPACE}/${DB2_POD_NAME}:${ALTERSEQ_SH_PATH} -c db2u || exit $? + echo "... done" echo "" echo "Executing ${ALTERSEQ_SH_PATH} file on ${DB2_NAMESPACE}/${DB2_POD_NAME}" From 0635256211afe3587fde20422599c813fd04d039 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:39:39 +0000 Subject: [PATCH 12/19] fix --- .../templates/05-postsync-db2-manage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 1f3f460b..90006df0 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -194,7 +194,7 @@ spec: db2 "select 'alter sequence maximo.' || sequencename || ' cache 500;' from maximo.maxsequence" | grep "alter sequence" > "${ALTERSEQ_SH_PATH}.sql" echo "alter sequence maximo.maxseq cache 2000;" >> "${ALTERSEQ_SH_PATH}.sql" - db2 -tvf "${ALTERSEQ_SH_PATH}.sql" | tee "${ALTERSEQ_SH_PATH}.sql.log + db2 -tvf "${ALTERSEQ_SH_PATH}.sql" | tee "${ALTERSEQ_SH_PATH}.sql.log" || exit \$? EOF # IMPORTANT: Do not make any changes to the "EOF" line above (including its indentation) From 25f02a8fd38eff5a820a2b105ff490bd867ff138 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:27:35 +0000 Subject: [PATCH 13/19] [patch] fix selenium-grid app template --- .../ibm-mas-cluster-root/templates/060-selenium-grid.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root-applications/ibm-mas-cluster-root/templates/060-selenium-grid.yaml b/root-applications/ibm-mas-cluster-root/templates/060-selenium-grid.yaml index 1ab147c9..47c398e9 100644 --- a/root-applications/ibm-mas-cluster-root/templates/060-selenium-grid.yaml +++ b/root-applications/ibm-mas-cluster-root/templates/060-selenium-grid.yaml @@ -30,7 +30,7 @@ spec: helm: releaseName: selenium-grid.{{ .Values.cluster.id }} values: | -{{ .Values.selenium_grid.values | indent 8 }} +{{ .Values.selenium_grid.values | toYaml | indent 8 }} syncPolicy: automated: From c0c6c91b0a2ffe5b86c856d967ae7cfb2053f6f8 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:17:21 +0000 Subject: [PATCH 14/19] Pass in subset of Manage DB2 parameters for postsync-db2-manage job --- .../templates/05-postsync-db2-manage.yaml | 50 +++++++++++-------- .../510-550-ibm-mas-masapp-configs.yaml | 11 ++++ 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 90006df0..d736c35a 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -1,19 +1,12 @@ {{- if eq .Values.mas_app_id "manage" }} +{{- if not (empty .Values.manage_db2u_databases) }} -{{ $db2_namespace := printf "db2u-%s" .Values.instance_id }} -{{ $ns := .Values.mas_app_namespace }} +{{ $manage_ns := .Values.mas_app_namespace }} {{ $np_name := "postsync-manage-db2-np" }} -{{ $role_name := printf "postsync-manage-db2-role-%s" .Values.mas_app_id }} {{ $sa_name := "postsync-manage-db2-sa" }} -{{ $rb_name := printf "postsync-manage-db2-rb-%s" .Values.mas_app_id }} -{{ $job_name := "postsync-manage-db2-job" }} +{{ $job_label := "postsync-manage-db2-job" }} -# TODO: hard-coded for now, but should be passing this in -{{ $db2_dbname := "BLUDB" }} - - -# TODO: set all syncwaves to low values so this runs first for testing -# change this before delivery! +# TODO: set all syncwaves to low values so this runs first for testing, change this before delivery! --- # Permit outbound communication by the Job pod @@ -22,7 +15,7 @@ kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: {{ $np_name }} - namespace: {{ $ns }} + namespace: {{ $manage_ns }} annotations: argocd.argoproj.io/sync-wave: "0" {{- if .Values.custom_labels }} @@ -32,7 +25,7 @@ metadata: spec: podSelector: matchLabels: - app: {{ $job_name }} + app: {{ $job_label }} egress: - {} policyTypes: @@ -44,7 +37,7 @@ kind: ServiceAccount apiVersion: v1 metadata: name: "{{ $sa_name }}" - namespace: "{{ $ns }}" + namespace: "{{ $manage_ns }}" annotations: argocd.argoproj.io/sync-wave: "0" {{- if .Values.custom_labels }} @@ -53,6 +46,18 @@ metadata: {{- end }} + +{{- range $i, $db := .Values.manage_db2u_databases }} + +# TODO: hard-coded for now, but should be passing this in +{{ $db2_namespace := $db.db2_namespace }} +{{ $db2_dbname := $db.db2_dbname }} +{{ $db2_instance_name := $db.db2_instance_name }} + +{{ $job_name := printf "postsync-manage-db2-job-%s" $db2_instance_name }} +{{ $role_name := printf "postsync-manage-db2-role-%s" $db2_instance_name }} +{{ $rb_name := printf "postsync-manage-db2-rb-%s" $db2_instance_name }} + --- # Role permitting exec into db2u pod # NOTE: created in db2u namespace @@ -101,7 +106,7 @@ metadata: subjects: - kind: ServiceAccount name: "{{ $sa_name }}" - namespace: "{{ $ns }}" + namespace: "{{ $manage_ns }}" roleRef: kind: Role name: "{{ $role_name }}" @@ -116,7 +121,7 @@ metadata: # This is to ensure that ArgoCD will delete and recreate the job if anything changes in the application config # The job is idempotent name: {{ $job_name }}-v1-{{ omit .Values "junitreporter" | toYaml | adler32sum }} - namespace: "{{ $ns }}" + namespace: "{{ $manage_ns }}" annotations: argocd.argoproj.io/sync-wave: "1" {{- if .Values.custom_labels }} @@ -127,7 +132,7 @@ spec: template: metadata: labels: - app: {{ $job_name }} + app: {{ $job_label }} {{- if .Values.custom_labels }} {{ .Values.custom_labels | toYaml | indent 8 }} {{- end }} @@ -151,8 +156,8 @@ spec: value: "{{ $db2_namespace }}" - name: DB2_DBNAME value: "{{ $db2_dbname }}" - - name: MAS_INSTANCE_ID - value: "{{ .Values.instance_id }}" + - name: DB2_INSTANCE_NAME + value: "{{ $db2_instance_name }}" volumeMounts: [] command: @@ -163,13 +168,13 @@ spec: set -e source /mascli/functions/gitops_utils - DB2_POD_NAME="c-db2wh-${MAS_INSTANCE_ID}-manage-db2u-0" + DB2_POD_NAME="c-${DB2_INSTANCE_NAME}-db2u-0" echo "" echo "================================================================================" echo "Settings" echo "================================================================================" - echo "MAS_INSTANCE_ID ..................... ${MAS_INSTANCE_ID}" + echo "DB2_INSTANCE_ID ..................... ${DB2_INSTANCE_NAME}" echo "DB2_DBNAME .......................... ${DB2_DBNAME}" echo "AVP_TYPE ............................ ${AVP_TYPE}" echo "DB2_NAMESPACE ....................... ${DB2_NAMESPACE}" @@ -217,4 +222,7 @@ spec: serviceAccountName: "{{ $sa_name }}" volumes: [] backoffLimit: 4 + +{{- end }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml b/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml index 62bc53fd..2b272871 100644 --- a/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml +++ b/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml @@ -100,6 +100,17 @@ spec: devops_build_number: "{{ $.Values.devops.build_number }}" gitops_version: "{{ $.Values.source.revision }}" + {{- if (eq $value.mas_app_id "manage") }} + manage_db2u_databases: + {{- range $j, $db := .Values.ibm_db2u_databases }} + {{- if (eq $db.mas_application_id "manage") }} + - db2_namespace: {{ $db.db2_namespace }} + db2_instance_name: {{ $db.db2_instance_name }} + db2_dbname: {{ $db.db2_dbname }} + {{- end }} + {{- end }} + {{- end }} + - name: ARGOCD_APP_NAME value: "ma-cfg-{{ $value.mas_app_id }}" {{- if not (empty $.Values.avp.secret) }} From eab12aa564d3225e588b402d8c3bc23e4385abea Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:27:16 +0000 Subject: [PATCH 15/19] fixes & comments --- .../templates/05-postsync-db2-manage.yaml | 58 +++++++++++++------ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index d736c35a..0000f882 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -9,8 +9,11 @@ # TODO: set all syncwaves to low values so this runs first for testing, change this before delivery! --- -# Permit outbound communication by the Job pod -# (Needed to communicate with the K8S HTTP API) +{{- /* + Permit outbound communication by the Job pod (Needed to communicate with the K8S HTTP API) + This single policy is shared by all per-db2 job instances, + it identifies these jobs by $job_label (which is the same for all) +*/}} kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: @@ -32,7 +35,11 @@ spec: - Egress --- -# Service account that is authorized to exec into db2u pod +{{- /* + Service account that is authorized to exec into db2u pod + This single service account is shared by all per-db2 job instances + Each per-db2 job is assigned its own role (in the db2 namespace) which is bound to this service account +*/}} kind: ServiceAccount apiVersion: v1 metadata: @@ -47,9 +54,22 @@ metadata: + + + +{{- /* + A separate Job is created in the manage namespace per DB2 instance assigned to Manage. + (i.e. all entries in ibm-db2u-databases.yaml with mas_application_id: "manage") + For each Job a separate Role and RoleBinding is created in the db2 namespace to permit + pod exec access to the (single) service account assigned to each Job. + + NOTE: Most likely there will only ever be a single DB2 assigned to Manage + + NOTE: When inside the range loop below, make sure you prefix any references to chart values NOT under .Values.manage_db2u_databases with $. + For example: {{ $.Values.custom_labels }} (instead of {{ .Values.custom_labels }} ) +*/}} {{- range $i, $db := .Values.manage_db2u_databases }} -# TODO: hard-coded for now, but should be passing this in {{ $db2_namespace := $db.db2_namespace }} {{ $db2_dbname := $db.db2_dbname }} {{ $db2_instance_name := $db.db2_instance_name }} @@ -59,8 +79,10 @@ metadata: {{ $rb_name := printf "postsync-manage-db2-rb-%s" $db2_instance_name }} --- -# Role permitting exec into db2u pod -# NOTE: created in db2u namespace +{{- /* + Role permitting exec into db2u pod + NOTE: created in db2u namespace +*/}} kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -68,9 +90,9 @@ metadata: namespace: "{{ $db2_namespace }}" annotations: argocd.argoproj.io/sync-wave: "0" -{{- if .Values.custom_labels }} +{{- if $.Values.custom_labels }} labels: -{{ .Values.custom_labels | toYaml | indent 4 }} +{{ $.Values.custom_labels | toYaml | indent 4 }} {{- end }} rules: - apiGroups: @@ -90,8 +112,10 @@ rules: - list --- -# RoleBinding from the Role in the db2u namespace to the Job's ServiceAccount in the app namespace -# NOTE: created in db2u namespace +{{- /* + RoleBinding from the Role in the db2u namespace to the Job ServiceAccount in the app namespace + NOTE: created in db2u namespace +*/}} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -99,9 +123,9 @@ metadata: namespace: "{{ $db2_namespace }}" annotations: argocd.argoproj.io/sync-wave: "0" -{{- if .Values.custom_labels }} +{{- if $.Values.custom_labels }} labels: -{{ .Values.custom_labels | toYaml | indent 4 }} +{{ $.Values.custom_labels | toYaml | indent 4 }} {{- end }} subjects: - kind: ServiceAccount @@ -120,21 +144,21 @@ metadata: # Suffix the Job name with a hash of all chart values # This is to ensure that ArgoCD will delete and recreate the job if anything changes in the application config # The job is idempotent - name: {{ $job_name }}-v1-{{ omit .Values "junitreporter" | toYaml | adler32sum }} + name: {{ $job_name }}-v1-{{ omit $.Values "junitreporter" | toYaml | adler32sum }} namespace: "{{ $manage_ns }}" annotations: argocd.argoproj.io/sync-wave: "1" -{{- if .Values.custom_labels }} +{{- if $.Values.custom_labels }} labels: -{{ .Values.custom_labels | toYaml | indent 4 }} +{{ $.Values.custom_labels | toYaml | indent 4 }} {{- end }} spec: template: metadata: labels: app: {{ $job_label }} -{{- if .Values.custom_labels }} -{{ .Values.custom_labels | toYaml | indent 8 }} +{{- if $.Values.custom_labels }} +{{ $.Values.custom_labels | toYaml | indent 8 }} {{- end }} spec: containers: From 9e69d352d5e2c16f33a77f12d07e36d4022589f0 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:55:42 +0000 Subject: [PATCH 16/19] clarify comments --- .../templates/05-postsync-db2-manage.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml index 0000f882..1fc072c2 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml @@ -11,8 +11,7 @@ --- {{- /* Permit outbound communication by the Job pod (Needed to communicate with the K8S HTTP API) - This single policy is shared by all per-db2 job instances, - it identifies these jobs by $job_label (which is the same for all) + This single policy is shared by all per-db2 job instances, sit identifies these jobs by $job_label (which is the same for all) */}} kind: NetworkPolicy apiVersion: networking.k8s.io/v1 @@ -58,15 +57,14 @@ metadata: {{- /* - A separate Job is created in the manage namespace per DB2 instance assigned to Manage. - (i.e. all entries in ibm-db2u-databases.yaml with mas_application_id: "manage") - For each Job a separate Role and RoleBinding is created in the db2 namespace to permit - pod exec access to the (single) service account assigned to each Job. + A separate Job is created in the manage namespace per DB2 instance reserved for use by Manage. + For each Job a separate Role and RoleBinding is created in the db2 namespace to permit pod exec access to the (single) service account assigned to each Job. - NOTE: Most likely there will only ever be a single DB2 assigned to Manage + NOTE: Most likely there will only ever be a single DB2 reserved for use by Manage; i.e. exactly 1 entry in ibm-db2u-databases.yaml with mas_application_id: "manage". + But our config model (in theory) permits more than one, so it seems prudent to ensure this post Manage-sync DB2 maintenance Job is executed against all. NOTE: When inside the range loop below, make sure you prefix any references to chart values NOT under .Values.manage_db2u_databases with $. - For example: {{ $.Values.custom_labels }} (instead of {{ .Values.custom_labels }} ) + For example: {{ $.Values.custom_labels }} (instead of {{ .Values.custom_labels }} ) */}} {{- range $i, $db := .Values.manage_db2u_databases }} From e7623d8742d97f53ec2cf5d21e2b47d7355e3f73 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:10:15 +0000 Subject: [PATCH 17/19] fix --- .../templates/510-550-ibm-mas-masapp-configs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml b/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml index 2b272871..e7211dd3 100644 --- a/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml +++ b/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml @@ -102,7 +102,7 @@ spec: {{- if (eq $value.mas_app_id "manage") }} manage_db2u_databases: - {{- range $j, $db := .Values.ibm_db2u_databases }} + {{- range $j, $db := $.Values.ibm_db2u_databases }} {{- if (eq $db.mas_application_id "manage") }} - db2_namespace: {{ $db.db2_namespace }} db2_instance_name: {{ $db.db2_instance_name }} From 4bdf87be41586abfb514cea102ad1cd6dd75b690 Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:18:20 +0000 Subject: [PATCH 18/19] fix --- .../templates/510-550-ibm-mas-masapp-configs.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml b/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml index e7211dd3..bc91caff 100644 --- a/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml +++ b/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml @@ -101,12 +101,14 @@ spec: gitops_version: "{{ $.Values.source.revision }}" {{- if (eq $value.mas_app_id "manage") }} + {{- if not (empty $.Values.ibm_db2u_databases) }} manage_db2u_databases: - {{- range $j, $db := $.Values.ibm_db2u_databases }} - {{- if (eq $db.mas_application_id "manage") }} + {{- range $j, $db := $.Values.ibm_db2u_databases }} + {{- if (eq $db.mas_application_id "manage") }} - db2_namespace: {{ $db.db2_namespace }} db2_instance_name: {{ $db.db2_instance_name }} db2_dbname: {{ $db.db2_dbname }} + {{- end }} {{- end }} {{- end }} {{- end }} From 89047a98b0a693f70d648a5dfd6e6c139cccd82c Mon Sep 17 00:00:00 2001 From: Tom Klapiscak <7372253+tomklapiscak@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:26:48 +0000 Subject: [PATCH 19/19] set postsync-db2 syncwaves --- ...-manage.yaml => 700-702-postsync-db2-manage.yaml} | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename instance-applications/510-550-ibm-mas-suite-app-config/templates/{05-postsync-db2-manage.yaml => 700-702-postsync-db2-manage.yaml} (96%) diff --git a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml b/instance-applications/510-550-ibm-mas-suite-app-config/templates/700-702-postsync-db2-manage.yaml similarity index 96% rename from instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml rename to instance-applications/510-550-ibm-mas-suite-app-config/templates/700-702-postsync-db2-manage.yaml index 1fc072c2..4cce1f35 100644 --- a/instance-applications/510-550-ibm-mas-suite-app-config/templates/05-postsync-db2-manage.yaml +++ b/instance-applications/510-550-ibm-mas-suite-app-config/templates/700-702-postsync-db2-manage.yaml @@ -6,8 +6,6 @@ {{ $sa_name := "postsync-manage-db2-sa" }} {{ $job_label := "postsync-manage-db2-job" }} -# TODO: set all syncwaves to low values so this runs first for testing, change this before delivery! - --- {{- /* Permit outbound communication by the Job pod (Needed to communicate with the K8S HTTP API) @@ -19,7 +17,7 @@ metadata: name: {{ $np_name }} namespace: {{ $manage_ns }} annotations: - argocd.argoproj.io/sync-wave: "0" + argocd.argoproj.io/sync-wave: "700" {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} @@ -45,7 +43,7 @@ metadata: name: "{{ $sa_name }}" namespace: "{{ $manage_ns }}" annotations: - argocd.argoproj.io/sync-wave: "0" + argocd.argoproj.io/sync-wave: "700" {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} @@ -87,7 +85,7 @@ metadata: name: "{{ $role_name }}" namespace: "{{ $db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "0" + argocd.argoproj.io/sync-wave: "700" {{- if $.Values.custom_labels }} labels: {{ $.Values.custom_labels | toYaml | indent 4 }} @@ -120,7 +118,7 @@ metadata: name: "{{ $rb_name }}" namespace: "{{ $db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "0" + argocd.argoproj.io/sync-wave: "701" {{- if $.Values.custom_labels }} labels: {{ $.Values.custom_labels | toYaml | indent 4 }} @@ -145,7 +143,7 @@ metadata: name: {{ $job_name }}-v1-{{ omit $.Values "junitreporter" | toYaml | adler32sum }} namespace: "{{ $manage_ns }}" annotations: - argocd.argoproj.io/sync-wave: "1" + argocd.argoproj.io/sync-wave: "702" {{- if $.Values.custom_labels }} labels: {{ $.Values.custom_labels | toYaml | indent 4 }}