Skip to content

[minor] Add manage online upgrade support #1829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ibm/mas_devops/roles/suite_app_config/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ cos_instance_name: "{{ lookup('env', 'COS_INSTANCE_NAME') }}"
cos_bucket_name: "{{ lookup('env', 'COS_BUCKET_NAME') }}"
ibmcloud_resourcegroup: "{{ lookup('env', 'IBMCLOUD_RESOURCEGROUP') }}"

# Only used by Manage (Upgrade type)
mas_appws_upgrade_type: "{{ lookup('env', 'MAS_APPWS_UPGRADE_TYPE') | default('regularUpgrade', true) }}"


# 4. Cloud Pak for Data integration (Predict, HP Utils)
# -----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ mas_appws_spec:
tableSpace: "{{ mas_app_settings_tablespace }}"
indexSpace: "{{ mas_app_settings_indexspace }}"
bypassUpgradeVersionCheck: false
upgrade:
upgradeType: "{{ mas_appws_upgrade_type }}"
customizationList: "{{ mas_app_settings_customization_list if (mas_app_settings_customization_archive_url is defined and mas_app_settings_customization_archive_url | length > 0) else [] }}"
8 changes: 8 additions & 0 deletions ibm/mas_devops/roles/suite_app_install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ The content of the configuration file should be the yaml block that you wish to

For full documentation of the supported options refer to the [Customizing Pod Templates](https://www.ibm.com/docs/en/mas-cd/continuous-delivery?topic=configuring-customizing-workloads) in the product documentation.

### mas_appws_upgrade_type
Provide the upgrade type to be used by Manage Workspace. The value of the environment variable should be either `regularUpgrade` or `onlineUpgrade`.

- Optional
- Environment Variable: `MAS_APPWS_UPGRADE_TYPE`
- Default: `regularUpgrade`

For full documentation of the upgrade types refer to the [Manage Upgrade information](https://www.ibm.com/docs/en/masv-and-l/cd?topic=database-reducing-system-downtime) in the product documentation.

Role Variables - Monitor Configuration
-------------------------------------------------------------------------------
Expand Down
38 changes: 38 additions & 0 deletions ibm/mas_devops/roles/suite_app_upgrade/tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,42 @@

# 5. Check that the Application Workspaces meet the required state
# -----------------------------------------------------------------------------
- name: 'Check if workspace CR reconciled version is updated to target version (manage only)'
kubernetes.core.k8s_info:
api_version: "{{ app_info[mas_app_id].api_version }}"
kind: "{{ app_info[mas_app_id].ws_kind }}"
namespace: "{{ mas_app_namespace }}"
label_selectors:
- mas.ibm.com/instanceId={{ mas_instance_id }}
- mas.ibm.com/applicationId={{ mas_app_id }}
retries: 30 # about 60 minutes
delay: 120 # 2 minutes
until:
- app_ws_cr_version.resources is defined
- app_ws_cr_version.resources[0].status.versions.reconciled == updated_opcon_version
when:
- mas_app_id == "manage"
register: app_ws_cr_version

- name: 'Check that all workspace CRs are healthy (manage only)'
kubernetes.core.k8s_info:
api_version: "{{ app_info[mas_app_id].api_version }}"
kind: "{{ app_info[mas_app_id].ws_kind }}"
namespace: "{{ mas_app_namespace }}"
label_selectors:
- mas.ibm.com/instanceId={{ mas_instance_id }}
- mas.ibm.com/applicationId={{ mas_app_id }}
retries: 60 # about 120 minutes
delay: 120 # 2 minutes
until:
- manage_ws_cr_lookup.resources is defined
- manage_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`Ready`][].reason') | select ('in', ['Ready']) | list | length == app_ws_cr_lookup.resources | length
- manage_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`Running`][].reason') | select ('in', ['Successful']) | list | length == app_ws_cr_lookup.resources | length
- manage_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`DeploymentCR`][].reason') | select ('in', ['Successful']) | list | length == app_ws_cr_lookup.resources | length
when:
- mas_app_id == "manage"
register: manage_ws_cr_lookup

- name: 'Check that all workspace CRs are healthy'
kubernetes.core.k8s_info:
api_version: "{{ app_info[mas_app_id].api_version }}"
Expand All @@ -96,6 +132,8 @@
until:
- app_ws_cr_lookup.resources is defined
- app_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`Ready`][].reason') | select ('in', ['Ready', 'WorkspaceReady']) | list | length == app_ws_cr_lookup.resources | length
when:
- mas_app_id != "manage"
register: app_ws_cr_lookup

- name: "{{ mas_app_id }} : Debug Workspaces"
Expand Down
Loading