Skip to content

Conversation

@janboll
Copy link
Collaborator

@janboll janboll commented Jan 28, 2026

https://issues.redhat.com/browse/AROSLSRE-400

What

Add a migration step before svc deployment.

Why

In order to enable autoscaling a migration of the container needs to be done. This adds a migration step before the cluster/svc resource creation. The script is idempotent (see log below) and can be run multiple times and also on missing rg/accounts for new environments. However the plan is to remove this once all cosmosdb have autoscaling enabled.

Special notes for your reviewer

Log showing that script works even if run multiple times:

➜  ARO-HCP git:(cosmosdb-autoscaling-migration) ✗ ./dev-infrastructure/scripts/migrate-cosomosdb.sh hcp-underlay-pers-usw3jbol arohcppers-rp-usw3jbol arohcppers-rp-usw3jbol Locks
Checking throughput configuration for container: Locks
  Account: arohcppers-rp-usw3jbol
  Database: arohcppers-rp-usw3jbol
  Resource Group: hcp-underlay-pers-usw3jbol
{
  "id": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/hcp-underlay-pers-usw3jbol/providers/Microsoft.DocumentDB/databaseAccounts/arohcppers-rp-usw3jbol/sqlDatabases/arohcppers-rp-usw3jbol/containers/Locks/throughputSettings/default/migrateToAutoscale",
  "location": null,
  "name": "jqid",
  "resource": {
    "autoscaleSettings": {
      "autoUpgradePolicy": null,
      "maxThroughput": 1000,
      "targetMaxThroughput": null
    },
    "etag": null,
    "instantMaximumThroughput": "10000",
    "minimumThroughput": "1000",
    "offerReplacePending": null,
    "rid": null,
    "softAllowedMaximumThroughput": "1000000",
    "throughput": 100,
    "ts": null
  },
  "resourceGroup": "hcp-underlay-pers-usw3jbol",
  "tags": null,
  "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings/migrateToAutoscale"
}
✓ Successfully migrated container 'Locks' to autoscaling
Verifying migration...
Warning: Migration completed but autoscaling may not be fully enabled yet
Current configuration:
{
  "id": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/hcp-underlay-pers-usw3jbol/providers/Microsoft.DocumentDB/databaseAccounts/arohcppers-rp-usw3jbol/sqlDatabases/arohcppers-rp-usw3jbol/containers/Locks/throughputSettings/default",
  "location": null,
  "name": "jqid",
  "resource": {
    "autoscaleSettings": {
      "autoUpgradePolicy": null,
      "maxThroughput": 1000,
      "targetMaxThroughput": null
    },
    "etag": null,
    "instantMaximumThroughput": "10000",
    "minimumThroughput": "1000",
    "offerReplacePending": null,
    "rid": null,
    "softAllowedMaximumThroughput": "1000000",
    "throughput": 100,
    "ts": null
  },
  "resourceGroup": "hcp-underlay-pers-usw3jbol",
  "tags": null,
  "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/throughputSettings"
}
➜  ARO-HCP git:(cosmosdb-autoscaling-migration) ✗ ./dev-infrastructure/scripts/migrate-cosomosdb.sh hcp-underlay-pers-usw3jbol arohcppers-rp-usw3jbol arohcppers-rp-usw3jbol Locks
Checking throughput configuration for container: Locks
  Account: arohcppers-rp-usw3jbol
  Database: arohcppers-rp-usw3jbol
  Resource Group: hcp-underlay-pers-usw3jbol
✓ Container 'Locks' already has autoscaling enabled (max throughput: 1000)

@openshift-ci openshift-ci bot requested a review from geoberle January 28, 2026 09:03
@openshift-ci openshift-ci bot requested a review from stevekuznetsov January 28, 2026 09:03
This script needs to work even if cosmos does not exists
@janboll janboll force-pushed the cosmosdb-autoscaling-migration branch from 5b1d3cb to 12f34c6 Compare January 28, 2026 09:28
@janboll janboll force-pushed the cosmosdb-autoscaling-migration branch from 1e4c2b1 to e66100f Compare January 28, 2026 10:04
@roivaz
Copy link
Collaborator

roivaz commented Jan 28, 2026

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jan 28, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: janboll, roivaz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@janboll
Copy link
Collaborator Author

janboll commented Jan 28, 2026

/test e2e-parallel

1 similar comment
@janboll
Copy link
Collaborator Author

janboll commented Jan 28, 2026

/test e2e-parallel

@janboll
Copy link
Collaborator Author

janboll commented Jan 30, 2026

/hold for the weekend, to not cause issues

@janboll
Copy link
Collaborator Author

janboll commented Feb 2, 2026

/test e2e-parallel

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 5a07441 and 2 for PR HEAD 0ce1e6c in total

@janboll
Copy link
Collaborator Author

janboll commented Feb 2, 2026

/retest-required

@openshift-ci
Copy link

openshift-ci bot commented Feb 2, 2026

@janboll: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-parallel 0ce1e6c link true /test e2e-parallel

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@janboll
Copy link
Collaborator Author

janboll commented Feb 2, 2026

/test e2e-parallel

@openshift-merge-bot openshift-merge-bot bot merged commit 6ac98bd into main Feb 2, 2026
18 of 19 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the cosmosdb-autoscaling-migration branch February 2, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants