API Reference
=============

.. raw:: html

   <p>

Package v1 contains API Schema definitions for the postgresql v1 API
group

.. raw:: html

   </p>

Resource Types
--------------

-  :ref:`Appendix A - Common object stores for backups <Appendix A - Common object stores for backups>` 

-  :ref:`Multi-availability zone Kubernetes clusters <Multi-availability zone Kubernetes clusters>` 

-  :ref:`Pooler {postgresql-cnpg-io-v1-Pooler} <Pooler {postgresql-cnpg-io-v1-Pooler}>` 

-  :ref:`ScheduledBackup {postgresql-cnpg-io-v1-ScheduledBackup} <ScheduledBackup {postgresql-cnpg-io-v1-ScheduledBackup}>` 

.. _postgresql-cnpg-io-v1-Backup:

Backup
------

Backup is the Schema for the backups API

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  apiVersion  **[Required]** <br>string,postgresql.cnpg.io/v1
  kind  **[Required]** <br>string,Backup
  metadata  **  `Required]<br>[*meta/v1.ObjectMeta* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta>`__ ** ,No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
  spec  ** :ref:`archive_timeout <Backup>` ** ,Specification of the desired behavior of the backup. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  status<br> :ref:`archive_timeout <Backup>` ,Most recently observed status of the backup. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  "",""

.. _postgresql-cnpg-io-v1-Cluster:

Cluster
-------

Cluster is the Schema for the PostgreSQL API

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  apiVersion  **[Required]** <br>string,postgresql.cnpg.io/v1
  kind  **[Required]** <br>string,Cluster
  metadata  **  `Required]<br>[*meta/v1.ObjectMeta* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta>`__ ** ,No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
  spec  **  :ref:`Required]<br>[*ClusterSpec* <#postgresql-cnpg-io-v1-clusterspec>` ** ,Specification of the desired behavior of the cluster. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  status<br>  :ref:`*ClusterStatus* <#postgresql-cnpg-io-v1-clusterstatus>` ,Most recently observed status of the cluster. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  "",""

.. _postgresql-cnpg-io-v1-Pooler:

Pooler
------

Pooler is the Schema for the poolers API

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  apiVersion  **[Required]** <br>string,postgresql.cnpg.io/v1
  kind  **[Required]** <br>string,Pooler
  metadata  **  `Required]<br>[*meta/v1.ObjectMeta* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta>`__ ** ,No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
  spec  **  :ref:`Required]<br>[*PoolerSpec* <#postgresql-cnpg-io-v1-poolerspec>` ** ,Specification of the desired behavior of the Pooler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  status<br>  :ref:`*PoolerStatus* <#postgresql-cnpg-io-v1-poolerstatus>` ,Most recently observed status of the Pooler. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  "",""

.. _postgresql-cnpg-io-v1-ScheduledBackup:

ScheduledBackup
---------------

ScheduledBackup is the Schema for the scheduledbackups API

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  apiVersion  **[Required]** <br>string,postgresql.cnpg.io/v1
  kind  **[Required]** <br>string,ScheduledBackup
  metadata  **  `Required]<br>[*meta/v1.ObjectMeta* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta>`__ ** ,No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field.
  spec  ** :ref:`archive_timeout <Backup>` ** ,Specification of the desired behavior of the ScheduledBackup. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  status<br> :ref:`archive_timeout <Backup>` ,Most recently observed status of the ScheduledBackup. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  "",""

.. _postgresql-cnpg-io-v1-AffinityConfiguration:

AffinityConfiguration
---------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

AffinityConfiguration contains the info we need to create the affinity
rules for Pods

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  enablePodAntiAffinity<br>*bool*,Activates anti-affinity for the pods. The operator will define pods anti-affinity unless this field is explicitly set to false
  topologyKey<br>*string*,TopologyKey to use for anti-affinity configuration. See k8s documentation for more info on that
  nodeSelector<br>*map[string]string*,NodeSelector is map of key-value pairs used to define the nodes on which the pods can run. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
  nodeAffinity<br>  `*core/v1.NodeAffinity* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#nodeaffinity-v1-core>`__ ,NodeAffinity describes node affinity scheduling rules for the pod. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
  tolerations<br>  `*core/v1.Toleration* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#toleration-v1-core>`__ ,"Tolerations is a list of Tolerations that should be set for all the pods, in order to allow them to run on tainted nodes. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/"
  podAntiAffinityType<br>*string*,"PodAntiAffinityType allows the user to decide whether pod anti-affinity between cluster instance has to be considered a strong requirement during scheduling or not. Allowed values are: ""preferred"" (default if empty) or ""required"". Setting it to ""required"", could lead to instances remaining pending until new kubernetes nodes are added if all the existing nodes don't match the required pod anti-affinity rule. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity"
  additionalPodAntiAffinity<br>  `*core/v1.PodAntiAffinity* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podantiaffinity-v1-core>`__ ,AdditionalPodAntiAffinity allows to specify pod anti-affinity terms to be added to the ones generated by the operator if EnablePodAntiAffinity is set to true (default) or to be used exclusively if set to false.
  additionalPodAffinity<br>  `*core/v1.PodAffinity* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podaffinity-v1-core>`__ ,AdditionalPodAffinity allows to specify pod affinity terms to be passed to all the cluster's pods.
  "",""

.. _postgresql-cnpg-io-v1-AzureCredentials:

AzureCredentials
----------------

**Appears in:**

-  :ref:`BarmanCredentials {postgresql-cnpg-io-v1-BarmanCredentials} <BarmanCredentials {postgresql-cnpg-io-v1-BarmanCredentials}>` 

AzureCredentials is the type for the credentials to be used to upload
files to Azure Blob Storage. The connection string contains every needed
information. If the connection string is not specified, we’ll need the
storage account name and also one (and only one) of:

-  storageKey

-  storageSasToken

-  inheriting the credentials from the pod environment by setting
   inheritFromAzureAD to true

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  connectionString<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The connection string to be used
  storageAccount<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The storage account where to upload data
  storageKey<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The storage account key to be used in conjunction with the storage account name
  storageSasToken<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,A shared-access-signature to be used in conjunction with the storage account name
  inheritFromAzureAD<br>*bool*,Use the Azure AD based authentication without providing explicitly the keys.
  "",""

.. _postgresql-cnpg-io-v1-BackupConfiguration:

BackupConfiguration
-------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

BackupConfiguration defines how the backup of the cluster are taken. The
supported backup methods are BarmanObjectStore and VolumeSnapshot. For
details and examples refer to the Backup and Recovery section of the
documentation

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  volumeSnapshot<br>  :ref:`*VolumeSnapshotConfiguration* <#postgresql-cnpg-io-v1-volumesnapshotconfiguration>` ,VolumeSnapshot provides the configuration for the execution of volume snapshot backups.
  barmanObjectStore<br>  :ref:`*BarmanObjectStoreConfiguration* <#postgresql-cnpg-io-v1-barmanobjectstoreconfiguration>` ,The configuration for the barman-cloud tool suite
  retentionPolicy<br>*string*,"RetentionPolicy is the retention policy to be used for backups and WALs (i.e. '60d'). The retention policy is expressed in the form of XXu where XX is a positive integer and u is in [dwm] - days, weeks, months. It's currently only applicable when using the BarmanObjectStore method."
  target<br> :ref:`archive_timeout <Backup>` ,"The policy to decide which instance should perform backups. Available options are empty string, which will default to prefer-standby policy, primary to have backups run always on primary instances, prefer-standby to have backups run preferably on the most updated standby, if available."
  "",""

