diff --git a/instance-applications/120-ibm-db2u-database/README.md b/instance-applications/120-ibm-db2u-database/README.md index 6c4ee6388..1c59a187c 100644 --- a/instance-applications/120-ibm-db2u-database/README.md +++ b/instance-applications/120-ibm-db2u-database/README.md @@ -351,4 +351,4 @@ cluster_domain: "" ## Related Documentation - [Instance Base Values Reference](../../docs/reference/instance-base-values.md) -- [IBM Db2u Operator Documentation](https://www.ibm.com/docs/en/db2/11.5) +- [IBM Db2u Operator Documentation](https://www.ibm.com/docs/en/db2/11.5) \ No newline at end of file diff --git a/instance-applications/120-ibm-db2u-database/templates/01-db2_Issuer.yaml b/instance-applications/120-ibm-db2u-database/templates/01-db2_Issuer.yaml index a012b7520..cdee11114 100644 --- a/instance-applications/120-ibm-db2u-database/templates/01-db2_Issuer.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/01-db2_Issuer.yaml @@ -6,7 +6,7 @@ metadata: name: "db2u-issuer-{{ .Values.db2_instance_name }}" namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "120" + argocd.argoproj.io/sync-wave: {{ add 120 (ternary 600 0 (contains "sdb" .Values.db2_instance_name)) | quote }} {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} diff --git a/instance-applications/120-ibm-db2u-database/templates/02-db2_Certificate.yaml b/instance-applications/120-ibm-db2u-database/templates/02-db2_Certificate.yaml index 242359e4d..004f4bd89 100644 --- a/instance-applications/120-ibm-db2u-database/templates/02-db2_Certificate.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/02-db2_Certificate.yaml @@ -6,7 +6,7 @@ metadata: name: "db2u-certificate-{{ .Values.db2_instance_name }}" namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "121" + argocd.argoproj.io/sync-wave: {{ add 121 (ternary 600 0 (contains "sdb" .Values.db2_instance_name)) | quote }} {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} diff --git a/instance-applications/120-ibm-db2u-database/templates/03-db2uinstance.yaml b/instance-applications/120-ibm-db2u-database/templates/03-db2uinstance.yaml index bff8d5087..2ba99e0a5 100644 --- a/instance-applications/120-ibm-db2u-database/templates/03-db2uinstance.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/03-db2uinstance.yaml @@ -6,8 +6,8 @@ metadata: name: "{{ .Values.db2_instance_name | lower }}" namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "122" - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + argocd.argoproj.io/sync-wave: {{ add 122 (ternary 600 0 (contains "sdb" .Values.db2_instance_name)) | quote }} + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} diff --git a/instance-applications/120-ibm-db2u-database/templates/04-db2u-Backup_Cron.yaml b/instance-applications/120-ibm-db2u-database/templates/04-db2u-Backup_Cron.yaml index 6340ff108..d34a9bdaa 100644 --- a/instance-applications/120-ibm-db2u-database/templates/04-db2u-Backup_Cron.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/04-db2u-Backup_Cron.yaml @@ -12,6 +12,8 @@ apiVersion: batch/v1 metadata: name: "db2-backup-job-v1-{{ .Values.db2_instance_name }}" namespace: "{{ .Values.db2_namespace }}" + annotations: + argocd.argoproj.io/sync-wave: "525" labels: parent: cronjob cosBucket: "{{ .Values.db2_backup_bucket_name }}" diff --git a/instance-applications/120-ibm-db2u-database/templates/06-tlsroute.yaml b/instance-applications/120-ibm-db2u-database/templates/06-tlsroute.yaml index 47a511e6d..ffa335a3b 100644 --- a/instance-applications/120-ibm-db2u-database/templates/06-tlsroute.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/06-tlsroute.yaml @@ -13,7 +13,7 @@ metadata: name: db2u-{{ .Values.db2_instance_name }}-tls-route namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "123" + argocd.argoproj.io/sync-wave: {{ add 123 (ternary 600 0 (contains "sdb" .Values.db2_instance_name)) | quote }} labels: formation_id: "{{ .Values.db2_instance_name | lower }}" {{- if eq .Values.jdbc_route "public" }} diff --git a/instance-applications/120-ibm-db2u-database/templates/08-postdelete-db2-user-job-rbac.yaml b/instance-applications/120-ibm-db2u-database/templates/08-postdelete-db2-user-job-rbac.yaml index 7048e5c1b..5da4161b5 100644 --- a/instance-applications/120-ibm-db2u-database/templates/08-postdelete-db2-user-job-rbac.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/08-postdelete-db2-user-job-rbac.yaml @@ -19,7 +19,7 @@ metadata: name: aws-db2-user-job-{{ .Values.instance_id }}-{{ .Values.mas_application_id }}-{{ .Values.db2_instance_name }}-role-db2 namespace: {{ .Values.db2_namespace }} annotations: - argocd.argoproj.io/sync-wave: "121" + argocd.argoproj.io/sync-wave: {{ add 121 (ternary 600 0 (contains "sdb" .Values.db2_instance_name)) | quote }} {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} @@ -59,7 +59,7 @@ metadata: name: aws-db2-user-job-{{ .Values.instance_id }}-{{ .Values.mas_application_id }}-{{ .Values.db2_instance_name }}-rolebinding-db2 namespace: {{ .Values.db2_namespace }} annotations: - argocd.argoproj.io/sync-wave: "122" + argocd.argoproj.io/sync-wave: {{ add 122 (ternary 600 0 (contains "sdb" .Values.db2_instance_name)) | quote }} {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} diff --git a/instance-applications/120-ibm-db2u-database/templates/09-hadr_services.yaml b/instance-applications/120-ibm-db2u-database/templates/09-hadr_services.yaml index f137786ed..ee8e4a1e1 100644 --- a/instance-applications/120-ibm-db2u-database/templates/09-hadr_services.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/09-hadr_services.yaml @@ -6,6 +6,8 @@ kind: Service metadata: name: c-{{ .Values.db2_instance_name }}-db2u-hadr-svc namespace: "{{ .Values.db2_namespace }}" + annotations: + argocd.argoproj.io/sync-wave: "720" spec: selector: app: {{ .Values.db2_instance_name }} @@ -30,6 +32,8 @@ kind: NetworkPolicy metadata: name: c-{{ .Values.db2_instance_name }}-hadr-ext namespace: "{{ .Values.db2_namespace }}" + annotations: + argocd.argoproj.io/sync-wave: "720" spec: ingress: - ports: diff --git a/instance-applications/120-ibm-db2u-database/templates/10-postsync-setup-hadr.yaml b/instance-applications/120-ibm-db2u-database/templates/10-postsync-setup-hadr.yaml index 7c7524d48..4fa56712e 100644 --- a/instance-applications/120-ibm-db2u-database/templates/10-postsync-setup-hadr.yaml +++ b/instance-applications/120-ibm-db2u-database/templates/10-postsync-setup-hadr.yaml @@ -67,7 +67,7 @@ metadata: name: "postsync-hadr-sa-{{ .Values.db2_instance_name }}" namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "128" + argocd.argoproj.io/sync-wave: "728" {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} @@ -81,7 +81,7 @@ metadata: name: "db2-database-postsync-hadr-sa-role-{{ .Values.db2_instance_name }}" namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "128" + argocd.argoproj.io/sync-wave: "728" {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} @@ -143,7 +143,7 @@ metadata: name: "db2-database-postsync-hadr-sa-rb-{{ .Values.db2_instance_name }}" namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "128" + argocd.argoproj.io/sync-wave: "728" {{- if .Values.custom_labels }} labels: {{ .Values.custom_labels | toYaml | indent 4 }} @@ -164,7 +164,7 @@ metadata: name: {{ $_job_name }} namespace: "{{ .Values.db2_namespace }}" annotations: - argocd.argoproj.io/sync-wave: "130" + argocd.argoproj.io/sync-wave: "730" labels: mas.ibm.com/job-cleanup-group: {{ $_job_cleanup_group }} {{- if .Values.custom_labels }} diff --git a/root-applications/ibm-mas-instance-root/README.md b/root-applications/ibm-mas-instance-root/README.md index 2f00bc545..83ef6c162 100644 --- a/root-applications/ibm-mas-instance-root/README.md +++ b/root-applications/ibm-mas-instance-root/README.md @@ -61,7 +61,14 @@ Applications are deployed in the following order (controlled by sync-wave annota 2. **100-121: Dependencies** - SLS, Db2, CP4D, databases, and CP4D services 3. **130: MAS Suite** - Core MAS suite installation and configurations 4. **200: Workspaces** - MAS workspace creation -5. **500-550: Applications** - MAS application installations and configurations +5. **500-551: Applications** - each MAS app is deployed as a contiguous block: primary Db2 (PDB) -> in-cluster Db2 JDBC config -> app install -> app workspace config -> standby Db2 (SDB). Waves are computed by the `ibm-mas-instance-root.syncwave` helper in [`_helpers.tpl`](templates/_helpers.tpl). The JDBC config (`130-ibm-mas-suite-configs-app.yaml`) moves into the block only for in-cluster Db2 of non-Manage apps; otherwise it stays at `130`. + - **Manage**: PDB `120`, install `502`, workspace config `503`, SDB `504` (JDBC config stays at `130`) + - **Facilities**: PDB `505`, JDBC `506`, install `507`, workspace config `508`, SDB `509` + - **Monitor / IoT**: Monitor then IoT when the Monitor or IoT channel is >= 9.2 (Monitor `510`-`514`, IoT `515`-`519`); otherwise IoT then Monitor (IoT `510`-`514`, Monitor `515`-`519`) + - **Health**: PDB `520`, JDBC `521`, install `522`, workspace config `523`, SDB `524` + - **Assist**: `525`-`529`; **Visual Inspection**: `530`-`534`; **Optimizer**: `535`-`539` + - **Predict**: PDB `540`, JDBC `541`, install `542`, workspace config `543`, SDB `544` + - **551**: Addons config 6. **600: RBAC & Post-Sync** - RBAC setup and post-deployment validation ## Configuration Files @@ -207,7 +214,7 @@ The following table lists all ArgoCD applications defined in the templates folde | [`110-ibm-cp4d-operator-app.yaml`](templates/110-ibm-cp4d-operator-app.yaml) | cp4doperator | ✓ | | | 110 | | [`110-ibm-cs-control-app.yaml`](templates/110-ibm-cs-control-app.yaml) | cscontrol | ✓ | | | 110 | | [`110-ibm-db2u-app.yaml`](templates/110-ibm-db2u-app.yaml) | db2u | ✓ | | | 110 | -| [`120-db2-databases-app.yaml`](templates/120-db2-databases-app.yaml) | db2-db | | ✓ | | 120 | +| [`120-db2-databases-app.yaml`](templates/120-db2-databases-app.yaml) | db2-db | | ✓ | | Per app block, see Deployment Sequence (PDB first, SDB after the workspace config) | | [`120-dbs-rds-databases-app.yaml`](templates/120-dbs-rds-databases-app.yaml) | dbs-rds-db | | | ✓ | 120 | | [`120-ibm-cognos-analytics-app.yaml`](templates/120-ibm-cognos-analytics-app.yaml) | cognos | ✓ | | | 120 | | [`120-ibm-spark-app.yaml`](templates/120-ibm-spark-app.yaml) | spark | ✓ | | | 120 | @@ -218,17 +225,17 @@ The following table lists all ArgoCD applications defined in the templates folde | [`130-ibm-mas-suite-app.yaml`](templates/130-ibm-mas-suite-app.yaml) | suite | | | ✓ | 130 | | [`130-ibm-mas-suite-configs-app.yaml`](templates/130-ibm-mas-suite-configs-app.yaml) | mas_config_name | | ✓ | | 130 | | [`200-ibm-mas-workspaces.yaml`](templates/200-ibm-mas-workspaces.yaml) | workspace | | ✓ | | 200 | -| [`500-ibm-mas-masapp-manage-install.yaml`](templates/500-ibm-mas-masapp-manage-install.yaml) | manage | | | ✓ | 500 | -| [`505-ibm-mas-masapp-facilities-install.yaml`](templates/505-ibm-mas-masapp-facilities-install.yaml) | facilities | | | ✓ | 505 | -| [`510-ibm-mas-masapp-assist-install.yaml`](templates/510-ibm-mas-masapp-assist-install.yaml) | assist | | | ✓ | 510 | -| [`510-ibm-mas-masapp-iot-install.yaml`](templates/510-ibm-mas-masapp-iot-install.yaml) | iot | | | ✓ | 510 | -| [`510-ibm-mas-masapp-visualinspection-install.yaml`](templates/510-ibm-mas-masapp-visualinspection-install.yaml) | visualinspection | | | ✓ | 510 | -| [`510-550-ibm-mas-masapp-configs.yaml`](templates/510-550-ibm-mas-masapp-configs.yaml) | masapp-config | | ✓ | | 510-550 | -| [`520-ibm-mas-masapp-health-install.yaml`](templates/520-ibm-mas-masapp-health-install.yaml) | health | | | ✓ | 520 | -| [`520-ibm-mas-masapp-monitor-install.yaml`](templates/520-ibm-mas-masapp-monitor-install.yaml) | monitor | | | ✓ | 520 | -| [`520-ibm-mas-masapp-optimizer-install.yaml`](templates/520-ibm-mas-masapp-optimizer-install.yaml) | optimizer | | | ✓ | 520 | -| [`540-ibm-mas-masapp-predict-install.yaml`](templates/540-ibm-mas-masapp-predict-install.yaml) | predict | | | ✓ | 540 | -| [`550-ibm-mas-addons-config.yaml`](templates/550-ibm-mas-addons-config.yaml) | addons | | ✓ | | 550 | +| [`500-ibm-mas-masapp-manage-install.yaml`](templates/500-ibm-mas-masapp-manage-install.yaml) | manage | | | ✓ | Per app block, see Deployment Sequence | +| [`505-ibm-mas-masapp-facilities-install.yaml`](templates/505-ibm-mas-masapp-facilities-install.yaml) | facilities | | | ✓ | Per app block, see Deployment Sequence | +| [`510-ibm-mas-masapp-assist-install.yaml`](templates/510-ibm-mas-masapp-assist-install.yaml) | assist | | | ✓ | Per app block, see Deployment Sequence | +| [`510-ibm-mas-masapp-iot-install.yaml`](templates/510-ibm-mas-masapp-iot-install.yaml) | iot | | | ✓ | Per app block, see Deployment Sequence | +| [`510-ibm-mas-masapp-visualinspection-install.yaml`](templates/510-ibm-mas-masapp-visualinspection-install.yaml) | visualinspection | | | ✓ | Per app block, see Deployment Sequence | +| [`510-550-ibm-mas-masapp-configs.yaml`](templates/510-550-ibm-mas-masapp-configs.yaml) | masapp-config | | ✓ | | Per app block, see Deployment Sequence | +| [`520-ibm-mas-masapp-health-install.yaml`](templates/520-ibm-mas-masapp-health-install.yaml) | health | | | ✓ | Per app block, see Deployment Sequence | +| [`520-ibm-mas-masapp-monitor-install.yaml`](templates/520-ibm-mas-masapp-monitor-install.yaml) | monitor | | | ✓ | Per app block, see Deployment Sequence | +| [`520-ibm-mas-masapp-optimizer-install.yaml`](templates/520-ibm-mas-masapp-optimizer-install.yaml) | optimizer | | | ✓ | Per app block, see Deployment Sequence | +| [`540-ibm-mas-masapp-predict-install.yaml`](templates/540-ibm-mas-masapp-predict-install.yaml) | predict | | | ✓ | Per app block, see Deployment Sequence | +| [`550-ibm-mas-addons-config.yaml`](templates/550-ibm-mas-addons-config.yaml) | addons | | ✓ | | 551 | | [`600-application-admin-rbac-app.yaml`](templates/600-application-admin-rbac-app.yaml) | application-admin-rbac | | ✓ | | 600 | | [`600-ibm-post-sync-jobs.yaml`](templates/600-ibm-post-sync-jobs.yaml) | postsyncjobs | | | ✓ | 600 | diff --git a/root-applications/ibm-mas-instance-root/templates/120-db2-databases-app.yaml b/root-applications/ibm-mas-instance-root/templates/120-db2-databases-app.yaml index 1b3f19fd9..2717b5064 100644 --- a/root-applications/ibm-mas-instance-root/templates/120-db2-databases-app.yaml +++ b/root-applications/ibm-mas-instance-root/templates/120-db2-databases-app.yaml @@ -19,11 +19,11 @@ metadata: instance: '{{ $.Values.instance.id }}' appId: '{{ $value.mas_application_id }}' annotations: -{{ if not (contains "sdb" $value.db2_instance_name) }} - argocd.argoproj.io/sync-wave: "120" -{{ else }} - argocd.argoproj.io/sync-wave: "121" -{{ end }} +{{- if not (contains "sdb" $value.db2_instance_name) }} + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" $value.mas_application_id "step" "pdb") }}" +{{- else }} + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" $value.mas_application_id "step" "sdb") }}" +{{- end }} {{- if and $.Values.notifications $.Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ $.Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ $.Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/130-ibm-mas-suite-configs-app.yaml b/root-applications/ibm-mas-instance-root/templates/130-ibm-mas-suite-configs-app.yaml index 4e3d84ec8..1f64fc922 100644 --- a/root-applications/ibm-mas-instance-root/templates/130-ibm-mas-suite-configs-app.yaml +++ b/root-applications/ibm-mas-instance-root/templates/130-ibm-mas-suite-configs-app.yaml @@ -21,6 +21,9 @@ metadata: annotations: {{- if eq $value.mas_config_chart "ibm-mas-aicfg-config" }} argocd.argoproj.io/sync-wave: "190" + {{- else if and (eq $value.mas_config_chart "ibm-jdbc-config") (eq ($value.jdbc_type | default "") "incluster-db2") (not (empty $value.mas_application_id)) (ne $value.mas_application_id "manage") }} + {{- /* In-cluster Db2 JDBC config reads secrets written by the app's Db2 post-sync job, so it must sync after that app's PDB and before the app install (jdbc wave = PDB + 1, install = PDB + 2). Manage PDB is at 120, so Manage stays at 130. */}} + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" $value.mas_application_id "step" "jdbc") | default "130" }}" {{- else }} argocd.argoproj.io/sync-wave: "130" {{- end }} diff --git a/root-applications/ibm-mas-instance-root/templates/500-ibm-mas-masapp-manage-install.yaml b/root-applications/ibm-mas-instance-root/templates/500-ibm-mas-masapp-manage-install.yaml index b810ecf47..6b7a112e4 100644 --- a/root-applications/ibm-mas-instance-root/templates/500-ibm-mas-masapp-manage-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/500-ibm-mas-masapp-manage-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'manage' annotations: - argocd.argoproj.io/sync-wave: "500" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "manage" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/505-ibm-mas-masapp-facilities-install.yaml b/root-applications/ibm-mas-instance-root/templates/505-ibm-mas-masapp-facilities-install.yaml index e91627a58..9ce4db23c 100644 --- a/root-applications/ibm-mas-instance-root/templates/505-ibm-mas-masapp-facilities-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/505-ibm-mas-masapp-facilities-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'facilities' annotations: - argocd.argoproj.io/sync-wave: "505" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "facilities" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} 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 fb15a3fad..a81b29098 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 @@ -5,17 +5,6 @@ For example: {{ $.Values.account.id }} (instead of {{ .Values.account.id }} ) {{ $app_dest_ns := printf "mas-%s-core" .Values.instance.id }} -{{- /* Helper variables to check if app versions are >= 9.2 */ -}} -{{- $iot_is_v92_or_higher := false -}} -{{- if and .Values.ibm_suite_app_iot_install .Values.ibm_suite_app_iot_install.mas_app_channel -}} - {{- $iot_is_v92_or_higher = regexMatch "^9\\.(2|[3-9]|[1-9][0-9])\\..*" .Values.ibm_suite_app_iot_install.mas_app_channel -}} -{{- end -}} - -{{- $monitor_is_v92_or_higher := false -}} -{{- if and .Values.ibm_suite_app_monitor_install .Values.ibm_suite_app_monitor_install.mas_app_channel -}} - {{- $monitor_is_v92_or_higher = regexMatch "^9\\.(2|[3-9]|[1-9][0-9])\\..*" .Values.ibm_suite_app_monitor_install.mas_app_channel -}} -{{- end -}} - {{- range $i, $value := .Values.ibm_mas_masapp_configs }} {{- if $.Values.application_admin_role }} --- @@ -25,33 +14,7 @@ metadata: name: "{{ $value.mas_workspace_id }}.{{ $value.mas_app_id }}.{{ $.Values.cluster.id }}.{{ $.Values.instance.id }}" namespace: {{ $.Values.argo.namespace }} annotations: - {{- if eq $value.mas_app_id "assist" }} - argocd.argoproj.io/sync-wave: "515" - {{- else if eq $value.mas_app_id "facilities" }} - argocd.argoproj.io/sync-wave: "510" - {{- else if eq $value.mas_app_id "iot" }} - {{- if $iot_is_v92_or_higher }} - argocd.argoproj.io/sync-wave: "530" - {{- else }} - argocd.argoproj.io/sync-wave: "515" - {{- end }} - {{- else if eq $value.mas_app_id "manage" }} - argocd.argoproj.io/sync-wave: "510" - {{- else if eq $value.mas_app_id "visualinspection" }} - argocd.argoproj.io/sync-wave: "515" - {{- else if eq $value.mas_app_id "health" }} - argocd.argoproj.io/sync-wave: "530" - {{- else if eq $value.mas_app_id "monitor" }} - {{- if $monitor_is_v92_or_higher }} - argocd.argoproj.io/sync-wave: "515" - {{- else }} - argocd.argoproj.io/sync-wave: "530" - {{- end }} - {{- else if eq $value.mas_app_id "optimizer" }} - argocd.argoproj.io/sync-wave: "530" - {{- else if eq $value.mas_app_id "predict" }} - argocd.argoproj.io/sync-wave: "550" - {{- end }} + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" $value.mas_app_id "step" "config") }}" {{- if and $.Values.notifications $.Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ $.Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ $.Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-assist-install.yaml b/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-assist-install.yaml index 9bf8af15d..6de89bcb1 100644 --- a/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-assist-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-assist-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'assist' annotations: - argocd.argoproj.io/sync-wave: "510" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "assist" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-iot-install.yaml b/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-iot-install.yaml index 933b40fcd..eba9be7b0 100644 --- a/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-iot-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-iot-install.yaml @@ -1,19 +1,4 @@ {{- if not (empty .Values.ibm_suite_app_iot_install) }} -{{- /* Calculate sync wave based on mas_app_channel version */ -}} -{{- $syncwave := "510" -}} -{{- if .Values.ibm_suite_app_iot_install.mas_app_channel -}} - {{- $channel := .Values.ibm_suite_app_iot_install.mas_app_channel | toString -}} - {{- $version := regexFind `^[0-9]+\.[0-9]+` $channel -}} - {{- if $version -}} - {{- $parts := splitList "." $version -}} - {{- $major := index $parts 0 | int -}} - {{- $minor := index $parts 1 | int -}} - {{- /* Use sync wave 520 for version >= 9.2, otherwise 510 */ -}} - {{- if or (gt $major 9) (and (eq $major 9) (ge $minor 2)) -}} - {{- $syncwave = "520" -}} - {{- end -}} - {{- end -}} -{{- end -}} --- # IBM Maximo Operator Catalog apiVersion: argoproj.io/v1alpha1 @@ -31,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'iot' annotations: - argocd.argoproj.io/sync-wave: "{{ $syncwave }}" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "iot" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-visualinspection-install.yaml b/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-visualinspection-install.yaml index 8ce59205e..acf00e70a 100644 --- a/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-visualinspection-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/510-ibm-mas-masapp-visualinspection-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'visualinspection' annotations: - argocd.argoproj.io/sync-wave: "510" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "visualinspection" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-health-install.yaml b/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-health-install.yaml index ccf742f6e..35dd9cd3f 100644 --- a/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-health-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-health-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'health' annotations: - argocd.argoproj.io/sync-wave: "520" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "health" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-monitor-install.yaml b/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-monitor-install.yaml index a556d806d..41f297536 100644 --- a/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-monitor-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-monitor-install.yaml @@ -1,19 +1,4 @@ {{- if not (empty .Values.ibm_suite_app_monitor_install) }} -{{- /* Calculate sync wave based on mas_app_channel version */ -}} -{{- $syncwave := "520" -}} -{{- if .Values.ibm_suite_app_monitor_install.mas_app_channel -}} - {{- $channel := .Values.ibm_suite_app_monitor_install.mas_app_channel | toString -}} - {{- $version := regexFind `^[0-9]+\.[0-9]+` $channel -}} - {{- if $version -}} - {{- $parts := splitList "." $version -}} - {{- $major := index $parts 0 | int -}} - {{- $minor := index $parts 1 | int -}} - {{- /* Use sync wave 510 for version >= 9.2, otherwise 520 */ -}} - {{- if or (gt $major 9) (and (eq $major 9) (ge $minor 2)) -}} - {{- $syncwave = "510" -}} - {{- end -}} - {{- end -}} -{{- end -}} --- # IBM Maximo Operator Catalog apiVersion: argoproj.io/v1alpha1 @@ -31,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'monitor' annotations: - argocd.argoproj.io/sync-wave: "{{ $syncwave }}" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "monitor" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-optimizer-install.yaml b/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-optimizer-install.yaml index 7002ec67f..22538ecab 100644 --- a/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-optimizer-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/520-ibm-mas-masapp-optimizer-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'optimizer' annotations: - argocd.argoproj.io/sync-wave: "520" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "optimizer" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/540-ibm-mas-masapp-predict-install.yaml b/root-applications/ibm-mas-instance-root/templates/540-ibm-mas-masapp-predict-install.yaml index 26c1df86d..4cf6006c8 100644 --- a/root-applications/ibm-mas-instance-root/templates/540-ibm-mas-masapp-predict-install.yaml +++ b/root-applications/ibm-mas-instance-root/templates/540-ibm-mas-masapp-predict-install.yaml @@ -16,7 +16,7 @@ metadata: instance: '{{ .Values.instance.id }}' masapp: 'predict' annotations: - argocd.argoproj.io/sync-wave: "540" + argocd.argoproj.io/sync-wave: "{{ include "ibm-mas-instance-root.syncwave" (dict "root" $ "app" "predict" "step" "install") }}" {{- if and .Values.notifications .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-failed.workspace1: {{ .Values.notifications.slack_channel_id }} notifications.argoproj.io/subscribe.on-sync-succeeded.workspace1: {{ .Values.notifications.slack_channel_id }} diff --git a/root-applications/ibm-mas-instance-root/templates/_helpers.tpl b/root-applications/ibm-mas-instance-root/templates/_helpers.tpl new file mode 100644 index 000000000..1a162b657 --- /dev/null +++ b/root-applications/ibm-mas-instance-root/templates/_helpers.tpl @@ -0,0 +1,58 @@ +{{- /* +Returns the ArgoCD sync-wave for one step of a MAS application's "block". + +Each MAS application is deployed as a contiguous block, in this order: + pdb -> primary Db2 database (non-sdb instance) + jdbc -> in-cluster Db2 JDBC config (JdbcCfg) of the app, so it exists before the app install + install -> MAS application install + config -> MAS application workspace config (e.g. ManageWorkspace) + sdb -> standby Db2 database (sdb instance) +Blocks are ordered: manage, facilities, monitor/iot, health, assist, visualinspection, optimizer, predict. +Addons config (551) and RBAC / post-sync jobs (600) run after all blocks. + +Block base waves (pdb = base, jdbc = base+1, install = base+2, config = base+3, sdb = base+4): + manage 500 (its pdb stays at 120 so it is ready ahead of the suite and workspaces), + facilities 505, monitor/iot 510 then 515, health 520, assist 525, visualinspection 530, + optimizer 535, predict 540 + +Monitor/iot keep the channel-aware order used on main: when the Monitor or IoT channel is >= 9.2, +Monitor goes first (510) and IoT second (515), otherwise IoT first (510) and Monitor second (515). + +Arguments (dict): root = chart root context ($), app = mas app id, step = pdb|jdbc|install|config|sdb +For an app without a block: pdb returns 120, sdb returns 549 and jdbc/install/config return nothing. +*/}} +{{- define "ibm-mas-instance-root.syncwave" -}} +{{- $app := .app | default "" -}} +{{- $monitorFirst := false -}} +{{- range $cfg := list .root.Values.ibm_suite_app_monitor_install .root.Values.ibm_suite_app_iot_install -}} + {{- if and $cfg $cfg.mas_app_channel -}} + {{- $version := regexFind `^[0-9]+\.[0-9]+` ($cfg.mas_app_channel | toString) -}} + {{- if $version -}} + {{- $parts := splitList "." $version -}} + {{- $major := index $parts 0 | int -}} + {{- $minor := index $parts 1 | int -}} + {{- if or (gt $major 9) (and (eq $major 9) (ge $minor 2)) -}} + {{- $monitorFirst = true -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- $bases := dict "manage" 500 "facilities" 505 "health" 520 "assist" 525 "visualinspection" 530 "optimizer" 535 "predict" 540 -}} +{{- if $monitorFirst -}} + {{- $_ := set $bases "monitor" 510 -}} + {{- $_ := set $bases "iot" 515 -}} +{{- else -}} + {{- $_ := set $bases "iot" 510 -}} + {{- $_ := set $bases "monitor" 515 -}} +{{- end -}} +{{- $offsets := dict "pdb" 0 "jdbc" 1 "install" 2 "config" 3 "sdb" 4 -}} +{{- if and (eq $app "manage") (eq .step "pdb") -}} +120 +{{- else if hasKey $bases $app -}} +{{ add (get $bases $app) (get $offsets .step) }} +{{- else if eq .step "pdb" -}} +120 +{{- else if eq .step "sdb" -}} +549 +{{- end -}} +{{- end -}}