---
title: "Replace the specified database cluster"
method: PUT
path: "/namespaces/{namespace}/database-clusters/{name}"
tags: ["databaseCluster"]
---

# Replace the specified database cluster

`PUT /namespaces/{namespace}/database-clusters/{name}`

Replace the specified database cluster

## Path parameters

- `namespace` string, required
- `name` string, required

## Request body

- DatabaseCluster — DatabaseCluster is the Schema for the databaseclusters API.
  - `apiVersion` string — APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  - `kind` string — Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  - `metadata` object
  - `spec` object — DatabaseClusterSpec defines the desired state of DatabaseCluster.
    - `allowUnsafeConfiguration` boolean — AllowUnsafeConfiguration field used to ensure that the user can create configurations unfit for production use.
    - `backup` object — Backup is the backup specification
      - `enabled` boolean, required — Enabled is a flag to enable backups
      - `pitr` object — PITR is the configuration of the point in time recovery
        - `backupStorageName` string — BackupStorageName is the name of the BackupStorage where the PITR is enabled
        - `enabled` boolean, required — Enabled is a flag to enable PITR
        - `uploadIntervalSec` integer — UploadIntervalSec number of seconds between the binlogs uploads
      - `schedules` object[] — Schedules is a list of backup schedules
        - `backupStorageName` string, required — BackupStorageName is the name of the BackupStorage CR that defines the storage location
        - `enabled` boolean, required — Enabled is a flag to enable the schedule
        - `name` string, required — Name is the name of the schedule
        - `retentionCopies` integer — RetentionCopies is the number of backup copies to retain
        - `schedule` string, required — Schedule is the cron schedule
    - `dataSource` object — DataSource defines a data source for bootstraping a new cluster
      - `backupSource` object — BackupSource is the backup source to restore from
        - `backupStorageName` string, required — BackupStorageName is the name of the BackupStorage used for backups.
        - `path` string, required — Path is the path to the backup file/directory.
      - `dbClusterBackupName` string — DBClusterBackupName is the name of the DB cluster backup to restore from
      - `pitr` object — PITR is the point-in-time recovery configuration
        - `date` string — Date is the UTC date to recover to. The accepted format: "2006-01-02T15:04:05Z".
        - `type` 'date' | 'latest' — Type is the type of recovery.
    - `engine` object, required — Engine is the database engine specification
      - `config` string — Config is the engine configuration
      - `replicas` integer — Replicas is the number of engine replicas
      - `resources` object — Resources are the resource limits for each engine replica. If not set, resource limits are not imposed
        - `cpu` union — CPU is the CPU resource requirements
          - integer
          - string
        - `memory` union — Memory is the memory resource requirements
          - integer
          - string
      - `storage` object, required — Storage is the engine storage configuration
        - `class` string — Class is the storage class to use for the persistent volume claim
        - `size` union, required — Size is the size of the persistent volume claim
          - integer
          - string
      - `type` 'pxc' | 'postgresql' | 'psmdb', required — Type is the engine type
      - `userSecretsName` string — UserSecretsName is the name of the secret containing the user secrets
      - `version` string — Version is the engine version
    - `monitoring` object — Monitoring is the monitoring configuration
      - `monitoringConfigName` string — MonitoringConfigName is the name of a monitoringConfig CR.
      - `resources` object — Resources defines resource limitations for the monitoring.
        - `claims` object[] — Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers.
          - `name` string, required — Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
        - `limits` object — Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
        - `requests` object — Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    - `paused` boolean — Paused is a flag to stop the cluster
    - `proxy` object — Proxy is the proxy specification. If not set, an appropriate proxy specification will be applied for the given engine. A common use case for setting this field is to control the external access to the database cluster.
      - `config` string — Config is the proxy configuration
      - `expose` object — Expose is the proxy expose configuration
        - `ipSourceRanges` string[] — IPSourceRanges is the list of IP source ranges (CIDR notation) to allow access from. If not set, there is no limitations
        - `type` 'internal' | 'external' — Type is the expose type, can be internal or external
      - `replicas` integer — Replicas is the number of proxy replicas
      - `resources` object — Resources are the resource limits for each proxy replica. If not set, resource limits are not imposed
        - `cpu` union — CPU is the CPU resource requirements
          - integer
          - string
        - `memory` union — Memory is the memory resource requirements
          - integer
          - string
      - `type` 'mongos' | 'haproxy' | 'proxysql' | 'pgbouncer' — Type is the proxy type
  - `status` object — DatabaseClusterStatus defines the observed state of DatabaseCluster.
    - `activeStorage` string — ActiveStorage is the storage used in cluster (psmdb only)
    - `hostname` string — Hostname is the hostname where the cluster can be reached
    - `message` string — Message is extra information about the cluster
    - `port` integer — Port is the port where the cluster can be reached
    - `ready` integer — Ready is the number of ready pods
    - `size` integer — Size is the total number of pods
    - `status` string — Status is the status of the cluster

## Response `200`

Successful operation