BackupMethod {#postgresql-cnpg-io-v1-BackupMethod} (Alias of ``string`` )
-------------------------------------------------------------------------

**Appears in:**

-  :ref:`BackupSpec {postgresql-cnpg-io-v1-BackupSpec} <BackupSpec {postgresql-cnpg-io-v1-BackupSpec}>` 

-  :ref:`BackupStatus {postgresql-cnpg-io-v1-BackupStatus} <BackupStatus {postgresql-cnpg-io-v1-BackupStatus}>` 

-  :ref:`ScheduledBackupSpec {postgresql-cnpg-io-v1-ScheduledBackupSpec} <ScheduledBackupSpec {postgresql-cnpg-io-v1-ScheduledBackupSpec}>` 

BackupMethod defines the way of executing the physical base backups of
the selected PostgreSQL instance

BackupPhase {#postgresql-cnpg-io-v1-BackupPhase} (Alias of ``string`` )
-----------------------------------------------------------------------

**Appears in:**

-  :ref:`BackupStatus {postgresql-cnpg-io-v1-BackupStatus} <BackupStatus {postgresql-cnpg-io-v1-BackupStatus}>` 

BackupPhase is the phase of the backup

.. _postgresql-cnpg-io-v1-BackupSnapshotElementStatus:

BackupSnapshotElementStatus
---------------------------

**Appears in:**

-  :ref:`BackupSnapshotStatus {postgresql-cnpg-io-v1-BackupSnapshotStatus} <BackupSnapshotStatus {postgresql-cnpg-io-v1-BackupSnapshotStatus}>` 

BackupSnapshotElementStatus is a volume snapshot that is part of a
volume snapshot method backup

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  name  **[Required]** <br>*string*,Name is the snapshot resource name
  type  **[Required]** <br>*string*,"Type is tho role of the snapshot in the cluster, such as PG\_DATA and PG\_WAL"
  "",""

.. _postgresql-cnpg-io-v1-BackupSnapshotStatus:

BackupSnapshotStatus
--------------------

**Appears in:**

-  :ref:`BackupStatus {postgresql-cnpg-io-v1-BackupStatus} <BackupStatus {postgresql-cnpg-io-v1-BackupStatus}>` 

BackupSnapshotStatus the fields exclusive to the volumeSnapshot method
backup

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  elements<br> :ref:`archive_timeout <Backup>` ,"The elements list, populated with the gathered volume snapshots"
  "",""

.. _postgresql-cnpg-io-v1-BackupSource:

BackupSource
------------

**Appears in:**

-  :ref:`BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery} <BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery}>` 

BackupSource contains the backup we need to restore from, plus some
information that could be needed to correctly restore it.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  LocalObjectReference<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,(Members of LocalObjectReference are embedded into this type.) No description provided.
  endpointCA<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive.
  "",""

.. _postgresql-cnpg-io-v1-BackupSpec:

BackupSpec
----------

**Appears in:**

-  :ref:`Appendix A - Common object stores for backups <Appendix A - Common object stores for backups>` 

BackupSpec defines the desired state of Backup

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  cluster  **  :ref:`Required]<br>[*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ** ,The cluster to backup
  target<br> :ref:`archive_timeout <Backup>` ,"The policy to decide which instance should perform this backup. If empty, it defaults to cluster.spec.backup.target. Available options are empty string, primary and prefer-standby. primary to have backups run always on primary instances, prefer-standby to have backups run preferably on the most updated standby, if available."
  method<br> :ref:`archive_timeout <Backup>` ,"The backup method to be used, possible options are barmanObjectStore and volumeSnapshot. Defaults to: barmanObjectStore."
  "",""

.. _postgresql-cnpg-io-v1-BackupStatus:

BackupStatus
------------

**Appears in:**

-  :ref:`Appendix A - Common object stores for backups <Appendix A - Common object stores for backups>` 

BackupStatus defines the observed state of Backup

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  BarmanCredentials<br>  :ref:`*BarmanCredentials* <#postgresql-cnpg-io-v1-barmancredentials>` ,<p>(Members of BarmanCredentials are embedded into this type.) </p><p>The potential credentials for each cloud provider</p>
  endpointCA<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive.
  endpointURL<br>*string*,"Endpoint to be used to upload data to the cloud, overriding the automatic endpoint discovery"
  destinationPath<br>*string*,"The path where to store the backup (i.e. s3://bucket/path/to/folder) this path, with different destination folders, will be used for WALs and for data. This may not be populated in case of errors."
  serverName<br>*string*,"The server name on S3, the cluster name is used if this parameter is omitted"
  encryption<br>*string*,Encryption method required to S3 API
  backupId<br>*string*,The ID of the Barman backup
  backupName<br>*string*,The Name of the Barman backup
  phase<br> :ref:`archive_timeout <Backup>` ,The last backup status
  startedAt<br>  `*meta/v1.Time* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#time-v1-meta>`__ ,When the backup was started
  stoppedAt<br>  `*meta/v1.Time* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#time-v1-meta>`__ ,When the backup was terminated
  beginWal<br>*string*,The starting WAL
  endWal<br>*string*,The ending WAL
  beginLSN<br>*string*,The starting xlog
  endLSN<br>*string*,The ending xlog
  error<br>*string*,The detected error
  commandOutput<br>*string*,Unused. Retained for compatibility with old versions.
  commandError<br>*string*,The backup command output in case of error
  instanceID<br>  :ref:`*InstanceID* <#postgresql-cnpg-io-v1-instanceid>` ,Information to identify the instance where the backup has been taken from
  snapshotBackupStatus<br> :ref:`archive_timeout <Backup>` ,Status of the volumeSnapshot backup
  method<br> :ref:`archive_timeout <Backup>` ,The backup method being used
  "",""

BackupTarget {#postgresql-cnpg-io-v1-BackupTarget} (Alias of ``string`` )
-------------------------------------------------------------------------

**Appears in:**

-  :ref:`BackupConfiguration {postgresql-cnpg-io-v1-BackupConfiguration} <BackupConfiguration {postgresql-cnpg-io-v1-BackupConfiguration}>` 

-  :ref:`BackupSpec {postgresql-cnpg-io-v1-BackupSpec} <BackupSpec {postgresql-cnpg-io-v1-BackupSpec}>` 

-  :ref:`ScheduledBackupSpec {postgresql-cnpg-io-v1-ScheduledBackupSpec} <ScheduledBackupSpec {postgresql-cnpg-io-v1-ScheduledBackupSpec}>` 

BackupTarget describes the preferred targets for a backup

.. _postgresql-cnpg-io-v1-BarmanCredentials:

BarmanCredentials
-----------------

**Appears in:**

-  :ref:`BackupStatus {postgresql-cnpg-io-v1-BackupStatus} <BackupStatus {postgresql-cnpg-io-v1-BackupStatus}>` 

-  :ref:`BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration} <BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration}>` 

BarmanCredentials an object containing the potential credentials for
each cloud provider

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  googleCredentials<br>  :ref:`*GoogleCredentials* <#postgresql-cnpg-io-v1-googlecredentials>` ,The credentials to use to upload data to Google Cloud Storage
  s3Credentials<br>  :ref:`*S3Credentials* <#postgresql-cnpg-io-v1-s3credentials>` ,The credentials to use to upload data to S3
  azureCredentials<br>  :ref:`*AzureCredentials* <#postgresql-cnpg-io-v1-azurecredentials>` ,The credentials to use to upload data to Azure Blob Storage
  "",""

.. _postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration:

BarmanObjectStoreConfiguration
------------------------------

**Appears in:**

-  :ref:`BackupConfiguration {postgresql-cnpg-io-v1-BackupConfiguration} <BackupConfiguration {postgresql-cnpg-io-v1-BackupConfiguration}>` 

-  :ref:`The `externalClusters`  section <The `externalClusters`  section>` 

BarmanObjectStoreConfiguration contains the backup configuration using
Barman against an S3-compatible object storage

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  BarmanCredentials<br>  :ref:`*BarmanCredentials* <#postgresql-cnpg-io-v1-barmancredentials>` ,<p>(Members of BarmanCredentials are embedded into this type.) </p><p>The potential credentials for each cloud provider</p>
  endpointURL<br>*string*,"Endpoint to be used to upload data to the cloud, overriding the automatic endpoint discovery"
  endpointCA<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive
  destinationPath  **[Required]** <br>*string*,"The path where to store the backup (i.e. s3://bucket/path/to/folder) this path, with different destination folders, will be used for WALs and for data"
  serverName<br>*string*,"The server name on S3, the cluster name is used if this parameter is omitted"
  wal<br> :ref:`archive_timeout <Backup>` ,"The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy."
  data<br> :ref:`archive_timeout <Backup>` ,"The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy."
  tags<br>*map[string]string*,Tags is a list of key value pairs that will be passed to the Barman --tags option.
  historyTags<br>*map[string]string*,HistoryTags is a list of key value pairs that will be passed to the Barman --history-tags option.
  "",""

.. _postgresql-cnpg-io-v1-BootstrapConfiguration:

BootstrapConfiguration
----------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

BootstrapConfiguration contains information about how to create the
PostgreSQL cluster. Only a single bootstrap method can be defined among
the supported ones. initdb will be used as the bootstrap method if left
unspecified. Refer to the Bootstrap page of the documentation for more
information.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  initdb<br> :ref:`archive_timeout <Bootstrap>` ,Bootstrap the cluster via initdb
  recovery<br> :ref:`archive_timeout <Bootstrap>` ,Bootstrap the cluster from a backup
  pg\_basebackup<br> :ref:`archive_timeout <Backup>` ,Bootstrap the cluster taking a physical backup of another compatible PostgreSQL instance
  "",""

.. _postgresql-cnpg-io-v1-BootstrapInitDB:

BootstrapInitDB
---------------

**Appears in:**

-  :ref:`BootstrapConfiguration {postgresql-cnpg-io-v1-BootstrapConfiguration} <BootstrapConfiguration {postgresql-cnpg-io-v1-BootstrapConfiguration}>` 

BootstrapInitDB is the configuration of the bootstrap process when
initdb is used Refer to the Bootstrap page of the documentation for more
information.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  database<br>*string*,Name of the database used by the application. Default: app.
  owner<br>*string*,Name of the owner of the database in the instance to be used by applications. Defaults to the value of the database key.
  secret<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
  options<br>*[]string*,"The list of options that must be passed to initdb when creating the cluster. Deprecated: This could lead to inconsistent configurations, please use the explicit provided parameters instead. If defined, explicit values will be ignored."
  dataChecksums<br>*bool*,"Whether the -k option should be passed to initdb, enabling checksums on data pages (default: false)"
  encoding<br>*string*,The value to be passed as option --encoding for initdb (default:UTF8)
  localeCollate<br>*string*,The value to be passed as option --lc-collate for initdb (default:C)
  localeCType<br>*string*,The value to be passed as option --lc-ctype for initdb (default:C)
  walSegmentSize<br>*int*,"The value in megabytes (1 to 1024) to be passed to the --wal-segsize option for initdb (default: empty, resulting in PostgreSQL default: 16MB)"
  postInitSQL<br>*[]string*,List of SQL queries to be executed as a superuser immediately after the cluster has been created - to be used with extreme care (by default empty)
  postInitApplicationSQL<br>*[]string*,List of SQL queries to be executed as a superuser in the application database right after is created - to be used with extreme care (by default empty)
  postInitTemplateSQL<br>*[]string*,List of SQL queries to be executed as a superuser in the template1 after the cluster has been created - to be used with extreme care (by default empty)
  import<br>  :ref:`*Import* <#postgresql-cnpg-io-v1-import>` ,Bootstraps the new cluster by importing data from an existing PostgreSQL instance using logical backup (pg\_dump and pg\_restore)
  postInitApplicationSQLRefs<br> :ref:`archive_timeout <Connecting from an application>` ,"PostInitApplicationSQLRefs points references to ConfigMaps or Secrets which contain SQL files, the general implementation order to these references is from all Secrets to all ConfigMaps, and inside Secrets or ConfigMaps, the implementation order is same as the order of each array (by default empty)"
  "",""

.. _postgresql-cnpg-io-v1-BootstrapPgBaseBackup:

BootstrapPgBaseBackup
---------------------

**Appears in:**

-  :ref:`BootstrapConfiguration {postgresql-cnpg-io-v1-BootstrapConfiguration} <BootstrapConfiguration {postgresql-cnpg-io-v1-BootstrapConfiguration}>` 

BootstrapPgBaseBackup contains the configuration required to take a
physical backup of an existing PostgreSQL cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  source  **[Required]** <br>*string*,The name of the server of which we need to take a physical backup
  database<br>*string*,Name of the database used by the application. Default: app.
  owner<br>*string*,Name of the owner of the database in the instance to be used by applications. Defaults to the value of the database key.
  secret<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
  "",""

.. _postgresql-cnpg-io-v1-BootstrapRecovery:

BootstrapRecovery
-----------------

**Appears in:**

-  :ref:`BootstrapConfiguration {postgresql-cnpg-io-v1-BootstrapConfiguration} <BootstrapConfiguration {postgresql-cnpg-io-v1-BootstrapConfiguration}>` 

BootstrapRecovery contains the configuration required to restore from an
existing cluster using 3 methodologies: external cluster, volume
snapshots or backup objects. Full recovery and Point-In-Time Recovery
are supported. The method can be also be used to create clusters in
continuous recovery (replica clusters), also supporting cascading
replication when instances >

1. Once the cluster exits recovery, the password for the superuser will
   be changed through the provided secret. Refer to the Bootstrap page
   of the documentation for more information.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  backup<br> :ref:`archive_timeout <Backup>` ,The backup object containing the physical base backup from which to initiate the recovery procedure. Mutually exclusive with source and volumeSnapshots.
  source<br>*string*,"The external cluster whose backup we will restore. This is also used as the name of the folder under which the backup is stored, so it must be set to the name of the source cluster Mutually exclusive with backup."
  volumeSnapshots<br>  :ref:`*DataSource* <#postgresql-cnpg-io-v1-datasource>` ,"The static PVC data source(s) from which to initiate the recovery procedure. Currently supporting VolumeSnapshot and PersistentVolumeClaim resources that map an existing PVC group, compatible with CloudNativePG, and taken with a cold backup copy on a fenced Postgres instance (limitation which will be removed in the future when online backup will be implemented). Mutually exclusive with backup."
  recoveryTarget<br> :ref:`archive_timeout <Recovery>` ,"By default, the recovery process applies all the available WAL files in the archive (full recovery). However, you can also end the recovery as soon as a consistent state is reached or recover to a point-in-time (PITR) by specifying a RecoveryTarget object, as expected by PostgreSQL (i.e., timestamp, transaction Id, LSN, ...). More info: https://www.postgresql.org/docs/current/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET"
  database<br>*string*,Name of the database used by the application. Default: app.
  owner<br>*string*,Name of the owner of the database in the instance to be used by applications. Defaults to the value of the database key.
  secret<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
  "",""

.. _postgresql-cnpg-io-v1-CertificatesConfiguration:

CertificatesConfiguration
-------------------------

**Appears in:**

-  :ref:`CertificatesStatus {postgresql-cnpg-io-v1-CertificatesStatus} <CertificatesStatus {postgresql-cnpg-io-v1-CertificatesStatus}>` 

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

CertificatesConfiguration contains the needed configurations to handle
server certificates.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  serverCASecret<br>*string*,"<p>The secret containing the Server CA certificate. If not defined, a new secret will be created with a self-signed CA and will be used to generate the TLS certificate ServerTLSSecret. Contains: </p><p>- ca.crt: CA that should be used to validate the server certificate, used as sslrootcert in client connection strings.</p><p>- ca.key: key used to generate Server SSL certs, if ServerTLSSecret is provided, this can be omitted.</p>"
  serverTLSSecret<br>*string*,"The secret of type kubernetes.io/tls containing the server TLS certificate and key that will be set as ssl\_cert\_file and ssl\_key\_file so that clients can connect to postgres securely. If not defined, ServerCASecret must provide also ca.key and a new secret will be created using the provided CA."
  replicationTLSSecret<br>*string*,"The secret of type kubernetes.io/tls containing the client certificate to authenticate as the streaming\_replica user. If not defined, ClientCASecret must provide also ca.key, and a new secret will be created using the provided CA."
  clientCASecret<br>*string*,"<p>The secret containing the Client CA certificate. If not defined, a new secret will be created with a self-signed CA and will be used to generate all the client certificates. Contains: </p><p>- ca.crt: CA that should be used to validate the client certificates, used as ssl\_ca\_file of all the instances.</p><p>- ca.key: key used to generate client certificates, if ReplicationTLSSecret is provided, this can be omitted.</p>"
  serverAltDNSNames<br>*[]string*,"The list of the server alternative DNS names to be added to the generated server TLS certificates, when required."
  "",""

.. _postgresql-cnpg-io-v1-CertificatesStatus:

CertificatesStatus
------------------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

CertificatesStatus contains configuration certificates and related
expiration dates.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  CertificatesConfiguration<br> :ref:`archive_timeout <Certificates>` ,"<p>(Members of CertificatesConfiguration are embedded into this type.) </p><p>Needed configurations to handle server certificates, initialized with default values, if needed.</p>"
  expirations<br>*map[string]string*,Expiration dates for all certificates.
  "",""

.. _postgresql-cnpg-io-v1-ClusterSpec:

ClusterSpec
-----------

**Appears in:**

-  :ref:`Multi-availability zone Kubernetes clusters <Multi-availability zone Kubernetes clusters>` 

ClusterSpec defines the desired state of Cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  description<br>*string*,Description of this PostgreSQL cluster
  inheritedMetadata<br>  :ref:`*EmbeddedObjectMetadata* <#postgresql-cnpg-io-v1-embeddedobjectmetadata>` ,Metadata that will be inherited by all objects related to the Cluster
  imageName<br>*string*,"Name of the container image, supporting both tags (<image>:<tag>) and digests for deterministic and repeatable deployments (<image>:<tag>@sha256:<digestValue>)"
  imagePullPolicy<br>  `*core/v1.PullPolicy* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#pullpolicy-v1-core>`__ ,"Image pull policy. One of Always, Never or IfNotPresent. If not defined, it defaults to IfNotPresent. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images"
  schedulerName<br>*string*,"If specified, the pod will be dispatched by specified Kubernetes scheduler. If not specified, the pod will be dispatched by the default scheduler. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/"
  postgresUID<br>*int64*,"The UID of the postgres user inside the image, defaults to 26"
  postgresGID<br>*int64*,"The GID of the postgres user inside the image, defaults to 26"
  instances  **[Required]** <br>*int*,Number of instances required in the cluster
  minSyncReplicas<br>*int*,Minimum number of instances required in synchronous replication with the primary. Undefined or 0 allow writes to complete when no standby is available.
  maxSyncReplicas<br>*int*,"The target value for the synchronous replication quorum, that can be decreased if the number of ready standbys is lower than this. Undefined or 0 disable synchronous replication."
  postgresql<br>  :ref:`*PostgresConfiguration* <#postgresql-cnpg-io-v1-postgresconfiguration>` ,Configuration of the PostgreSQL server
  replicationSlots<br> :ref:`archive_timeout <Replication>` ,Replication slots management configuration
  bootstrap<br> :ref:`archive_timeout <Bootstrap>` ,Instructions to bootstrap this cluster
  replica<br>  :ref:`*ReplicaClusterConfiguration* <#postgresql-cnpg-io-v1-replicaclusterconfiguration>` ,Replica cluster configuration
  superuserSecret<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,The secret containing the superuser password. If not defined a new secret will be created with a randomly generated password
  enableSuperuserAccess<br>*bool*,"When this option is enabled, the operator will use the SuperuserSecret to update the postgres user password (if the secret is not present, the operator will automatically create one). When this option is disabled, the operator will ignore the SuperuserSecret content, delete it when automatically created, and then blank the password of the postgres user by setting it to NULL. Disabled by default."
  certificates<br> :ref:`archive_timeout <Certificates>` ,The configuration for the CA and related certificates
  imagePullSecrets<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,The list of pull secrets to be used to pull the images
  storage<br> :ref:`archive_timeout <Storage>` ,Configuration of the storage of the instances
  serviceAccountTemplate<br>  :ref:`*ServiceAccountTemplate* <#postgresql-cnpg-io-v1-serviceaccounttemplate>` ,Configure the generation of the service account
  walStorage<br> :ref:`archive_timeout <Storage>` ,Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
  startDelay<br>*int32*,The time in seconds that is allowed for a PostgreSQL instance to successfully start up (default 3600). The startup probe failure threshold is derived from this value using the formula: ceiling(startDelay / 10).
  stopDelay<br>*int32*,The time in seconds that is allowed for a PostgreSQL instance to gracefully shutdown (default 1800)
  smartShutdownTimeout<br>*int32*,The time in seconds that controls the window of time reserved for the smart shutdown of Postgres to complete. Make sure you reserve enough time for the operator to request a fast shutdown of Postgres (that is: stopDelay - smartShutdownTimeout).
  switchoverDelay<br>*int32*,The time in seconds that is allowed for a primary PostgreSQL instance to gracefully shutdown during a switchover. Default value is 3600 seconds (1 hour).
  failoverDelay<br>*int32*,The amount of time (in seconds) to wait before triggering a failover after the primary PostgreSQL instance in the cluster was detected to be unhealthy
  affinity<br>  :ref:`*AffinityConfiguration* <#postgresql-cnpg-io-v1-affinityconfiguration>` ,Affinity/Anti-affinity rules for Pods
  topologySpreadConstraints<br>  `*core/v1.TopologySpreadConstraint* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#topologyspreadconstraint-v1-core>`__ ,TopologySpreadConstraints specifies how to spread matching pods among the given topology. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
  resources<br>  `*core/v1.ResourceRequirements* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#resourcerequirements-v1-core>`__ ,Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information.
  ephemeralVolumesSizeLimit  **  :ref:`Required]<br>[*EphemeralVolumesSizeLimitConfiguration* <#postgresql-cnpg-io-v1-ephemeralvolumessizelimitconfiguration>` ** ,EphemeralVolumesSizeLimit allows the user to set the limits for the ephemeral volumes
  priorityClassName<br>*string*,"Name of the priority class which will be used in every generated Pod, if the PriorityClass specified does not exist, the pod will not be able to schedule. Please refer to https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass for more information"
  primaryUpdateStrategy<br>  :ref:`*PrimaryUpdateStrategy* <#postgresql-cnpg-io-v1-primaryupdatestrategy>` ,"Deployment strategy to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be automated (unsupervised - default) or manual (supervised)"
  primaryUpdateMethod<br>  :ref:`*PrimaryUpdateMethod* <#postgresql-cnpg-io-v1-primaryupdatemethod>` ,"Method to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be with a switchover (switchover) or in-place (restart - default)"
  backup<br> :ref:`archive_timeout <Backup>` ,The configuration to be used for backups
  nodeMaintenanceWindow<br>  :ref:`*NodeMaintenanceWindow* <#postgresql-cnpg-io-v1-nodemaintenancewindow>` ,Define a maintenance window for the Kubernetes nodes
  monitoring<br> :ref:`archive_timeout <Monitoring>` ,The configuration of the monitoring infrastructure of this cluster
  externalClusters<br>  :ref:`*ExternalCluster* <#postgresql-cnpg-io-v1-externalcluster>` ,The list of external clusters which are used in the configuration
  logLevel<br>*string*,"The instances' log level, one of the following values: error, warning, info (default), debug, trace"
  projectedVolumeTemplate<br>  `*core/v1.ProjectedVolumeSource* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#projectedvolumesource-v1-core>`__ ,"Template to be used to define projected volumes, projected volumes will be mounted under /projected base folder"
  env<br>  `*core/v1.EnvVar* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#envvar-v1-core>`__ ,Env follows the Env format to pass environment variables to the pods created in the cluster
  envFrom<br>  `*core/v1.EnvFromSource* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#envfromsource-v1-core>`__ ,EnvFrom follows the EnvFrom format to pass environment variables sources to the pods to be used by Env
  managed<br>  :ref:`*ManagedConfiguration* <#postgresql-cnpg-io-v1-managedconfiguration>` ,The configuration that is used by the portions of PostgreSQL that are managed by the instance manager
  seccompProfile<br>  `*core/v1.SeccompProfile* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#seccompprofile-v1-core>`__ ,The SeccompProfile applied to every Pod and Container. Defaults to: RuntimeDefault
  "",""

.. _postgresql-cnpg-io-v1-ClusterStatus:

ClusterStatus
-------------

**Appears in:**

-  :ref:`Multi-availability zone Kubernetes clusters <Multi-availability zone Kubernetes clusters>` 

ClusterStatus defines the observed state of Cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  instances<br>*int*,The total number of PVC Groups detected in the cluster. It may differ from the number of existing instance pods.
  readyInstances<br>*int*,The total number of ready instances in the cluster. It is equal to the number of ready instance pods.
  instancesStatus<br>*map[github.com/cloudnative-pg/cloudnative-pg/pkg/utils.PodStatus][]string*,InstancesStatus indicates in which status the instances are
  instancesReportedState<br>  :ref:`*map\[github.com/cloudnative-pg/cloudnative-pg/api/v1.PodName\]github.com/cloudnative-pg/cloudnative-pg/api/v1.InstanceReportedState* <#postgresql-cnpg-io-v1-instancereportedstate>` ,The reported state of the instances during the last reconciliation loop
  managedRolesStatus<br>  :ref:`*ManagedRoles* <#postgresql-cnpg-io-v1-managedroles>` ,ManagedRolesStatus reports the state of the managed roles in the cluster
  timelineID<br>*int*,The timeline of the Postgres cluster
  topology<br>  :ref:`*Topology* <#postgresql-cnpg-io-v1-topology>` ,Instances topology.
  latestGeneratedNode<br>*int*,ID of the latest generated node (used to avoid node name clashing)
  currentPrimary<br>*string*,Current primary instance
  targetPrimary<br>*string*,"Target primary instance, this is different from the previous one during a switchover or a failover"
  pvcCount<br>*int32*,How many PVCs have been created by this cluster
  jobCount<br>*int32*,How many Jobs have been created by this cluster
  danglingPVC<br>*[]string*,List of all the PVCs created by this cluster and still available which are not attached to a Pod
  resizingPVC<br>*[]string*,List of all the PVCs that have ResizingPVC condition.
  initializingPVC<br>*[]string*,List of all the PVCs that are being initialized by this cluster
  healthyPVC<br>*[]string*,List of all the PVCs not dangling nor initializing
  unusablePVC<br>*[]string*,List of all the PVCs that are unusable because another PVC is missing
  writeService<br>*string*,Current write pod
  readService<br>*string*,Current list of read pods
  phase<br>*string*,Current phase of the cluster
  phaseReason<br>*string*,Reason for the current phase
  secretsResourceVersion<br>  :ref:`*SecretsResourceVersion* <#postgresql-cnpg-io-v1-secretsresourceversion>` ,"The list of resource versions of the secrets managed by the operator. Every change here is done in the interest of the instance manager, which will refresh the secret data"
  configMapResourceVersion<br>  :ref:`*ConfigMapResourceVersion* <#postgresql-cnpg-io-v1-configmapresourceversion>` ,"The list of resource versions of the configmaps, managed by the operator. Every change here is done in the interest of the instance manager, which will refresh the configmap data"
  certificates<br> :ref:`archive_timeout <Certificates>` ,"The configuration for the CA and related certificates, initialized with defaults."
  firstRecoverabilityPoint<br>*string*,"The first recoverability point, stored as a date in RFC3339 format"
  lastSuccessfulBackup<br>*string*,Stored as a date in RFC3339 format
  lastFailedBackup<br>*string*,Stored as a date in RFC3339 format
  cloudNativePGCommitHash<br>*string*,The commit hash number of which this operator running
  currentPrimaryTimestamp<br>*string*,The timestamp when the last actual promotion to primary has occurred
  currentPrimaryFailingSinceTimestamp<br>*string*,The timestamp when the primary was detected to be unhealthy This field is reported when spec.failoverDelay is populated or during online upgrades
  targetPrimaryTimestamp<br>*string*,The timestamp when the last request for a new primary has occurred
  poolerIntegrations<br>  :ref:`*PoolerIntegrations* <#postgresql-cnpg-io-v1-poolerintegrations>` ,The integration needed by poolers referencing the cluster
  cloudNativePGOperatorHash<br>*string*,The hash of the binary of the operator
  conditions<br>  `*meta/v1.Condition* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#condition-v1-meta>`__ ,Conditions for cluster object
  instanceNames<br>*[]string*,List of instance names in the cluster
  onlineUpdateEnabled<br>*bool*,OnlineUpdateEnabled shows if the online upgrade is enabled inside the cluster
  azurePVCUpdateEnabled<br>*bool*,AzurePVCUpdateEnabled shows if the PVC online upgrade is enabled for this cluster
  "",""

CompressionType {#postgresql-cnpg-io-v1-CompressionType} (Alias of ``string`` )
-------------------------------------------------------------------------------

**Appears in:**

-  :ref:`DataBackupConfiguration {postgresql-cnpg-io-v1-DataBackupConfiguration} <DataBackupConfiguration {postgresql-cnpg-io-v1-DataBackupConfiguration}>` 

-  :ref:`WalBackupConfiguration {postgresql-cnpg-io-v1-WalBackupConfiguration} <WalBackupConfiguration {postgresql-cnpg-io-v1-WalBackupConfiguration}>` 

CompressionType encapsulates the available types of compression

.. _postgresql-cnpg-io-v1-ConfigMapKeySelector:

ConfigMapKeySelector
--------------------

**Appears in:**

-  :ref:`MonitoringConfiguration {postgresql-cnpg-io-v1-MonitoringConfiguration} <MonitoringConfiguration {postgresql-cnpg-io-v1-MonitoringConfiguration}>` 

-  :ref:`PostInitApplicationSQLRefs {postgresql-cnpg-io-v1-PostInitApplicationSQLRefs} <PostInitApplicationSQLRefs {postgresql-cnpg-io-v1-PostInitApplicationSQLRefs}>` 

ConfigMapKeySelector contains enough information to let you locate the
key of a ConfigMap

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  LocalObjectReference<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,<p>(Members of LocalObjectReference are embedded into this type.) </p><p>The name of the secret in the pod's namespace to select from.</p>
  key  **[Required]** <br>*string*,The key to select
  "",""

.. _postgresql-cnpg-io-v1-ConfigMapResourceVersion:

ConfigMapResourceVersion
------------------------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

ConfigMapResourceVersion is the resource versions of the secrets managed
by the operator

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  metrics<br>*map[string]string*,"A map with the versions of all the config maps used to pass metrics. Map keys are the config map names, map values are the versions"
  "",""

.. _postgresql-cnpg-io-v1-DataBackupConfiguration:

DataBackupConfiguration
-----------------------

**Appears in:**

-  :ref:`BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration} <BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration}>` 

DataBackupConfiguration is the configuration of the backup of the data
directory

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  compression<br>  :ref:`*CompressionType* <#postgresql-cnpg-io-v1-compressiontype>` ,"Compress a backup file (a tar file per tablespace) while streaming it to the object store. Available options are empty string (no compression, default), gzip, bzip2 or snappy."
  encryption<br>  :ref:`*EncryptionType* <#postgresql-cnpg-io-v1-encryptiontype>` ,"Whenever to force the encryption of files (if the bucket is not already configured for that). Allowed options are empty string (use the bucket policy, default), AES256 and aws:kms"
  jobs<br>*int32*,"The number of parallel jobs to be used to upload the backup, defaults to 2"
  immediateCheckpoint<br>*bool*,"Control whether the I/O workload for the backup initial checkpoint will be limited, according to the checkpoint\_completion\_target setting on the PostgreSQL server. If set to true, an immediate checkpoint will be used, meaning PostgreSQL will complete the checkpoint as soon as possible. false by default."
  "",""

.. _postgresql-cnpg-io-v1-DataSource:

DataSource
----------

**Appears in:**

-  :ref:`BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery} <BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery}>` 

DataSource contains the configuration required to bootstrap a PostgreSQL
cluster from an existing storage

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  storage  **  `Required]<br>[*core/v1.TypedLocalObjectReference* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#typedlocalobjectreference-v1-core>`__ ** ,Configuration of the storage of the instances
  walStorage<br>  `*core/v1.TypedLocalObjectReference* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#typedlocalobjectreference-v1-core>`__ ,Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
  "",""

.. _postgresql-cnpg-io-v1-EmbeddedObjectMetadata:

EmbeddedObjectMetadata
----------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

EmbeddedObjectMetadata contains metadata to be inherited by all
resources related to a Cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  labels<br>*map[string]string*,No description provided.
  annotations<br>*map[string]string*,No description provided.
  "",""

EncryptionType {#postgresql-cnpg-io-v1-EncryptionType} (Alias of ``string`` )
-----------------------------------------------------------------------------

**Appears in:**

-  :ref:`DataBackupConfiguration {postgresql-cnpg-io-v1-DataBackupConfiguration} <DataBackupConfiguration {postgresql-cnpg-io-v1-DataBackupConfiguration}>` 

-  :ref:`WalBackupConfiguration {postgresql-cnpg-io-v1-WalBackupConfiguration} <WalBackupConfiguration {postgresql-cnpg-io-v1-WalBackupConfiguration}>` 

EncryptionType encapsulated the available types of encryption

EnsureOption {#postgresql-cnpg-io-v1-EnsureOption} (Alias of ``string`` )
-------------------------------------------------------------------------

**Appears in:**

-  :ref:`RoleConfiguration {postgresql-cnpg-io-v1-RoleConfiguration} <RoleConfiguration {postgresql-cnpg-io-v1-RoleConfiguration}>` 

EnsureOption represents whether we should enforce the presence or
absence of a Role in a PostgreSQL instance

.. _postgresql-cnpg-io-v1-EphemeralVolumesSizeLimitConfiguration:

EphemeralVolumesSizeLimitConfiguration
--------------------------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

EphemeralVolumesSizeLimitConfiguration contains the configuration of the
ephemeral storage

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  shm  **[Required]** <br>*k8s.io/apimachinery/pkg/api/resource.Quantity*,Shm is the size limit of the shared memory volume
  temporaryData  **[Required]** <br>*k8s.io/apimachinery/pkg/api/resource.Quantity*,TemporaryData is the size limit of the temporary data volume
  "",""

.. _postgresql-cnpg-io-v1-ExternalCluster:

ExternalCluster
---------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

ExternalCluster represents the connection parameters to an external
cluster which is used in the other sections of the configuration

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  name  **[Required]** <br>*string*,"The server name, required"
  connectionParameters<br>*map[string]string*,"The list of connection parameters, such as dbname, host, username, etc"
  sslCert<br>  `*core/v1.SecretKeySelector* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#secretkeyselector-v1-core>`__ ,The reference to an SSL certificate to be used to connect to this instance
  sslKey<br>  `*core/v1.SecretKeySelector* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#secretkeyselector-v1-core>`__ ,The reference to an SSL private key to be used to connect to this instance
  sslRootCert<br>  `*core/v1.SecretKeySelector* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#secretkeyselector-v1-core>`__ ,The reference to an SSL CA public key to be used to connect to this instance
  password<br>  `*core/v1.SecretKeySelector* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#secretkeyselector-v1-core>`__ ,The reference to the password to be used to connect to the server
  barmanObjectStore<br>  :ref:`*BarmanObjectStoreConfiguration* <#postgresql-cnpg-io-v1-barmanobjectstoreconfiguration>` ,The configuration for the barman-cloud tool suite
  "",""

.. _postgresql-cnpg-io-v1-GoogleCredentials:

GoogleCredentials
-----------------

**Appears in:**

-  :ref:`BarmanCredentials {postgresql-cnpg-io-v1-BarmanCredentials} <BarmanCredentials {postgresql-cnpg-io-v1-BarmanCredentials}>` 

GoogleCredentials is the type for the Google Cloud Storage credentials.
This needs to be specified even if we run inside a GKE environment.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  applicationCredentials<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The secret containing the Google Cloud Storage JSON file with the credentials
  gkeEnvironment<br>*bool*,"If set to true, will presume that it's running inside a GKE environment, default to false."
  "",""

.. _postgresql-cnpg-io-v1-Import:

Import
------

**Appears in:**

-  :ref:`BootstrapInitDB {postgresql-cnpg-io-v1-BootstrapInitDB} <BootstrapInitDB {postgresql-cnpg-io-v1-BootstrapInitDB}>` 

Import contains the configuration to init a database from a logic
snapshot of an externalCluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  source  **  :ref:`Required]<br>[*ImportSource* <#postgresql-cnpg-io-v1-importsource>` ** ,The source of the import
  type  **  :ref:`Required]<br>[*SnapshotType* <#postgresql-cnpg-io-v1-snapshottype>` ** ,The import type. Can be microservice or monolith.
  databases  **[Required]** <br>*[]string*,The databases to import
  roles<br>*[]string*,The roles to import
  postImportApplicationSQL<br>*[]string*,List of SQL queries to be executed as a superuser in the application database right after is imported - to be used with extreme care (by default empty). Only available in microservice type.
  schemaOnly<br>*bool*,"When set to true, only the pre-data and post-data sections of pg\_restore are invoked, avoiding data import. Default: false."
  "",""

.. _postgresql-cnpg-io-v1-ImportSource:

ImportSource
------------

**Appears in:**

-  :ref:`Import {postgresql-cnpg-io-v1-Import} <Import {postgresql-cnpg-io-v1-Import}>` 

ImportSource describes the source for the logical snapshot

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  externalCluster  **[Required]** <br>*string*,The name of the externalCluster used for import
  "",""

.. _postgresql-cnpg-io-v1-InstanceID:

InstanceID
----------

**Appears in:**

-  :ref:`BackupStatus {postgresql-cnpg-io-v1-BackupStatus} <BackupStatus {postgresql-cnpg-io-v1-BackupStatus}>` 

InstanceID contains the information to identify an instance

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  podName<br>*string*,The pod name
  ContainerID<br>*string*,The container ID
  "",""

.. _postgresql-cnpg-io-v1-InstanceReportedState:

InstanceReportedState
---------------------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

InstanceReportedState describes the last reported state of an instance
during a reconciliation loop

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  isPrimary  **[Required]** <br>*bool*,indicates if an instance is the primary one
  timeLineID<br>*int*,indicates on which TimelineId the instance is
  "",""

.. _postgresql-cnpg-io-v1-LDAPBindAsAuth:

LDAPBindAsAuth
--------------

**Appears in:**

-  :ref:`LDAPConfig {postgresql-cnpg-io-v1-LDAPConfig} <LDAPConfig {postgresql-cnpg-io-v1-LDAPConfig}>` 

LDAPBindAsAuth provides the required fields to use the bind
authentication for LDAP

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  prefix<br>*string*,Prefix for the bind authentication option
  suffix<br>*string*,Suffix for the bind authentication option
  "",""

.. _postgresql-cnpg-io-v1-LDAPBindSearchAuth:

LDAPBindSearchAuth
------------------

**Appears in:**

-  :ref:`LDAPConfig {postgresql-cnpg-io-v1-LDAPConfig} <LDAPConfig {postgresql-cnpg-io-v1-LDAPConfig}>` 

LDAPBindSearchAuth provides the required fields to use the bind+search
LDAP authentication process

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  baseDN<br>*string*,Root DN to begin the user search
  bindDN<br>*string*,DN of the user to bind to the directory
  bindPassword<br>  `*core/v1.SecretKeySelector* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#secretkeyselector-v1-core>`__ ,Secret with the password for the user to bind to the directory
  searchAttribute<br>*string*,Attribute to match against the username
  searchFilter<br>*string*,Search filter to use when doing the search+bind authentication
  "",""

.. _postgresql-cnpg-io-v1-LDAPConfig:

LDAPConfig
----------

**Appears in:**

-  :ref:`PostgresConfiguration {postgresql-cnpg-io-v1-PostgresConfiguration} <PostgresConfiguration {postgresql-cnpg-io-v1-PostgresConfiguration}>` 

LDAPConfig contains the parameters needed for LDAP authentication

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  server<br>*string*,LDAP hostname or IP address
  port<br>*int*,LDAP server port
  scheme<br>  :ref:`*LDAPScheme* <#postgresql-cnpg-io-v1-ldapscheme>` ,"LDAP schema to be used, possible options are ldap and ldaps"
  bindAsAuth<br>  :ref:`*LDAPBindAsAuth* <#postgresql-cnpg-io-v1-ldapbindasauth>` ,Bind as authentication configuration
  bindSearchAuth<br>  :ref:`*LDAPBindSearchAuth* <#postgresql-cnpg-io-v1-ldapbindsearchauth>` ,Bind+Search authentication configuration
  tls<br>*bool*,Set to 'true' to enable LDAP over TLS. 'false' is default
  "",""

LDAPScheme {#postgresql-cnpg-io-v1-LDAPScheme} (Alias of ``string`` )
---------------------------------------------------------------------

**Appears in:**

-  :ref:`LDAPConfig {postgresql-cnpg-io-v1-LDAPConfig} <LDAPConfig {postgresql-cnpg-io-v1-LDAPConfig}>` 

LDAPScheme defines the possible schemes for LDAP

.. _postgresql-cnpg-io-v1-LocalObjectReference:

LocalObjectReference
--------------------

**Appears in:**

-  :ref:`BackupSource {postgresql-cnpg-io-v1-BackupSource} <BackupSource {postgresql-cnpg-io-v1-BackupSource}>` 

-  :ref:`BackupSpec {postgresql-cnpg-io-v1-BackupSpec} <BackupSpec {postgresql-cnpg-io-v1-BackupSpec}>` 

-  :ref:`BootstrapInitDB {postgresql-cnpg-io-v1-BootstrapInitDB} <BootstrapInitDB {postgresql-cnpg-io-v1-BootstrapInitDB}>` 

-  :ref:`BootstrapPgBaseBackup {postgresql-cnpg-io-v1-BootstrapPgBaseBackup} <BootstrapPgBaseBackup {postgresql-cnpg-io-v1-BootstrapPgBaseBackup}>` 

-  :ref:`BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery} <BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery}>` 

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

-  :ref:`ConfigMapKeySelector {postgresql-cnpg-io-v1-ConfigMapKeySelector} <ConfigMapKeySelector {postgresql-cnpg-io-v1-ConfigMapKeySelector}>` 

-  :ref:`PgBouncerSpec {postgresql-cnpg-io-v1-PgBouncerSpec} <PgBouncerSpec {postgresql-cnpg-io-v1-PgBouncerSpec}>` 

-  :ref:`PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec} <PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec}>` 

-  :ref:`RoleConfiguration {postgresql-cnpg-io-v1-RoleConfiguration} <RoleConfiguration {postgresql-cnpg-io-v1-RoleConfiguration}>` 

-  :ref:`ScheduledBackupSpec {postgresql-cnpg-io-v1-ScheduledBackupSpec} <ScheduledBackupSpec {postgresql-cnpg-io-v1-ScheduledBackupSpec}>` 

-  :ref:`SecretKeySelector {postgresql-cnpg-io-v1-SecretKeySelector} <SecretKeySelector {postgresql-cnpg-io-v1-SecretKeySelector}>` 

LocalObjectReference contains enough information to let you locate a
local object with a known type inside the same namespace

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  name  **[Required]** <br>*string*,Name of the referent.
  "",""

.. _postgresql-cnpg-io-v1-ManagedConfiguration:

ManagedConfiguration
--------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

ManagedConfiguration represents the portions of PostgreSQL that are
managed by the instance manager

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  roles<br>  :ref:`*RoleConfiguration* <#postgresql-cnpg-io-v1-roleconfiguration>` ,Database roles managed by the Cluster
  "",""

.. _postgresql-cnpg-io-v1-ManagedRoles:

ManagedRoles
------------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

ManagedRoles tracks the status of a cluster’s managed roles

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  byStatus<br>*map[github.com/cloudnative-pg/cloudnative-pg/api/v1.RoleStatus][]string*,ByStatus gives the list of roles in each state
  cannotReconcile<br>*map[string][]string*,"CannotReconcile lists roles that cannot be reconciled in PostgreSQL, with an explanation of the cause"
  passwordStatus<br>  :ref:`*map\[string\]github.com/cloudnative-pg/cloudnative-pg/api/v1.PasswordState* <#postgresql-cnpg-io-v1-passwordstate>` ,PasswordStatus gives the last transaction id and password secret version for each managed role
  "",""

.. _postgresql-cnpg-io-v1-Metadata:

Metadata
--------

**Appears in:**

-  :ref:`PodTemplateSpec {postgresql-cnpg-io-v1-PodTemplateSpec} <PodTemplateSpec {postgresql-cnpg-io-v1-PodTemplateSpec}>` 

-  :ref:`ServiceAccountTemplate {postgresql-cnpg-io-v1-ServiceAccountTemplate} <ServiceAccountTemplate {postgresql-cnpg-io-v1-ServiceAccountTemplate}>` 

Metadata is a structure similar to the metav1.ObjectMeta, but still
parseable by controller-gen to create a suitable CRD for the user. The
comment of PodTemplateSpec has an explanation of why we are not using
the core data types.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  labels<br>*map[string]string*,Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
  annotations<br>*map[string]string*,Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
  "",""

.. _postgresql-cnpg-io-v1-MonitoringConfiguration:

MonitoringConfiguration
-----------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

MonitoringConfiguration is the type containing all the monitoring
configuration for a certain cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  disableDefaultQueries<br>*bool*,Whether the default queries should be injected. Set it to true if you don't want to inject default queries into the cluster. Default: false.
  customQueriesConfigMap<br>  :ref:`*ConfigMapKeySelector* <#postgresql-cnpg-io-v1-configmapkeyselector>` ,The list of config maps containing the custom queries
  customQueriesSecret<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The list of secrets containing the custom queries
  enablePodMonitor<br>*bool*,Enable or disable the PodMonitor
  "",""

.. _postgresql-cnpg-io-v1-NodeMaintenanceWindow:

NodeMaintenanceWindow
---------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

NodeMaintenanceWindow contains information that the operator will use
while upgrading the underlying node.

This option is only useful when the chosen storage prevents the Pods
from being freely moved across nodes.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  reusePVC<br>*bool*,Reuse the existing PVC (wait for the node to come up again) or not (recreate it elsewhere - when instances >1)
  inProgress<br>*bool*,Is there a node maintenance activity in progress?
  "",""

.. _postgresql-cnpg-io-v1-PasswordState:

PasswordState
-------------

**Appears in:**

-  :ref:`ManagedRoles {postgresql-cnpg-io-v1-ManagedRoles} <ManagedRoles {postgresql-cnpg-io-v1-ManagedRoles}>` 

PasswordState represents the state of the password of a managed
RoleConfiguration

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  transactionID<br>*int64*,the last transaction ID to affect the role definition in PostgreSQL
  resourceVersion<br>*string*,the resource version of the password secret
  "",""

.. _postgresql-cnpg-io-v1-PgBouncerIntegrationStatus:

PgBouncerIntegrationStatus
--------------------------

**Appears in:**

-  :ref:`PoolerIntegrations {postgresql-cnpg-io-v1-PoolerIntegrations} <PoolerIntegrations {postgresql-cnpg-io-v1-PoolerIntegrations}>` 

PgBouncerIntegrationStatus encapsulates the needed integration for the
pgbouncer poolers referencing the cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  secrets<br>*[]string*,No description provided.
  "",""

PgBouncerPoolMode {#postgresql-cnpg-io-v1-PgBouncerPoolMode} (Alias of ``string`` )
-----------------------------------------------------------------------------------

**Appears in:**

-  :ref:`PgBouncerSpec {postgresql-cnpg-io-v1-PgBouncerSpec} <PgBouncerSpec {postgresql-cnpg-io-v1-PgBouncerSpec}>` 

PgBouncerPoolMode is the mode of PgBouncer

.. _postgresql-cnpg-io-v1-PgBouncerSecrets:

PgBouncerSecrets
----------------

**Appears in:**

-  :ref:`PoolerSecrets {postgresql-cnpg-io-v1-PoolerSecrets} <PoolerSecrets {postgresql-cnpg-io-v1-PoolerSecrets}>` 

PgBouncerSecrets contains the versions of the secrets used by pgbouncer

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  authQuery<br>  :ref:`*SecretVersion* <#postgresql-cnpg-io-v1-secretversion>` ,The auth query secret version
  "",""

.. _postgresql-cnpg-io-v1-PgBouncerSpec:

PgBouncerSpec
-------------

**Appears in:**

-  :ref:`PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec} <PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec}>` 

PgBouncerSpec defines how to configure PgBouncer

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  poolMode<br>  :ref:`*PgBouncerPoolMode* <#postgresql-cnpg-io-v1-pgbouncerpoolmode>` ,The pool mode. Default: session.
  authQuerySecret<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,"The credentials of the user that need to be used for the authentication query. In case it is specified, also an AuthQuery (e.g. ""SELECT usename, passwd FROM pg\_shadow WHERE usename=$1"") has to be specified and no automatic CNPG Cluster integration will be triggered."
  authQuery<br>*string*,"The query that will be used to download the hash of the password of a certain user. Default: ""SELECT usename, passwd FROM user\_search($1)"". In case it is specified, also an AuthQuerySecret has to be specified and no automatic CNPG Cluster integration will be triggered."
  parameters<br>*map[string]string*,Additional parameters to be passed to PgBouncer - please check the CNPG documentation for a list of options you can configure
  pg\_hba<br>*[]string*,PostgreSQL Host Based Authentication rules (lines to be appended to the pg\_hba.conf file)
  paused<br>*bool*,"When set to true, PgBouncer will disconnect from the PostgreSQL server, first waiting for all queries to complete, and pause all new client connections until this value is set to false (default). Internally, the operator calls PgBouncer's PAUSE and RESUME commands."
  "",""

.. _postgresql-cnpg-io-v1-PodTemplateSpec:

PodTemplateSpec
---------------

**Appears in:**

-  :ref:`PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec} <PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec}>` 

PodTemplateSpec is a structure allowing the user to set a template for
Pod generation.

Unfortunately we can’t use the corev1.PodTemplateSpec type because the
generated CRD won’t have the field for the metadata section.

References:
https://github.com/kubernetes-sigs/controller-tools/issues/385
https://github.com/kubernetes-sigs/controller-tools/issues/448
https://github.com/prometheus-operator/prometheus-operator/issues/3041

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  metadata<br>  :ref:`*Metadata* <#postgresql-cnpg-io-v1-metadata>` ,Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  spec<br>  `*core/v1.PodSpec* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podspec-v1-core>`__ ,Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  "",""

PodTopologyLabels {#postgresql-cnpg-io-v1-PodTopologyLabels} (Alias of ``map[string]string`` )
----------------------------------------------------------------------------------------------

**Appears in:**

-  :ref:`PodTopologyLabels {postgresql-cnpg-io-v1-PodTopologyLabels} (Alias of `map[string]string` ) <PodTopologyLabels {postgresql-cnpg-io-v1-PodTopologyLabels} (Alias of `map[string]string` )>` 

PodTopologyLabels represent the topology of a Pod.
map[labelName]labelValue

.. _postgresql-cnpg-io-v1-PoolerIntegrations:

PoolerIntegrations
------------------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

PoolerIntegrations encapsulates the needed integration for the poolers
referencing the cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  pgBouncerIntegration<br>  :ref:`*PgBouncerIntegrationStatus* <#postgresql-cnpg-io-v1-pgbouncerintegrationstatus>` ,No description provided.
  "",""

.. _postgresql-cnpg-io-v1-PoolerMonitoringConfiguration:

PoolerMonitoringConfiguration
-----------------------------

**Appears in:**

-  :ref:`PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec} <PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec}>` 

PoolerMonitoringConfiguration is the type containing all the monitoring
configuration for a certain Pooler.

Mirrors the Cluster’s MonitoringConfiguration but without the custom
queries part for now.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  enablePodMonitor<br>*bool*,Enable or disable the PodMonitor
  "",""

.. _postgresql-cnpg-io-v1-PoolerSecrets:

PoolerSecrets
-------------

**Appears in:**

-  :ref:`PoolerStatus {postgresql-cnpg-io-v1-PoolerStatus} <PoolerStatus {postgresql-cnpg-io-v1-PoolerStatus}>` 

PoolerSecrets contains the versions of all the secrets used

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  serverTLS<br>  :ref:`*SecretVersion* <#postgresql-cnpg-io-v1-secretversion>` ,The server TLS secret version
  serverCA<br>  :ref:`*SecretVersion* <#postgresql-cnpg-io-v1-secretversion>` ,The server CA secret version
  clientCA<br>  :ref:`*SecretVersion* <#postgresql-cnpg-io-v1-secretversion>` ,The client CA secret version
  pgBouncerSecrets<br>  :ref:`*PgBouncerSecrets* <#postgresql-cnpg-io-v1-pgbouncersecrets>` ,The version of the secrets used by PgBouncer
  "",""

.. _postgresql-cnpg-io-v1-PoolerSpec:

PoolerSpec
----------

**Appears in:**

-  :ref:`Pooler {postgresql-cnpg-io-v1-Pooler} <Pooler {postgresql-cnpg-io-v1-Pooler}>` 

PoolerSpec defines the desired state of Pooler

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  cluster  **  :ref:`Required]<br>[*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ** ,This is the cluster reference on which the Pooler will work. Pooler name should never match with any cluster name within the same namespace.
  type<br>  :ref:`*PoolerType* <#postgresql-cnpg-io-v1-poolertype>` ,Type of service to forward traffic to. Default: rw.
  instances<br>*int32*,The number of replicas we want. Default: 1.
  template<br>  :ref:`*PodTemplateSpec* <#postgresql-cnpg-io-v1-podtemplatespec>` ,The template of the Pod to be created
  pgbouncer  **  :ref:`Required]<br>[*PgBouncerSpec* <#postgresql-cnpg-io-v1-pgbouncerspec>` ** ,The PgBouncer configuration
  deploymentStrategy<br>  `*apps/v1.DeploymentStrategy* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#deploymentstrategy-v1-apps>`__ ,The deployment strategy to use for pgbouncer to replace existing pods with new ones
  monitoring<br> :ref:`archive_timeout <Monitoring>` ,The configuration of the monitoring infrastructure of this pooler.
  "",""

.. _postgresql-cnpg-io-v1-PoolerStatus:

PoolerStatus
------------

**Appears in:**

-  :ref:`Pooler {postgresql-cnpg-io-v1-Pooler} <Pooler {postgresql-cnpg-io-v1-Pooler}>` 

PoolerStatus defines the observed state of Pooler

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  secrets<br>  :ref:`*PoolerSecrets* <#postgresql-cnpg-io-v1-poolersecrets>` ,The resource version of the config object
  instances<br>*int32*,The number of pods trying to be scheduled
  "",""

PoolerType {#postgresql-cnpg-io-v1-PoolerType} (Alias of ``string`` )
---------------------------------------------------------------------

**Appears in:**

-  :ref:`PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec} <PoolerSpec {postgresql-cnpg-io-v1-PoolerSpec}>` 

PoolerType is the type of the connection pool, meaning the service we
are targeting. Allowed values are rw and ro.

.. _postgresql-cnpg-io-v1-PostInitApplicationSQLRefs:

PostInitApplicationSQLRefs
--------------------------

**Appears in:**

-  :ref:`BootstrapInitDB {postgresql-cnpg-io-v1-BootstrapInitDB} <BootstrapInitDB {postgresql-cnpg-io-v1-BootstrapInitDB}>` 

PostInitApplicationSQLRefs points references to ConfigMaps or Secrets
which contain SQL files, the general implementation order to these
references is from all Secrets to all ConfigMaps, and inside Secrets or
ConfigMaps, the implementation order is same as the order of each array

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  secretRefs<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,SecretRefs holds a list of references to Secrets
  configMapRefs<br>  :ref:`*ConfigMapKeySelector* <#postgresql-cnpg-io-v1-configmapkeyselector>` ,ConfigMapRefs holds a list of references to ConfigMaps
  "",""

.. _postgresql-cnpg-io-v1-PostgresConfiguration:

PostgresConfiguration
---------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

PostgresConfiguration defines the PostgreSQL configuration

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  parameters<br>*map[string]string*,PostgreSQL configuration options (postgresql.conf)
  pg\_hba<br>*[]string*,PostgreSQL Host Based Authentication rules (lines to be appended to the pg\_hba.conf file)
  syncReplicaElectionConstraint<br>  :ref:`*SyncReplicaElectionConstraints* <#postgresql-cnpg-io-v1-syncreplicaelectionconstraints>` ,"Requirements to be met by sync replicas. This will affect how the ""synchronous\_standby\_names"" parameter will be set up."
  shared\_preload\_libraries<br>*[]string*,Lists of shared preload libraries to add to the default ones
  ldap<br>  :ref:`*LDAPConfig* <#postgresql-cnpg-io-v1-ldapconfig>` ,Options to specify LDAP configuration
  promotionTimeout<br>*int32*,"Specifies the maximum number of seconds to wait when promoting an instance to primary. Default value is 40000000, greater than one year in seconds, big enough to simulate an infinite timeout"
  "",""

PrimaryUpdateMethod {#postgresql-cnpg-io-v1-PrimaryUpdateMethod} (Alias of ``string`` )
---------------------------------------------------------------------------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

PrimaryUpdateMethod contains the method to use when upgrading the
primary server of the cluster as part of rolling updates

PrimaryUpdateStrategy {#postgresql-cnpg-io-v1-PrimaryUpdateStrategy} (Alias of ``string`` )
-------------------------------------------------------------------------------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

PrimaryUpdateStrategy contains the strategy to follow when upgrading the
primary server of the cluster as part of rolling updates

.. _postgresql-cnpg-io-v1-RecoveryTarget:

RecoveryTarget
--------------

**Appears in:**

-  :ref:`BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery} <BootstrapRecovery {postgresql-cnpg-io-v1-BootstrapRecovery}>` 

RecoveryTarget allows to configure the moment where the recovery process
will stop. All the target options except TargetTLI are mutually
exclusive.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  backupID<br>*string*,The ID of the backup from which to start the recovery process. If empty (default) the operator will automatically detect the backup based on targetTime or targetLSN if specified. Otherwise use the latest available backup in chronological order.
  targetTLI<br>*string*,"The target timeline (""latest"" or a positive integer)"
  targetXID<br>*string*,The target transaction ID
  targetName<br>*string*,The target name (to be previously created with pg\_create\_restore\_point)
  targetLSN<br>*string*,The target LSN (Log Sequence Number)
  targetTime<br>*string*,The target time as a timestamp in the RFC3339 standard
  targetImmediate<br>*bool*,End recovery as soon as a consistent state is reached
  exclusive<br>*bool*,"Set the target to be exclusive. If omitted, defaults to false, so that in Postgres, recovery\_target\_inclusive will be true"
  "",""

.. _postgresql-cnpg-io-v1-ReplicaClusterConfiguration:

ReplicaClusterConfiguration
---------------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

ReplicaClusterConfiguration encapsulates the configuration of a replica
cluster

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  source  **[Required]** <br>*string*,The name of the external cluster which is the replication origin
  enabled  **[Required]** <br>*bool*,"If replica mode is enabled, this cluster will be a replica of an existing cluster. Replica cluster can be created from a recovery object store or via streaming through pg\_basebackup. Refer to the Replica clusters page of the documentation for more information."
  "",""

.. _postgresql-cnpg-io-v1-ReplicationSlotsConfiguration:

ReplicationSlotsConfiguration
-----------------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

ReplicationSlotsConfiguration encapsulates the configuration of
replication slots

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  highAvailability<br> :ref:`archive_timeout <Replication>` ,Replication slots for high availability configuration
  updateInterval<br>*int*,Standby will update the status of the local replication slots every updateInterval seconds (default 30).
  "",""

.. _postgresql-cnpg-io-v1-ReplicationSlotsHAConfiguration:

ReplicationSlotsHAConfiguration
-------------------------------

**Appears in:**

-  :ref:`ReplicationSlotsConfiguration {postgresql-cnpg-io-v1-ReplicationSlotsConfiguration} <ReplicationSlotsConfiguration {postgresql-cnpg-io-v1-ReplicationSlotsConfiguration}>` 

ReplicationSlotsHAConfiguration encapsulates the configuration of the
replication slots that are automatically managed by the operator to
control the streaming replication connections with the standby instances
for high availability (HA) purposes. Replication slots are a PostgreSQL
feature that makes sure that PostgreSQL automatically keeps WAL files in
the primary when a streaming client (in this specific case a replica
that is part of the HA cluster) gets disconnected.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  enabled<br>*bool*,"If enabled (default), the operator will automatically manage replication slots on the primary instance and use them in streaming replication connections with all the standby instances that are part of the HA cluster. If disabled, the operator will not take advantage of replication slots in streaming connections with the replicas. This feature also controls replication slots in replica cluster, from the designated primary to its cascading replicas."
  slotPrefix<br>*string*,"Prefix for replication slots managed by the operator for HA. It may only contain lower case letters, numbers, and the underscore character. This can only be set at creation time. By default set to \_cnpg\_."
  "",""

.. _postgresql-cnpg-io-v1-RoleConfiguration:

RoleConfiguration
-----------------

\*\*.\ *\**\ :raw-latex:`\s`- :ref:`ManagedConfiguration {postgresql-cnpg-io-v1-ManagedConfiguration} <ManagedConfiguration {postgresql-cnpg-io-v1-ManagedConfiguration}>` 

RoleConfiguration is the representation, in Kubernetes, of a PostgreSQL
role with the additional field Ensure specifying whether to ensure the
presence or absence of the role in the database

The defaults of the CREATE ROLE command are applied Reference:
https://www.postgresql.org/docs/current/sql-createrole.html

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  name  **[Required]** <br>*string*,Name of the role
  comment<br>*string*,Description of the role
  ensure<br>  :ref:`*EnsureOption* <#postgresql-cnpg-io-v1-ensureoption>` ,"Ensure the role is present or absent - defaults to ""present"""
  passwordSecret<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,"Secret containing the password of the role (if present) If null, the password will be ignored unless DisablePassword is set"
  connectionLimit<br>*int64*,"If the role can log in, this specifies how many concurrent connections the role can make. -1 (the default) means no limit."
  validUntil<br>  `*meta/v1.Time* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#time-v1-meta>`__ ,"Date and time after which the role's password is no longer valid. When omitted, the password will never expire (default)."
  inRoles<br>*[]string*,List of one or more existing roles to which this role will be immediately added as a new member. Default empty.
  inherit<br>*bool*,"Whether a role ""inherits"" the privileges of roles it is a member of. Defaults is true."
  disablePassword<br>*bool*,DisablePassword indicates that a role's password should be set to NULL in Postgres
  superuser<br>*bool*,Whether the role is a superuser who can override all access restrictions within the database - superuser status is dangerous and should be used only when really needed. You must yourself be a superuser to create a new superuser. Defaults is false.
  createdb<br>*bool*,"When set to true, the role being defined will be allowed to create new databases. Specifying false (default) will deny a role the ability to create databases."
  createrole<br>*bool*,"Whether the role will be permitted to create, alter, drop, comment on, change the security label for, and grant or revoke membership in other roles. Default is false."
  login<br>*bool*,"Whether the role is allowed to log in. A role having the login attribute can be thought of as a user. Roles without this attribute are useful for managing database privileges, but are not users in the usual sense of the word. Default is false."
  replication<br>*bool*,"Whether a role is a replication role. A role must have this attribute (or be a superuser) in order to be able to connect to the server in replication mode (physical or logical replication) and in order to be able to create or drop replication slots. A role having the replication attribute is a very highly privileged role, and should only be used on roles actually used for replication. Default is false."
  bypassrls<br>*bool*,Whether a role bypasses every row-level security (RLS) policy. Default is false.
  "",""

.. _postgresql-cnpg-io-v1-S3Credentials:

S3Credentials
-------------

**Appears in:**

-  :ref:`BarmanCredentials {postgresql-cnpg-io-v1-BarmanCredentials} <BarmanCredentials {postgresql-cnpg-io-v1-BarmanCredentials}>` 

S3Credentials is the type for the credentials to be used to upload files
to S3. It can be provided in two alternative ways:

-  explicitly passing accessKeyId and secretAccessKey

-  inheriting the role from the pod environment by setting
   inheritFromIAMRole to true

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  accessKeyId<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The reference to the access key id
  secretAccessKey<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The reference to the secret access key
  region<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The reference to the secret containing the region name
  sessionToken<br>  :ref:`*SecretKeySelector* <#postgresql-cnpg-io-v1-secretkeyselector>` ,The references to the session key
  inheritFromIAMRole<br>*bool*,Use the role based authentication without providing explicitly the keys.
  "",""

.. _postgresql-cnpg-io-v1-ScheduledBackupSpec:

ScheduledBackupSpec
-------------------

**Appears in:**

-  :ref:`ScheduledBackup {postgresql-cnpg-io-v1-ScheduledBackup} <ScheduledBackup {postgresql-cnpg-io-v1-ScheduledBackup}>` 

ScheduledBackupSpec defines the desired state of ScheduledBackup

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  suspend<br>*bool*,If this backup is suspended or not
  immediate<br>*bool*,If the first backup has to be immediately start after creation or not
  schedule  **[Required]** <br>*string*,"The schedule does not follow the same format used in Kubernetes CronJobs as it includes an additional seconds specifier, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON\_Expression\_Format"
  cluster  **  :ref:`Required]<br>[*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ** ,The cluster to backup
  backupOwnerReference<br>*string*,<p>Indicates which ownerReference should be put inside the created backup resources.</p><p>- none: no owner reference for created backup objects (same behavior as before the field was introduced)</p><p>- self: sets the Scheduled backup object as owner of the backup</p><p>- cluster: set the cluster as owner of the backup</p>
  target<br> :ref:`archive_timeout <Backup>` ,"The policy to decide which instance should perform this backup. If empty, it defaults to cluster.spec.backup.target. Available options are empty string, primary and prefer-standby. primary to have backups run always on primary instances, prefer-standby to have backups run preferably on the most updated standby, if available."
  method<br> :ref:`archive_timeout <Backup>` ,"The backup method to be used, possible options are barmanObjectStore and volumeSnapshot. Defaults to: barmanObjectStore."
  "",""

.. _postgresql-cnpg-io-v1-ScheduledBackupStatus:

ScheduledBackupStatus
---------------------

**Appears in:**

-  :ref:`ScheduledBackup {postgresql-cnpg-io-v1-ScheduledBackup} <ScheduledBackup {postgresql-cnpg-io-v1-ScheduledBackup}>` 

ScheduledBackupStatus defines the observed state of ScheduledBackup

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  lastCheckTime<br>  `*meta/v1.Time* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#time-v1-meta>`__ ,The latest time the schedule
  lastScheduleTime<br>  `*meta/v1.Time* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#time-v1-meta>`__ ,Information when was the last time that backup was successfully scheduled.
  nextScheduleTime<br>  `*meta/v1.Time* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#time-v1-meta>`__ ,Next time we will run a backup
  "",""

.. _postgresql-cnpg-io-v1-SecretKeySelector:

SecretKeySelector
-----------------

**Appears in:**

-  :ref:`AzureCredentials {postgresql-cnpg-io-v1-AzureCredentials} <AzureCredentials {postgresql-cnpg-io-v1-AzureCredentials}>` 

-  :ref:`BackupSource {postgresql-cnpg-io-v1-BackupSource} <BackupSource {postgresql-cnpg-io-v1-BackupSource}>` 

-  :ref:`BackupStatus {postgresql-cnpg-io-v1-BackupStatus} <BackupStatus {postgresql-cnpg-io-v1-BackupStatus}>` 

-  :ref:`BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration} <BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration}>` 

-  :ref:`GoogleCredentials {postgresql-cnpg-io-v1-GoogleCredentials} <GoogleCredentials {postgresql-cnpg-io-v1-GoogleCredentials}>` 

-  :ref:`MonitoringConfiguration {postgresql-cnpg-io-v1-MonitoringConfiguration} <MonitoringConfiguration {postgresql-cnpg-io-v1-MonitoringConfiguration}>` 

-  :ref:`PostInitApplicationSQLRefs {postgresql-cnpg-io-v1-PostInitApplicationSQLRefs} <PostInitApplicationSQLRefs {postgresql-cnpg-io-v1-PostInitApplicationSQLRefs}>` 

-  :ref:`S3Credentials {postgresql-cnpg-io-v1-S3Credentials} <S3Credentials {postgresql-cnpg-io-v1-S3Credentials}>` 

SecretKeySelector contains enough information to let you locate the key
of a Secret

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  LocalObjectReference<br>  :ref:`*LocalObjectReference* <#postgresql-cnpg-io-v1-localobjectreference>` ,<p>(Members of LocalObjectReference are embedded into this type.) </p><p>The name of the secret in the pod's namespace to select from.</p>
  key  **[Required]** <br>*string*,The key to select
  "",""

.. _postgresql-cnpg-io-v1-SecretVersion:

SecretVersion
-------------

**Appears in:**

-  :ref:`PgBouncerSecrets {postgresql-cnpg-io-v1-PgBouncerSecrets} <PgBouncerSecrets {postgresql-cnpg-io-v1-PgBouncerSecrets}>` 

-  :ref:`PoolerSecrets {postgresql-cnpg-io-v1-PoolerSecrets} <PoolerSecrets {postgresql-cnpg-io-v1-PoolerSecrets}>` 

SecretVersion contains a secret name and its ResourceVersion

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  name<br>*string*,The name of the secret
  version<br>*string*,The ResourceVersion of the secret
  "",""

.. _postgresql-cnpg-io-v1-SecretsResourceVersion:

SecretsResourceVersion
----------------------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

SecretsResourceVersion is the resource versions of the secrets managed
by the operator

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  superuserSecretVersion<br>*string*,"The resource version of the ""postgres"" user secret"
  replicationSecretVersion<br>*string*,"The resource version of the ""streaming\_replica"" user secret"
  applicationSecretVersion<br>*string*,"The resource version of the ""app"" user secret"
  managedRoleSecretVersion<br>*map[string]string*,The resource versions of the managed roles secrets
  caSecretVersion<br>*string*,Unused. Retained for compatibility with old versions.
  clientCaSecretVersion<br>*string*,The resource version of the PostgreSQL client-side CA secret version
  serverCaSecretVersion<br>*string*,The resource version of the PostgreSQL server-side CA secret version
  serverSecretVersion<br>*string*,The resource version of the PostgreSQL server-side secret version
  barmanEndpointCA<br>*string*,The resource version of the Barman Endpoint CA if provided
  metrics<br>*map[string]string*,"A map with the versions of all the secrets used to pass metrics. Map keys are the secret names, map values are the versions"
  "",""

.. _postgresql-cnpg-io-v1-ServiceAccountTemplate:

ServiceAccountTemplate
----------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

ServiceAccountTemplate contains the template needed to generate the
service accounts

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  metadata  **  :ref:`Required]<br>[*Metadata* <#postgresql-cnpg-io-v1-metadata>` ** ,Metadata are the metadata to be used for the generated service account
  "",""

SnapshotOwnerReference {#postgresql-cnpg-io-v1-SnapshotOwnerReference} (Alias of ``string`` )
---------------------------------------------------------------------------------------------

**Appears in:**

-  :ref:`VolumeSnapshotConfiguration {postgresql-cnpg-io-v1-VolumeSnapshotConfiguration} <VolumeSnapshotConfiguration {postgresql-cnpg-io-v1-VolumeSnapshotConfiguration}>` 

SnapshotOwnerReference defines the reference type for the owner of the
snapshot. This specifies which owner the processed resources should
relate to.

SnapshotType {#postgresql-cnpg-io-v1-SnapshotType} (Alias of ``string`` )
-------------------------------------------------------------------------

**Appears in:**

-  :ref:`Import {postgresql-cnpg-io-v1-Import} <Import {postgresql-cnpg-io-v1-Import}>` 

SnapshotType is a type of allowed import

.. _postgresql-cnpg-io-v1-StorageConfiguration:

StorageConfiguration
--------------------

**Appears in:**

-  :ref:`ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec} <ClusterSpec {postgresql-cnpg-io-v1-ClusterSpec}>` 

StorageConfiguration is the configuration of the storage of the
PostgreSQL instances

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  storageClass<br>*string*,"StorageClass to use for database data (PGDATA). Applied after evaluating the PVC template, if available. If not specified, generated PVCs will be satisfied by the default storage class"
  size<br>*string*,Size of the storage. Required if not already specified in the PVC template. Changes to this field are automatically reapplied to the created PVCs. Size cannot be decreased.
  resizeInUseVolumes<br>*bool*,"Resize existent PVCs, defaults to true"
  pvcTemplate<br>  `*core/v1.PersistentVolumeClaimSpec* <https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#persistentvolumeclaimspec-v1-core>`__ ,Template to be used to generate the Persistent Volume Claim
  "",""

.. _postgresql-cnpg-io-v1-SyncReplicaElectionConstraints:

SyncReplicaElectionConstraints
------------------------------

**Appears in:**

-  :ref:`PostgresConfiguration {postgresql-cnpg-io-v1-PostgresConfiguration} <PostgresConfiguration {postgresql-cnpg-io-v1-PostgresConfiguration}>` 

SyncReplicaElectionConstraints contains the constraints for sync
replicas election.

For anti-affinity parameters two instances are considered in the same
location if all the labels values match.

In future synchronous replica election restriction by name will be
supported.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  nodeLabelsAntiAffinity<br>*[]string*,A list of node labels values to extract and compare to evaluate if the pods reside in the same topology or not
  enabled  **[Required]** <br>*bool*,This flag enables the constraints for sync replicas
  "",""

.. _postgresql-cnpg-io-v1-Topology:

Topology
--------

**Appears in:**

-  :ref:`ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus} <ClusterStatus {postgresql-cnpg-io-v1-ClusterStatus}>` 

Topology contains the cluster topology

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  instances<br>  :ref:`*map\[github.com/cloudnative-pg/cloudnative-pg/api/v1.PodName\]github.com/cloudnative-pg/cloudnative-pg/api/v1.PodTopologyLabels* <#postgresql-cnpg-io-v1-podtopologylabels>` ,Instances contains the pod topology of the instances
  nodesUsed<br>*int32*,"NodesUsed represents the count of distinct nodes accommodating the instances. A value of '1' suggests that all instances are hosted on a single node, implying the absence of High Availability (HA). Ideally, this value should be the same as the number of instances in the Postgres HA cluster, implying shared nothing architecture on the compute side."
  successfullyExtracted<br>*bool*,SuccessfullyExtracted indicates if the topology data was extract. It is useful to enact fallback behaviors in synchronous replica election in case of failures
  "",""

.. _postgresql-cnpg-io-v1-VolumeSnapshotConfiguration:

VolumeSnapshotConfiguration
---------------------------

**Appears in:**

-  :ref:`BackupConfiguration {postgresql-cnpg-io-v1-BackupConfiguration} <BackupConfiguration {postgresql-cnpg-io-v1-BackupConfiguration}>` 

VolumeSnapshotConfiguration represents the configuration for the
execution of snapshot backups.

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  labels<br>*map[string]string*,Labels are key-value pairs that will be added to .metadata.labels snapshot resources.
  annotations<br>*map[string]string*,Annotations key-value pairs that will be added to .metadata.annotations snapshot resources.
  className<br>*string*,ClassName specifies the Snapshot Class to be used for PG\_DATA PersistentVolumeClaim. It is the default class for the other types if no specific class is present
  walClassName<br>*string*,WalClassName specifies the Snapshot Class to be used for the PG\_WAL PersistentVolumeClaim.
  snapshotOwnerReference<br>  :ref:`*SnapshotOwnerReference* <#postgresql-cnpg-io-v1-snapshotownerreference>` ,SnapshotOwnerReference indicates the type of owner reference the snapshot should have
  "",""

.. _postgresql-cnpg-io-v1-WalBackupConfiguration:

WalBackupConfiguration
----------------------

**Appears in:**

-  :ref:`BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration} <BarmanObjectStoreConfiguration {postgresql-cnpg-io-v1-BarmanObjectStoreConfiguration}>` 

WalBackupConfiguration is the configuration of the backup of the WAL
stream

.. csv-table::
  :header: **Field**,**Description**
  :widths: 10,30
  :align: left
  :class: longtable

  compression<br>  :ref:`*CompressionType* <#postgresql-cnpg-io-v1-compressiontype>` ,"Compress a WAL file before sending it to the object store. Available options are empty string (no compression, default), gzip, bzip2 or snappy."
  encryption<br>  :ref:`*EncryptionType* <#postgresql-cnpg-io-v1-encryptiontype>` ,"Whenever to force the encryption of files (if the bucket is not already configured for that). Allowed options are empty string (use the bucket policy, default), AES256 and aws:kms"
  maxParallel<br>*int*,"Number of WAL files to be either archived in parallel (when the PostgreSQL instance is archiving to a backup object store) or restored in parallel (when a PostgreSQL standby is fetching WAL files from a recovery object store). If not specified, WAL files will be processed one at a time. It accepts a positive integer as a value - with 1 being the minimum accepted value."
  "",""
