If your database runs in a Kubernetes cluster, then you can put the database in maintenance mode by disabling liveness probes and startup probes, which run on your containerized application, to ensure that the database pod is in a healthy state. Maintenance mode helps you place a pod in a running state when you need to make a maintenance update or repair the pod.
The output doesn't contain the Liveness and Startup fields in the spec section of your POD_NAME pod.
Disable maintenance mode
To return to the standard database cluster behavior with running liveliness and startup probes, use the following command to remove maintenance from the spec section of your DBCluster manifest:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Use maintenance mode on a database cluster in Kubernetes\n\nSelect a documentation version: 16.8.0keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/kubernetes-maintenance-mode)\n- [16.8.0](/alloydb/omni/16.8.0/docs/kubernetes-maintenance-mode)\n- [16.3.0](/alloydb/omni/16.3.0/docs/kubernetes-maintenance-mode)\n- [15.12.0](/alloydb/omni/15.12.0/docs/kubernetes-maintenance-mode)\n- [15.7.1](/alloydb/omni/15.7.1/docs/kubernetes-maintenance-mode)\n- [15.7.0](/alloydb/omni/15.7.0/docs/kubernetes-maintenance-mode)\n\n\u003cbr /\u003e\n\nThis page shows you how to put the database in maintenance mode in a Kubernetes cluster.\n\n\u003cbr /\u003e\n\n\n| The information on this page applies only to AlloyDB Omni for Kubernetes. It does not apply to AlloyDB Omni for containers.\n\n\u003cbr /\u003e\n\nIf your database runs in a Kubernetes cluster, then you can put the database in maintenance mode by disabling [liveness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) and [startup probes](https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/#startup-probe), which run on your containerized application, to ensure that the database pod is in a healthy state. Maintenance mode helps you place a pod in a running state when you need to make a maintenance update or repair the pod.\n\nEnable maintenance mode\n-----------------------\n\n1. Verify that probes exist on a database pod:\n\n 1. Liveness probe:\n\n kubectl get po -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \u003cvar translate=\"no\"\u003eDATABASE_POD_NAME\u003c/var\u003e -o jsonpath='{.spec.containers[?(@.name==\"database\")].livenessProbe}'\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the name of a namespace used to run your database---for example, `db`.\n - \u003cvar translate=\"no\"\u003eDATABASE_POD_NAME\u003c/var\u003e: the name of the database pod---for example, `al-4017-dbcluster-sample-0`.\n\n The following shows sample output with a liveness probe: \n\n {\"failureThreshold\":3,\"httpGet\":{\"path\":\"/healthz?\",\"port\":8090,\"scheme\":\"HTTP\"},\"periodSeconds\":10,\"successThreshold\":1,\"timeoutSeconds\":3}\n\n 2. Startup probe:\n\n kubectl get po -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \u003cvar translate=\"no\"\u003eDATABASE_POD_NAME\u003c/var\u003e -o jsonpath='{.spec.containers[?(@.name==\"database\")].startupProbe}'\n\n The following shows sample output with a startup probe: \n\n {\"exec\":{\"command\":[\"/usr/lib/postgresql/15/bin/psql\",\"-hlocalhost\",\"-Ualloydbadmin\",\"-c\",\"SELECT 1\"]},\"failureThreshold\":180,\"periodSeconds\":10,\"successThreshold\":1,\"timeoutSeconds\":1}\n\n2. Set `mode` to `maintenance` in the `spec` section of your DBCluster manifest:\n\n apiVersion: alloydbomni.dbadmin.goog/v1\n kind: DBCluster\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eDB_CLUSTER_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eNAMESPACE\u003c/span\u003e\u003c/var\u003e\n spec:\n allowExternalIncomingTraffic: false\n isDeleted: false\n mode: maintenance\n primarySpec:\n ...\n\n Replace \u003cvar translate=\"no\"\u003eDB_CLUSTER_NAME\u003c/var\u003e with the name of this database cluster---for example, `my-db-cluster`.\n3. Apply the manifest:\n\n kubectl apply -f \u003cvar translate=\"no\"\u003eDB_CLUSTER_YAML\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eDB_CLUSTER_YAML\u003c/var\u003e with the name of this database cluster manifest file---for example, `alloydb-omni-db-cluster.yaml`.\n4. To verify that maintenance mode is enabled, run the following commands:\n\n - Liveness probe:\n\n kubectl get po -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \u003cvar translate=\"no\"\u003eDATABASE_POD_NAME\u003c/var\u003e -o jsonpath='{.spec.containers[?(@.name==\"database\")].livenessProbe}'\n\n - Startup probe:\n\n kubectl get po -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \u003cvar translate=\"no\"\u003eDATABASE_POD_NAME\u003c/var\u003e -o jsonpath='{.spec.containers[?(@.name==\"database\")].startupProbe}'\n\n The output doesn't contain the `Liveness` and `Startup` fields in the `spec` section of your \u003cvar translate=\"no\"\u003ePOD_NAME\u003c/var\u003e pod.\n\nDisable maintenance mode\n------------------------\n\nTo return to the standard database cluster behavior with running liveliness and startup probes, use the following command to remove `maintenance` from the `spec` section of your DBCluster manifest: \n\n kubectl patch dbclusters.alloydbomni.dbadmin.goog \u003cvar translate=\"no\"\u003eDB_CLUSTER_NAME\u003c/var\u003e -p '{\"spec\":{\"mode\":\"\"}}' --type=merge -n \u003cvar translate=\"no\"\u003eDB_CLUSTER_NAMESPACE\u003c/var\u003e --type=merge\n\nSample outputs:\n\n- With a liveness probe:\n\n {\"failureThreshold\":3,\"httpGet\":{\"path\":\"/healthz?\",\"port\":8090,\"scheme\":\"HTTP\"},\"periodSeconds\":10,\"successThreshold\":1,\"timeoutSeconds\":3}\n\n- With a startup probe:\n\n {\"exec\":{\"command\":[\"/usr/lib/postgresql/15/bin/psql\",\"-hlocalhost\",\"-Ualloydbadmin\",\"-c\",\"SELECT 1\"]},\"failureThreshold\":180, \"periodSeconds\":10,\"successThreshold\":1,\"timeoutSeconds\":1}"]]