- DatabaseCluster — DatabaseCluster is the Schema for the databaseclusters API.
  - `apiVersion` string — APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  - `kind` string — Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  - `metadata` object
  - `spec` object — DatabaseClusterSpec defines the desired state of DatabaseCluster.
    - `allowUnsafeConfiguration` boolean — AllowUnsafeConfiguration field used to ensure that the user can create configurations unfit for production use.
    - `backup` object — Backup is the backup specification
      - `enabled` boolean, required — Enabled is a flag to enable backups
      - `pitr` object — PITR is the configuration of the point in time recovery
        - `backupStorageName` string — BackupStorageName is the name of the BackupStorage where the PITR is enabled
        - `enabled` boolean, required — Enabled is a flag to enable PITR
        - `uploadIntervalSec` integer — UploadIntervalSec number of seconds between the binlogs uploads
      - `schedules` object[] — Schedules is a list of backup schedules
        - `backupStorageName` string, required — BackupStorageName is the name of the BackupStorage CR that defines the storage location
        - `enabled` boolean, required — Enabled is a flag to enable the schedule
        - `name` string, required — Name is the name of the schedule
        - `retentionCopies` integer — RetentionCopies is the number of backup copies to retain
        - `schedule` string, required — Schedule is the cron schedule
    - `dataSource` object — DataSource defines a data source for bootstraping a new cluster
      - `backupSource` object — BackupSource is the backup source to restore from
        - `backupStorageName` string, required — BackupStorageName is the name of the BackupStorage used for backups.
        - `path` string, required — Path is the path to the backup file/directory.
      - `dbClusterBackupName` string — DBClusterBackupName is the name of the DB cluster backup to restore from
      - `pitr` object — PITR is the point-in-time recovery configuration
        - `date` string — Date is the UTC date to recover to. The accepted format: "2006-01-02T15:04:05Z".
        - `type` 'date' | 'latest' — Type is the type of recovery.
    - `engine` object, required — Engine is the database engine specification
      - `config` string — Config is the engine configuration
      - `replicas` integer — Replicas is the number of engine replicas
      - `resources` object — Resources are the resource limits for each engine replica. If not set, resource limits are not imposed
        - `cpu` union — CPU is the CPU resource requirements
          - integer
          - string
        - `memory` union — Memory is the memory resource requirements
          - integer
          - string
      - `storage` object, required — Storage is the engine storage configuration
        - `class` string — Class is the storage class to use for the persistent volume claim
        - `size` union, required — Size is the size of the persistent volume claim
          - integer
          - string
      - `type` 'pxc' | 'postgresql' | 'psmdb', required — Type is the engine type
      - `userSecretsName` string — UserSecretsName is the name of the secret containing the user secrets
      - `version` string — Version is the engine version
    - `monitoring` object — Monitoring is the monitoring configuration
      - `monitoringConfigName` string — MonitoringConfigName is the name of a monitoringConfig CR.
      - `resources` object — Resources defines resource limitations for the monitoring.
        - `claims` object[] — Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers.
          - `name` string, required — Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
        - `limits` object — Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
        - `requests` object — Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    - `paused` boolean — Paused is a flag to stop the cluster
    - `proxy` object — Proxy is the proxy specification. If not set, an appropriate proxy specification will be applied for the given engine. A common use case for setting this field is to control the external access to the database cluster.
      - `config` string — Config is the proxy configuration
      - `expose` object — Expose is the proxy expose configuration
        - `ipSourceRanges` string[] — IPSourceRanges is the list of IP source ranges (CIDR notation) to allow access from. If not set, there is no limitations
        - `type` 'internal' | 'external' — Type is the expose type, can be internal or external
      - `replicas` integer — Replicas is the number of proxy replicas
      - `resources` object — Resources are the resource limits for each proxy replica. If not set, resource limits are not imposed
        - `cpu` union — CPU is the CPU resource requirements
          - integer
          - string
        - `memory` union — Memory is the memory resource requirements
          - integer
          - string
      - `type` 'mongos' | 'haproxy' | 'proxysql' | 'pgbouncer' — Type is the proxy type
  - `status` object — DatabaseClusterStatus defines the observed state of DatabaseCluster.
    - `activeStorage` string — ActiveStorage is the storage used in cluster (psmdb only)
    - `hostname` string — Hostname is the hostname where the cluster can be reached
    - `message` string — Message is extra information about the cluster
    - `port` integer — Port is the port where the cluster can be reached
    - `ready` integer — Ready is the number of ready pods
    - `size` integer — Size is the total number of pods
    - `status` string — Status is the status of the cluster

## Other responses

- `400` — Unsuccessful operation
- `500` — Internal server error

## Changes

- **2024-04-12** `dec31e5eea8e` — 4 breaking, 38 warning, 8 info
  - the request property `spec/backup/enabled` became required
  - removed the enum value `ClusterIP` of the request property `spec/proxy/expose/type`
  - removed the enum value `LoadBalancer` of the request property `spec/proxy/expose/type`
  - removed the enum value `NodePort` of the request property `spec/proxy/expose/type`
  - …46 more

[Change history](https://skmtc.dev/openeverest/apis/openeverest-schema/changes/namespaces/:namespace/database-clusters/:name/put.md)

---

[API](https://skmtc.dev/openeverest/apis/openeverest-schema.md) · [All operations](https://skmtc.dev/openeverest/apis/openeverest-schema/llms.txt) · [OpenAPI document](https://skmtc.dev/openeverest/apis/openeverest-schema/revisions/dec31e5eea8e?raw)
