View and set maintenance times

This page shows you how to perform the following actions related to AlloyDB for PostgreSQL cluster maintenance:

  • Set, view, and clear a maintenance window for your cluster.
  • View upcoming maintenance events scheduled for your cluster.

For an overview of how maintenance works with AlloyDB clusters, see About maintenance.

Set a maintenance window on a cluster

To set a maintenance window on a cluster, run the gcloud clusters update command with the --maintenance-window-day and --mainteanance-window-hour flags:

gcloud alloydb clusters update CLUSTER_ID \
   --region REGION \
   --maintenance-window-day DAY_OF_WEEK \
   --maintenance-window-hour HOUR_OF_DAY

Replace the following:

  • CLUSTER_ID: the cluster to set the maintenance window on.

  • REGION: the Google Cloud region that this cluster is located in—for example, us-central1.

  • DAY_OF_WEEK: the day of the week, in the UTC time zone, for this maintenance window. Valid values are MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY.

  • HOUR_OF_DAY: an integer between 0 and 23 representing the hour of the day, in the UTC time zone, for this maintenance window.

If you make changes to your maintenance window setting while the cluster is already undergoing maintenance or is scheduled for maintenance, then the changes don't take effect until after the current or scheduled maintenance is complete.

Clear a maintenance window

To clear the maintenance window from a cluster, run the gcloud clusters update command with the --maintenance-window-any flag:

gcloud alloydb clusters update CLUSTER_ID \
   --region REGION \
   --maintenance-window-any

Replace the following:

  • CLUSTER_ID: the cluster to set the maintenance window on.

  • REGION: the Google Cloud region that this cluster is located in—for example, us-central1.

View the maintenance window of a cluster

To review the current maintenance window on a cluster, run the gcloud alloydb clusters describe command:

gcloud alloydb clusters describe CLUSTER_ID \
   --region REGION

Replace the following:

  • CLUSTER_ID: the cluster to set the maintenance window on.

  • REGION: the Google Cloud region that this cluster is located in—for example, us-central1.

If the cluster has a maintenance window set, then the output of the command includes lines that resemble the following:

maintenanceUpdatePolicy:
  maintenanceWindows:
  - day: TUESDAY
    startTime:
      hours: 23

If the output doesn't include a maintenanceUpdatePolicy section, then the cluster has no maintenance window set.

View upcoming maintenance on a cluster

To see upcoming maintenance planned for a cluster that has a maintenance window set, run the gcloud clusters describe command:

gcloud alloydb clusters describe CLUSTER_ID \
   --region REGION

Replace the following:

  • CLUSTER_ID: the cluster to set the maintenance window on.

  • REGION: the Google Cloud region that this cluster is located in—for example, us-central1.

If the cluster has a planned maintenance event in its future, then the output of the command includes lines that resemble the following:

maintenanceSchedule:
  startTime: 2024-07-03T09:46:40Z

The UTC-formatted timestamp specifies the moment at which AlloyDB plans to start updating the system software of all of the nodes in this cluster.

Opt in to maintenance notifications

To receive an automated email notification whenever a maintenance event is scheduled or canceled for a cluster that has a maintenance window set, use the Google Cloud console to opt in to receiving these messages:

  1. Go to the Communication page. Go to Communication
  2. In the row for AlloyDB, Maintenance window, select the toggle in the Email column.

Each user that needs to receive notifications must opt in separately.