Documentation
¶
Overview ¶
Package v1 contains API Schema definitions for the postgresql v1 API group +kubebuilder:object:generate=true +groupName=postgresql.cnpg.io
Index ¶
- Constants
- Variables
- func ConfigMapKeySelectorToCore(selector *ConfigMapKeySelector) *corev1.ConfigMapKeySelector
- func GetExternalClustersEnabledPluginNames(externalClusters []ExternalCluster) (result []string)
- func GetPluginConfigurationEnabledPluginNames(pluginList []PluginConfiguration) (result []string)
- func ListStatusPods(podList []corev1.Pod) map[PodStatus][]string
- func SecretKeySelectorToCore(selector *SecretKeySelector) *corev1.SecretKeySelector
- type AffinityConfiguration
- type AvailableArchitecture
- type AzureCredentials
- type Backup
- func (in *Backup) DeepCopy() *Backup
- func (in *Backup) DeepCopyInto(out *Backup)
- func (in *Backup) DeepCopyObject() runtime.Object
- func (backup *Backup) EnsureGVKIsPresent()
- func (backup *Backup) GetAssignedInstance(ctx context.Context, cli client.Client) (*corev1.Pod, error)
- func (backup *Backup) GetMetadata() *metav1.ObjectMeta
- func (backup *Backup) GetName() string
- func (backup *Backup) GetNamespace() string
- func (backup *Backup) GetOnlineOrDefault(cluster *Cluster) bool
- func (backup *Backup) GetStatus() *BackupStatus
- func (backup *Backup) GetVolumeSnapshotConfiguration(clusterConfig VolumeSnapshotConfiguration) VolumeSnapshotConfiguration
- func (backup *Backup) GetVolumeSnapshotDeadline() time.Duration
- func (backup *Backup) IsCompletedVolumeSnapshot() bool
- type BackupConfiguration
- type BackupList
- func (list *BackupList) CanExecuteBackup(backupName string) bool
- func (in *BackupList) DeepCopy() *BackupList
- func (in *BackupList) DeepCopyInto(out *BackupList)
- func (in *BackupList) DeepCopyObject() runtime.Object
- func (list BackupList) GetPendingBackupNames() []string
- func (list *BackupList) SortByName()
- func (list *BackupList) SortByReverseCreationTime()
- type BackupMethod
- type BackupPhase
- type BackupPluginConfiguration
- type BackupSnapshotElementStatus
- type BackupSnapshotStatus
- type BackupSource
- type BackupSpec
- type BackupStatus
- func (in *BackupStatus) DeepCopy() *BackupStatus
- func (in *BackupStatus) DeepCopyInto(out *BackupStatus)
- func (backupStatus *BackupStatus) GetOnline() bool
- func (backupStatus *BackupStatus) IsDone() bool
- func (backupStatus *BackupStatus) IsInProgress() bool
- func (backupStatus *BackupStatus) SetAsCompleted()
- func (backupStatus *BackupStatus) SetAsFailed(err error)
- func (backupStatus *BackupStatus) SetAsFinalizing()
- func (backupStatus *BackupStatus) SetAsStarted(podName, containerID string, method BackupMethod)
- type BackupTarget
- type BarmanCredentials
- type BarmanObjectStoreConfiguration
- type BootstrapConfiguration
- type BootstrapInitDB
- type BootstrapPgBaseBackup
- type BootstrapRecovery
- type CatalogImage
- type CertificatesConfiguration
- type CertificatesStatus
- type Cluster
- func (cluster *Cluster) ContainsManagedRolesConfiguration() bool
- func (cluster *Cluster) ContainsTablespaces() bool
- func (in *Cluster) DeepCopy() *Cluster
- func (in *Cluster) DeepCopyInto(out *Cluster)
- func (in *Cluster) DeepCopyObject() runtime.Object
- func (r *Cluster) Default()
- func (cluster *Cluster) EnsureGVKIsPresent()
- func (cluster Cluster) ExternalCluster(name string) (ExternalCluster, bool)
- func (cluster *Cluster) GetApplicationDatabaseName() string
- func (cluster *Cluster) GetApplicationDatabaseOwner() string
- func (cluster *Cluster) GetApplicationSecretName() string
- func (cluster Cluster) GetBarmanEndpointCAForReplicaCluster() *SecretKeySelector
- func (cluster *Cluster) GetClientCASecretName() string
- func (cluster *Cluster) GetClusterAltDNSNames() []string
- func (cluster *Cluster) GetCoredumpFilter() string
- func (cluster *Cluster) GetEnableLDAPAuth() bool
- func (cluster *Cluster) GetEnablePDB() bool
- func (cluster *Cluster) GetEnableSuperuserAccess() bool
- func (cluster *Cluster) GetEnabledWALArchivePluginName() string
- func (cluster *Cluster) GetExternalClusterSecrets() *stringset.Data
- func (cluster *Cluster) GetFixedInheritedAnnotations() map[string]string
- func (cluster *Cluster) GetFixedInheritedLabels() map[string]string
- func (cluster *Cluster) GetImagePullSecret() string
- func (cluster *Cluster) GetInstanceEnabledPluginNames() (result []string)
- func (cluster *Cluster) GetJobEnabledPluginNames() (result []string)
- func (cluster *Cluster) GetLDAPSecretName() string
- func (cluster *Cluster) GetMaxStartDelay() int32
- func (cluster *Cluster) GetMaxStopDelay() int32
- func (cluster *Cluster) GetMaxSwitchoverDelay() int32
- func (cluster *Cluster) GetPgCtlTimeoutForPromotion() int32
- func (cluster Cluster) GetPostgresGID() int64
- func (cluster Cluster) GetPostgresUID() int64
- func (cluster *Cluster) GetPostgresqlMajorVersion() (int, error)
- func (cluster *Cluster) GetPrimaryUpdateMethod() PrimaryUpdateMethod
- func (cluster *Cluster) GetPrimaryUpdateStrategy() PrimaryUpdateStrategy
- func (cluster *Cluster) GetRecoverySourcePlugin() *PluginConfiguration
- func (cluster *Cluster) GetReplicationSecretName() string
- func (cluster *Cluster) GetRestartTimeout() time.Duration
- func (cluster *Cluster) GetSeccompProfile() *corev1.SeccompProfile
- func (cluster *Cluster) GetServerCASecretName() string
- func (cluster *Cluster) GetServerCASecretObjectKey() types.NamespacedName
- func (cluster *Cluster) GetServerTLSSecretName() string
- func (cluster *Cluster) GetServiceAnyName() string
- func (cluster *Cluster) GetServiceReadName() string
- func (cluster *Cluster) GetServiceReadOnlyName() string
- func (cluster *Cluster) GetServiceReadWriteName() string
- func (cluster Cluster) GetSlotNameFromInstanceName(instanceName string) string
- func (cluster *Cluster) GetSmartShutdownTimeout() int32
- func (cluster *Cluster) GetSuperuserSecretName() string
- func (cluster *Cluster) GetTablespaceConfiguration(name string) *TablespaceConfiguration
- func (cluster *Cluster) IsFailoverQuorumActive() (bool, error)
- func (cluster *Cluster) IsInplaceRestartPhase() bool
- func (cluster *Cluster) IsInstanceFenced(instance string) bool
- func (cluster *Cluster) IsMetricsTLSEnabled() bool
- func (cluster *Cluster) IsNodeMaintenanceWindowInProgress() bool
- func (cluster *Cluster) IsPodMonitorEnabled() bool
- func (cluster *Cluster) IsReadOnlyServiceEnabled() bool
- func (cluster *Cluster) IsReadServiceEnabled() bool
- func (cluster *Cluster) IsReadWriteServiceEnabled() bool
- func (cluster Cluster) IsReplica() bool
- func (cluster *Cluster) IsReusePVCEnabled() bool
- func (cluster *Cluster) LogTimestampsWithMessage(ctx context.Context, logMessage string)
- func (r *Cluster) SetDefaults()
- func (cluster *Cluster) SetInContext(ctx context.Context) context.Context
- func (cluster *Cluster) SetInheritedData(obj *metav1.ObjectMeta)
- func (cluster *Cluster) SetInheritedDataAndOwnership(obj *metav1.ObjectMeta)
- func (cluster *Cluster) ShouldCreateApplicationDatabase() bool
- func (cluster *Cluster) ShouldCreateApplicationSecret() bool
- func (cluster *Cluster) ShouldCreateProjectedVolume() bool
- func (cluster *Cluster) ShouldCreateWalArchiveVolume() bool
- func (cluster *Cluster) ShouldForceLegacyBackup() bool
- func (cluster *Cluster) ShouldInitDBCreateApplicationDatabase() bool
- func (cluster *Cluster) ShouldInitDBCreateApplicationSecret() bool
- func (cluster *Cluster) ShouldInitDBRunPostInitApplicationSQLRefs() bool
- func (cluster *Cluster) ShouldInitDBRunPostInitSQLRefs() bool
- func (cluster *Cluster) ShouldInitDBRunPostInitTemplateSQLRefs() bool
- func (cluster *Cluster) ShouldPgBaseBackupCreateApplicationDatabase() bool
- func (cluster *Cluster) ShouldPgBaseBackupCreateApplicationSecret() bool
- func (cluster *Cluster) ShouldPromoteFromReplicaCluster() bool
- func (cluster *Cluster) ShouldRecoveryCreateApplicationDatabase() bool
- func (cluster *Cluster) ShouldRecoveryCreateApplicationSecret() bool
- func (cluster *Cluster) ShouldResizeInUseVolumes() bool
- func (cluster *Cluster) UpdateBackupTimes(backupMethod BackupMethod, firstRecoverabilityPoint *time.Time, ...)
- func (cluster *Cluster) UsesConfigMap(config string) (ok bool)
- func (cluster *Cluster) UsesSecret(secret string) bool
- func (cluster *Cluster) UsesSecretInManagedRoles(secretName string) bool
- type ClusterConditionType
- type ClusterImageCatalog
- type ClusterImageCatalogList
- type ClusterList
- type ClusterMonitoringTLSConfiguration
- type ClusterSpec
- type ClusterStatus
- type ConditionReason
- type ConditionStatus
- type ConfigMapKeySelector
- type ConfigMapResourceVersion
- type DataBackupConfiguration
- type DataDurabilityLevel
- type DataSource
- type Database
- func (in *Database) DeepCopy() *Database
- func (in *Database) DeepCopyInto(out *Database)
- func (in *Database) DeepCopyObject() runtime.Object
- func (db *Database) GetClusterRef() corev1.LocalObjectReference
- func (db *Database) GetManagedObjectName() string
- func (db *Database) GetName() string
- func (db *Database) GetStatusMessage() string
- func (db *Database) HasReconciliations() bool
- func (db *Database) SetAsFailed(err error)
- func (db *Database) SetAsReady()
- func (db *Database) SetAsUnknown(err error)
- func (db *Database) SetStatusObservedGeneration(obsGeneration int64)
- type DatabaseList
- type DatabaseObjectSpec
- type DatabaseObjectStatus
- type DatabaseReclaimPolicy
- type DatabaseRoleRef
- type DatabaseSpec
- type DatabaseStatus
- type EmbeddedObjectMetadata
- type EnsureOption
- type EphemeralVolumesSizeLimitConfiguration
- func (in *EphemeralVolumesSizeLimitConfiguration) DeepCopy() *EphemeralVolumesSizeLimitConfiguration
- func (in *EphemeralVolumesSizeLimitConfiguration) DeepCopyInto(out *EphemeralVolumesSizeLimitConfiguration)
- func (e *EphemeralVolumesSizeLimitConfiguration) GetShmLimit() *resource.Quantity
- func (e *EphemeralVolumesSizeLimitConfiguration) GetTemporaryDataLimit() *resource.Quantity
- type ExtensionConfiguration
- type ExtensionSpec
- type ExternalCluster
- type FailoverQuorum
- type FailoverQuorumList
- type FailoverQuorumStatus
- type GenericImageCatalog
- type GoogleCredentials
- type ImageCatalog
- type ImageCatalogList
- type ImageCatalogRef
- type ImageCatalogSpec
- type ImageInfo
- type Import
- type ImportSource
- type InstanceID
- type InstanceReportedState
- type IsolationCheckConfiguration
- type KubernetesUpgradeStrategy
- type LDAPBindAsAuth
- type LDAPBindSearchAuth
- type LDAPConfig
- type LDAPScheme
- type LivenessProbe
- type LocalObjectReference
- type ManagedConfiguration
- type ManagedRoles
- type ManagedService
- type ManagedServices
- type Metadata
- type MonitoringConfiguration
- type NodeMaintenanceWindow
- type OnlineConfiguration
- type PasswordState
- type PgBouncerIntegrationStatus
- type PgBouncerPoolMode
- type PgBouncerSecrets
- type PgBouncerSpec
- type PluginConfiguration
- type PluginStatus
- type PodName
- type PodStatus
- type PodTemplateSpec
- type PodTopologyLabels
- type Pooler
- func (in *Pooler) DeepCopy() *Pooler
- func (in *Pooler) DeepCopyInto(out *Pooler)
- func (in *Pooler) DeepCopyObject() runtime.Object
- func (in *Pooler) GetAuthQuery() string
- func (in *Pooler) GetAuthQuerySecretName() string
- func (in *Pooler) GetResourcesRequirements() corev1.ResourceRequirements
- func (in *Pooler) IsAutomatedIntegration() bool
- type PoolerIntegrations
- type PoolerList
- type PoolerMonitoringConfiguration
- type PoolerSecrets
- type PoolerSpec
- type PoolerStatus
- type PoolerType
- type PostgresConfiguration
- type PrimaryUpdateMethod
- type PrimaryUpdateStrategy
- type Probe
- type ProbeStrategyType
- type ProbeWithStrategy
- type ProbesConfiguration
- type Publication
- func (in *Publication) DeepCopy() *Publication
- func (in *Publication) DeepCopyInto(out *Publication)
- func (in *Publication) DeepCopyObject() runtime.Object
- func (pub *Publication) GetClusterRef() corev1.LocalObjectReference
- func (pub *Publication) GetManagedObjectName() string
- func (pub *Publication) GetName() string
- func (pub *Publication) GetStatusMessage() string
- func (pub *Publication) HasReconciliations() bool
- func (pub *Publication) SetAsFailed(err error)
- func (pub *Publication) SetAsReady()
- func (pub *Publication) SetAsUnknown(err error)
- func (pub *Publication) SetStatusObservedGeneration(obsGeneration int64)
- type PublicationList
- type PublicationReclaimPolicy
- type PublicationSpec
- type PublicationStatus
- type PublicationTarget
- type PublicationTargetObject
- type PublicationTargetTable
- type RecoveryTarget
- func (target *RecoveryTarget) BuildPostgresOptions() string
- func (in *RecoveryTarget) DeepCopy() *RecoveryTarget
- func (in *RecoveryTarget) DeepCopyInto(out *RecoveryTarget)
- func (target *RecoveryTarget) GetBackupID() string
- func (target *RecoveryTarget) GetTargetLSN() string
- func (target *RecoveryTarget) GetTargetTLI() string
- func (target *RecoveryTarget) GetTargetTime() string
- type ReplicaClusterConfiguration
- type ReplicationSlotsConfiguration
- func (in *ReplicationSlotsConfiguration) DeepCopy() *ReplicationSlotsConfiguration
- func (in *ReplicationSlotsConfiguration) DeepCopyInto(out *ReplicationSlotsConfiguration)
- func (r *ReplicationSlotsConfiguration) GetEnabled() bool
- func (r *ReplicationSlotsConfiguration) GetUpdateInterval() time.Duration
- type ReplicationSlotsHAConfiguration
- func (in *ReplicationSlotsHAConfiguration) DeepCopy() *ReplicationSlotsHAConfiguration
- func (in *ReplicationSlotsHAConfiguration) DeepCopyInto(out *ReplicationSlotsHAConfiguration)
- func (r *ReplicationSlotsHAConfiguration) GetEnabled() bool
- func (r *ReplicationSlotsHAConfiguration) GetSlotNameFromInstanceName(instanceName string) string
- func (r *ReplicationSlotsHAConfiguration) GetSlotPrefix() string
- type RoleConfiguration
- type RoleStatus
- type S3Credentials
- type SQLRefs
- type ScheduledBackup
- func (scheduledBackup *ScheduledBackup) CreateBackup(name string) *Backup
- func (in *ScheduledBackup) DeepCopy() *ScheduledBackup
- func (in *ScheduledBackup) DeepCopyInto(out *ScheduledBackup)
- func (in *ScheduledBackup) DeepCopyObject() runtime.Object
- func (scheduledBackup *ScheduledBackup) GetName() string
- func (scheduledBackup *ScheduledBackup) GetNamespace() string
- func (scheduledBackup *ScheduledBackup) GetSchedule() string
- func (scheduledBackup *ScheduledBackup) GetStatus() *ScheduledBackupStatus
- func (scheduledBackup ScheduledBackup) IsImmediate() bool
- func (scheduledBackup ScheduledBackup) IsSuspended() bool
- type ScheduledBackupList
- type ScheduledBackupSpec
- type ScheduledBackupStatus
- type SchemaSpec
- type SecretKeySelector
- type SecretVersion
- type SecretsResourceVersion
- func (in *SecretsResourceVersion) DeepCopy() *SecretsResourceVersion
- func (in *SecretsResourceVersion) DeepCopyInto(out *SecretsResourceVersion)
- func (secretResourceVersion *SecretsResourceVersion) SetExternalClusterSecretVersion(secretName string, version *string)
- func (secretResourceVersion *SecretsResourceVersion) SetManagedRoleSecretVersion(secret string, version *string)
- type ServiceAccountTemplate
- type ServiceSelectorType
- type ServiceTemplateSpec
- type ServiceUpdateStrategy
- type SnapshotOwnerReference
- type SnapshotType
- type StorageConfiguration
- type Subscription
- func (in *Subscription) DeepCopy() *Subscription
- func (in *Subscription) DeepCopyInto(out *Subscription)
- func (in *Subscription) DeepCopyObject() runtime.Object
- func (sub *Subscription) GetClusterRef() corev1.LocalObjectReference
- func (sub *Subscription) GetManagedObjectName() string
- func (sub *Subscription) GetName() string
- func (sub *Subscription) GetStatusMessage() string
- func (sub *Subscription) HasReconciliations() bool
- func (sub *Subscription) SetAsFailed(err error)
- func (sub *Subscription) SetAsReady()
- func (sub *Subscription) SetAsUnknown(err error)
- func (sub *Subscription) SetStatusObservedGeneration(obsGeneration int64)
- type SubscriptionList
- type SubscriptionReclaimPolicy
- type SubscriptionSpec
- type SubscriptionStatus
- type SwitchReplicaClusterStatus
- type SyncReplicaElectionConstraints
- type SynchronizeReplicasConfiguration
- func (in *SynchronizeReplicasConfiguration) DeepCopy() *SynchronizeReplicasConfiguration
- func (in *SynchronizeReplicasConfiguration) DeepCopyInto(out *SynchronizeReplicasConfiguration)
- func (r *SynchronizeReplicasConfiguration) GetEnabled() bool
- func (r *SynchronizeReplicasConfiguration) IsExcludedByUser(slotName string) (bool, error)
- func (r *SynchronizeReplicasConfiguration) ValidateRegex() error
- type SynchronousReplicaConfiguration
- type SynchronousReplicaConfigurationMethod
- type TablespaceConfiguration
- type TablespaceState
- type TablespaceStatus
- type Topology
- type VolumeSnapshotConfiguration
- type WalBackupConfiguration
Constants ¶
const ( // BackupPhasePending means that the backup is still waiting to be started BackupPhasePending = "pending" // BackupPhaseStarted means that the backup is now running BackupPhaseStarted = "started" // BackupPhaseRunning means that the backup is now running BackupPhaseRunning = "running" // BackupPhaseFinalizing means that a consistent backup have been // taken and the operator is waiting for it to be ready to be // used to restore a cluster. // This phase is used for VolumeSnapshot backups, when a // VolumeSnapshotContent have already been provisioned, but it is // still now waiting for the `readyToUse` flag to be true. BackupPhaseFinalizing = "finalizing" // BackupPhaseCompleted means that the backup is now completed BackupPhaseCompleted = "completed" // BackupPhaseFailed means that the backup is failed BackupPhaseFailed = "failed" // BackupPhaseWalArchivingFailing means wal archiving isn't properly working BackupPhaseWalArchivingFailing = "walArchivingFailing" )
const ( // PodHealthy means that a Pod is active and ready PodHealthy = "healthy" // PodReplicating means that a Pod is still not ready but still active PodReplicating = "replicating" // PodFailed means that a Pod will not be scheduled again (deleted or evicted) PodFailed = "failed" )
const ( // DefaultMonitoringKey is the key that should be used in the default metrics configmap to store the queries DefaultMonitoringKey = "queries" // DefaultMonitoringConfigMapName is the name of the target configmap with the default monitoring queries, // if configured DefaultMonitoringConfigMapName = "cnpg-default-monitoring" // DefaultMonitoringSecretName is the name of the target secret with the default monitoring queries, // if configured DefaultMonitoringSecretName = DefaultMonitoringConfigMapName // DefaultApplicationDatabaseName is the name of application database if not specified DefaultApplicationDatabaseName = "app" // DefaultApplicationUserName is the name of application database owner if not specified DefaultApplicationUserName = DefaultApplicationDatabaseName )
const ( // PrimaryPodDisruptionBudgetSuffix is the suffix appended to the cluster name // to get the name of the PDB used for the cluster primary PrimaryPodDisruptionBudgetSuffix = "-primary" // ReplicationSecretSuffix is the suffix appended to the cluster name to // get the name of the generated replication secret for PostgreSQL ReplicationSecretSuffix = "-replication" // #nosec // SuperUserSecretSuffix is the suffix appended to the cluster name to // get the name of the PostgreSQL superuser secret SuperUserSecretSuffix = "-superuser" // ApplicationUserSecretSuffix is the suffix appended to the cluster name to // get the name of the application user secret ApplicationUserSecretSuffix = "-app" // DefaultServerCaSecretSuffix is the suffix appended to the secret containing // the generated CA for the cluster DefaultServerCaSecretSuffix = "-ca" // ClientCaSecretSuffix is the suffix appended to the secret containing // the generated CA for the client certificates ClientCaSecretSuffix = "-ca" // ServerSecretSuffix is the suffix appended to the secret containing // the generated server secret for PostgreSQL ServerSecretSuffix = "-server" // ServiceAnySuffix is the suffix appended to the cluster name to get the // service name for every node (including non-ready ones) ServiceAnySuffix = "-any" // ServiceReadSuffix is the suffix appended to the cluster name to get the // service name for every ready node that you can use to read data (including the primary) ServiceReadSuffix = "-r" // ServiceReadOnlySuffix is the suffix appended to the cluster name to get the // service name for every ready node that you can use to read data (excluding the primary) ServiceReadOnlySuffix = "-ro" // ServiceReadWriteSuffix is the suffix appended to the cluster name to get // the se service name for every node that you can use to read and write // data ServiceReadWriteSuffix = "-rw" // ClusterSecretSuffix is the suffix appended to the cluster name to // get the name of the pull secret ClusterSecretSuffix = "-pull-secret" // WalArchiveVolumeSuffix is the suffix appended to the instance name to // get the name of the PVC dedicated to WAL files. WalArchiveVolumeSuffix = "-wal" // TablespaceVolumeInfix is the infix added between the instance name // and tablespace name to get the name of PVC for a certain tablespace TablespaceVolumeInfix = "-tbs-" // StreamingReplicationUser is the name of the user we'll use for // streaming replication purposes StreamingReplicationUser = "streaming_replica" // DefaultPostgresUID is the default UID which is used by PostgreSQL DefaultPostgresUID = 26 // DefaultPostgresGID is the default GID which is used by PostgreSQL DefaultPostgresGID = 26 // PodAntiAffinityTypeRequired is the label for required anti-affinity type PodAntiAffinityTypeRequired = "required" // PodAntiAffinityTypePreferred is the label for preferred anti-affinity type PodAntiAffinityTypePreferred = "preferred" // DefaultPgBouncerPoolerSecretSuffix is the suffix for the default pgbouncer Pooler secret DefaultPgBouncerPoolerSecretSuffix = "-pooler" // PendingFailoverMarker is used as target primary to signal that a failover is required PendingFailoverMarker = "pending" // PGBouncerPoolerUserName is the name of the role to be used for PGBouncerPoolerUserName = "cnpg_pooler_pgbouncer" // MissingWALDiskSpaceExitCode is the exit code the instance manager // will use to signal that there's no more WAL disk space MissingWALDiskSpaceExitCode = 4 // MissingWALArchivePlugin is the exit code used by the instance manager // to indicate that it started successfully, but the configured WAL // archiving plugin is not available. MissingWALArchivePlugin = 5 )
const ( // PhaseSwitchover when a cluster is changing the primary node PhaseSwitchover = "Switchover in progress" // PhaseFailOver in case a pod is missing and need to change primary PhaseFailOver = "Failing over" // PhaseFirstPrimary for an starting cluster PhaseFirstPrimary = "Setting up primary" // PhaseCreatingReplica everytime we add a new replica PhaseCreatingReplica = "Creating a new replica" // PhaseUpgrade upgrade in process PhaseUpgrade = "Upgrading cluster" // PhaseMajorUpgrade major version upgrade in process PhaseMajorUpgrade = "Upgrading Postgres major version" // PhaseUpgradeDelayed is set when a cluster needs to be upgraded, // but the operation is being delayed by the operator configuration PhaseUpgradeDelayed = "Cluster upgrade delayed" // PhaseWaitingForUser set the status to wait for an action from the user PhaseWaitingForUser = "Waiting for user action" // PhaseInplacePrimaryRestart for a cluster restarting the primary instance in-place PhaseInplacePrimaryRestart = "Primary instance is being restarted in-place" // PhaseInplaceDeletePrimaryRestart for a cluster restarting the primary instance without a switchover PhaseInplaceDeletePrimaryRestart = "Primary instance is being restarted without a switchover" // PhaseHealthy for a cluster doing nothing PhaseHealthy = "Cluster in healthy state" // PhaseUnknownPlugin is triggered when the required CNPG-i plugin have not been // loaded still PhaseUnknownPlugin = "Cluster cannot proceed to reconciliation due to an unknown plugin being required" // PhaseFailurePlugin is triggered when the cluster cannot proceed to reconciliation due to an interaction failure PhaseFailurePlugin = "Cluster cannot proceed to reconciliation due to an error while interacting with plugins" // PhaseImageCatalogError is triggered when the cluster cannot select the image to // apply because of an invalid or incomplete catalog PhaseImageCatalogError = "Cluster has incomplete or invalid image catalog" // PhaseUnrecoverable for an unrecoverable cluster PhaseUnrecoverable = "Cluster is unrecoverable and needs manual intervention" // PhaseArchitectureBinaryMissing is the error phase describing a missing architecture PhaseArchitectureBinaryMissing = "Cluster cannot execute instance online upgrade due to missing architecture binary" // PhaseWaitingForInstancesToBeActive is a waiting phase that is triggered when an instance pod is not active PhaseWaitingForInstancesToBeActive = "Waiting for the instances to become active" // PhaseOnlineUpgrading for when the instance manager is being upgraded in place PhaseOnlineUpgrading = "Online upgrade in progress" // PhaseApplyingConfiguration is set by the instance manager when a configuration // change is being detected PhaseApplyingConfiguration = "Applying configuration" // PhaseReplicaClusterPromotion is the phase PhaseReplicaClusterPromotion = "Promoting to primary cluster" // PhaseCannotCreateClusterObjects is set by the operator when is unable to create cluster resources PhaseCannotCreateClusterObjects = "Unable to create required cluster objects" )
const ( // KubernetesUpgradeStrategyAllocateSpace means that the operator // should allocate more disk space to host data belonging to the // k8s node that is being updated KubernetesUpgradeStrategyAllocateSpace = "allocateSpace" // KubernetesUpgradeStrategyWaitForNode means that the operator // should just recreate stuff and wait for the upgraded node // to be ready KubernetesUpgradeStrategyWaitForNode = "waitForNode" )
const ( // PrimaryUpdateStrategySupervised means that the operator need to wait for the // user to manually issue a switchover request before updating the primary // server (`supervised`) PrimaryUpdateStrategySupervised PrimaryUpdateStrategy = "supervised" // PrimaryUpdateStrategyUnsupervised means that the operator will proceed with the // selected PrimaryUpdateMethod to another updated replica and then automatically update // the primary server (`unsupervised`, default) PrimaryUpdateStrategyUnsupervised PrimaryUpdateStrategy = "unsupervised" // PrimaryUpdateMethodSwitchover means that the operator will switchover to another updated // replica when it needs to upgrade the primary instance PrimaryUpdateMethodSwitchover PrimaryUpdateMethod = "switchover" // PrimaryUpdateMethodRestart means that the operator will restart the primary instance in-place // when it needs to upgrade it PrimaryUpdateMethodRestart PrimaryUpdateMethod = "restart" // DefaultPgCtlTimeoutForPromotion is the default for the pg_ctl timeout when a promotion is performed. // It is greater than one year in seconds, big enough to simulate an infinite timeout DefaultPgCtlTimeoutForPromotion = 40000000 // DefaultMaxSwitchoverDelay is the default for the pg_ctl timeout in seconds when a primary PostgreSQL instance // is gracefully shutdown during a switchover. DefaultMaxSwitchoverDelay = 3600 // DefaultStartupDelay is the default value for startupDelay, startupDelay will be used to calculate the // FailureThreshold of startupProbe, the formula is `FailureThreshold = ceiling(startDelay / periodSeconds)`, // the minimum value is 1 DefaultStartupDelay = 3600 )
const ( // SynchronousReplicaConfigurationMethodFirst means a priority list should be used SynchronousReplicaConfigurationMethodFirst = SynchronousReplicaConfigurationMethod("first") // SynchronousReplicaConfigurationMethodAny means that quorum based replication should be used SynchronousReplicaConfigurationMethodAny = SynchronousReplicaConfigurationMethod("any") )
const ( // BackupTargetPrimary means backups will be performed on the primary instance BackupTargetPrimary = BackupTarget("primary") // BackupTargetStandby means backups will be performed on a standby instance if available BackupTargetStandby = BackupTarget("prefer-standby") // DefaultBackupTarget is the default BackupTarget DefaultBackupTarget = BackupTargetStandby )
const ( // ServiceUpdateStrategyPatch applies a patch deriving from the differences of the actual service and the expect one ServiceUpdateStrategyPatch = "patch" // ServiceUpdateStrategyReplace deletes the existing service and recreates it when a difference is detected ServiceUpdateStrategyReplace = "replace" )
const ( // ClusterKind is the kind name of Clusters ClusterKind = "Cluster" // BackupKind is the kind name of Backups BackupKind = "Backup" // PoolerKind is the kind name of Poolers PoolerKind = "Pooler" // ImageCatalogKind is the kind name of namespaced image catalogs ImageCatalogKind = "ImageCatalog" // ClusterImageCatalogKind is the kind name of the cluster-wide image catalogs ClusterImageCatalogKind = "ClusterImageCatalog" // PublicationKind is the kind name of publications PublicationKind = "Publication" // SubscriptionKind is the kind name of subscriptions SubscriptionKind = "Subscription" // DatabaseKind is the kind name of databases DatabaseKind = "Database" )
const ( // PoolerTypeRW means that the pooler involves only the primary server PoolerTypeRW = PoolerType("rw") // PoolerTypeRO means that the pooler involves only the replicas PoolerTypeRO = PoolerType("ro") // PoolerTypeR means that the pooler involves every instance PoolerTypeR = PoolerType("r") // DefaultPgBouncerPoolerAuthQuery is the default auth_query for PgBouncer DefaultPgBouncerPoolerAuthQuery = "SELECT usename, passwd FROM public.user_search($1)" )
const ( // PgBouncerPoolModeSession the "session" mode PgBouncerPoolModeSession = PgBouncerPoolMode("session") // PgBouncerPoolModeTransaction the "transaction" mode PgBouncerPoolModeTransaction = PgBouncerPoolMode("transaction") )
const DefaultReplicationSlotsHASlotPrefix = "_cnpg_"
DefaultReplicationSlotsHASlotPrefix is the default prefix for names of replication slots used for HA.
const DefaultReplicationSlotsUpdateInterval = 30
DefaultReplicationSlotsUpdateInterval is the default in seconds for the replication slots update interval
const VolumeSnapshotKind = "VolumeSnapshot"
VolumeSnapshotKind this is a strongly typed reference to the kind used by the volumesnapshot package
Variables ¶
var ( // BackupSucceededCondition is added to a backup // when it was completed correctly BackupSucceededCondition = metav1.Condition{ Type: string(ConditionBackup), Status: metav1.ConditionTrue, Reason: string(ConditionReasonLastBackupSucceeded), Message: "Backup was successful", } // BackupStartingCondition is added to a backup // when it started BackupStartingCondition = metav1.Condition{ Type: string(ConditionBackup), Status: metav1.ConditionFalse, Reason: string(ConditionBackupStarted), Message: "New Backup starting up", } // BuildClusterBackupFailedCondition builds // ConditionReasonLastBackupFailed condition BuildClusterBackupFailedCondition = func(err error) metav1.Condition { return metav1.Condition{ Type: string(ConditionBackup), Status: metav1.ConditionFalse, Reason: string(ConditionReasonLastBackupFailed), Message: err.Error(), } } )
A Condition that can be used to communicate the Backup progress
var ( // SchemeGroupVersion is group version used to register these objects SchemeGroupVersion = schema.GroupVersion{Group: "postgresql.cnpg.io", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func ConfigMapKeySelectorToCore ¶
func ConfigMapKeySelectorToCore(selector *ConfigMapKeySelector) *corev1.ConfigMapKeySelector
ConfigMapKeySelectorToCore transforms a ConfigMapKeySelector structure to the analogue one in the corev1 namespace
func GetExternalClustersEnabledPluginNames ¶ added in v1.25.0
func GetExternalClustersEnabledPluginNames(externalClusters []ExternalCluster) (result []string)
GetExternalClustersEnabledPluginNames gets the name of the plugins that are involved in the reconciliation of this external cluster list. This list is usually composed by the plugins that need to be active to recover data from the external clusters.
func GetPluginConfigurationEnabledPluginNames ¶ added in v1.24.2
func GetPluginConfigurationEnabledPluginNames(pluginList []PluginConfiguration) (result []string)
GetPluginConfigurationEnabledPluginNames gets the name of the plugins that are involved in the reconciliation of this cluster
func ListStatusPods ¶ added in v1.23.5
ListStatusPods return a list of active Pods
func SecretKeySelectorToCore ¶
func SecretKeySelectorToCore(selector *SecretKeySelector) *corev1.SecretKeySelector
SecretKeySelectorToCore transforms a SecretKeySelector structure to the analogue one in the corev1 namespace
Types ¶
type AffinityConfiguration ¶
type AffinityConfiguration struct {
// Activates anti-affinity for the pods. The operator will define pods
// anti-affinity unless this field is explicitly set to false
// +optional
EnablePodAntiAffinity *bool `json:"enablePodAntiAffinity,omitempty"`
// TopologyKey to use for anti-affinity configuration. See k8s documentation
// for more info on that
// +optional
TopologyKey string `json:"topologyKey,omitempty"`
// 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/
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// NodeAffinity describes node affinity scheduling rules for the pod.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
// +optional
NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty"`
// 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/
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// 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
// +optional
PodAntiAffinityType string `json:"podAntiAffinityType,omitempty"`
// 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.
// +optional
AdditionalPodAntiAffinity *corev1.PodAntiAffinity `json:"additionalPodAntiAffinity,omitempty"`
// AdditionalPodAffinity allows to specify pod affinity terms to be passed to all the cluster's pods.
// +optional
AdditionalPodAffinity *corev1.PodAffinity `json:"additionalPodAffinity,omitempty"`
}
AffinityConfiguration contains the info we need to create the affinity rules for Pods
func (*AffinityConfiguration) DeepCopy ¶
func (in *AffinityConfiguration) DeepCopy() *AffinityConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AffinityConfiguration.
func (*AffinityConfiguration) DeepCopyInto ¶
func (in *AffinityConfiguration) DeepCopyInto(out *AffinityConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AvailableArchitecture ¶ added in v1.21.4
type AvailableArchitecture struct {
// GoArch is the name of the executable architecture
GoArch string `json:"goArch"`
// Hash is the hash of the executable
Hash string `json:"hash"`
}
AvailableArchitecture represents the state of a cluster's architecture
func (*AvailableArchitecture) DeepCopy ¶ added in v1.21.4
func (in *AvailableArchitecture) DeepCopy() *AvailableArchitecture
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AvailableArchitecture.
func (*AvailableArchitecture) DeepCopyInto ¶ added in v1.21.4
func (in *AvailableArchitecture) DeepCopyInto(out *AvailableArchitecture)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AzureCredentials ¶
type AzureCredentials = barmanApi.AzureCredentials
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 +kubebuilder:object:generate:=false
type Backup ¶
type Backup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// 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
Spec BackupSpec `json:"spec"`
// 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
// +optional
Status BackupStatus `json:"status,omitempty"`
}
A Backup resource is a request for a PostgreSQL backup by the user.
func (*Backup) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup.
func (*Backup) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Backup) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Backup) EnsureGVKIsPresent ¶ added in v1.23.5
func (backup *Backup) EnsureGVKIsPresent()
EnsureGVKIsPresent ensures that the GroupVersionKind (GVK) metadata is present in the Backup object. This is necessary because informers do not automatically include metadata inside the object. By setting the GVK, we ensure that components such as the plugins have enough metadata to typecheck the object.
func (*Backup) GetAssignedInstance ¶ added in v1.21.0
func (backup *Backup) GetAssignedInstance(ctx context.Context, cli client.Client) (*corev1.Pod, error)
GetAssignedInstance fetches the instance that was assigned to the backup execution
func (*Backup) GetMetadata ¶
func (backup *Backup) GetMetadata() *metav1.ObjectMeta
GetMetadata get the metadata
func (*Backup) GetNamespace ¶
GetNamespace get the backup namespace
func (*Backup) GetOnlineOrDefault ¶ added in v1.25.3
GetOnlineOrDefault returns the online value for the backup.
func (*Backup) GetStatus ¶
func (backup *Backup) GetStatus() *BackupStatus
GetStatus gets the backup status
func (*Backup) GetVolumeSnapshotConfiguration ¶ added in v1.21.1
func (backup *Backup) GetVolumeSnapshotConfiguration( clusterConfig VolumeSnapshotConfiguration, ) VolumeSnapshotConfiguration
GetVolumeSnapshotConfiguration overrides the configuration value with the ones specified in the backup, if present.
func (*Backup) GetVolumeSnapshotDeadline ¶ added in v1.25.2
GetVolumeSnapshotDeadline returns the volume snapshot deadline in minutes.
func (*Backup) IsCompletedVolumeSnapshot ¶ added in v1.21.0
IsCompletedVolumeSnapshot checks if a backup is completed using the volume snapshot method. It returns true if the backup's method is BackupMethodVolumeSnapshot and its status phase is BackupPhaseCompleted. Otherwise, it returns false.
type BackupConfiguration ¶
type BackupConfiguration struct {
// VolumeSnapshot provides the configuration for the execution of volume snapshot backups.
// +optional
VolumeSnapshot *VolumeSnapshotConfiguration `json:"volumeSnapshot,omitempty"`
// The configuration for the barman-cloud tool suite
// +optional
BarmanObjectStore *BarmanObjectStoreConfiguration `json:"barmanObjectStore,omitempty"`
// 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.
// +kubebuilder:validation:Pattern=^[1-9][0-9]*[dwm]$
// +optional
RetentionPolicy string `json:"retentionPolicy,omitempty"`
// 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.
// +kubebuilder:validation:Enum=primary;prefer-standby
// +kubebuilder:default:=prefer-standby
// +optional
Target BackupTarget `json:"target,omitempty"`
}
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
func (*BackupConfiguration) DeepCopy ¶
func (in *BackupConfiguration) DeepCopy() *BackupConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfiguration.
func (*BackupConfiguration) DeepCopyInto ¶
func (in *BackupConfiguration) DeepCopyInto(out *BackupConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BackupConfiguration) IsBarmanBackupConfigured ¶ added in v1.15.1
func (backupConfiguration *BackupConfiguration) IsBarmanBackupConfigured() bool
IsBarmanBackupConfigured returns true if one of the possible backup destination is configured, false otherwise
func (*BackupConfiguration) IsBarmanEndpointCASet ¶
func (backupConfiguration *BackupConfiguration) IsBarmanEndpointCASet() bool
IsBarmanEndpointCASet returns true if we have a CA bundle for the endpoint false otherwise
type BackupList ¶
type BackupList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// List of backups
Items []Backup `json:"items"`
}
BackupList contains a list of Backup
func (*BackupList) CanExecuteBackup ¶ added in v1.21.0
func (list *BackupList) CanExecuteBackup(backupName string) bool
CanExecuteBackup control if we can start a reconciliation loop for a certain backup.
A reconciliation loop can start if: - there's no backup running, and if the first of the sorted list of backups - the current backup is running and is the first running backup of the list
As a side effect, this function will sort the backup list
func (*BackupList) DeepCopy ¶
func (in *BackupList) DeepCopy() *BackupList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupList.
func (*BackupList) DeepCopyInto ¶
func (in *BackupList) DeepCopyInto(out *BackupList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BackupList) DeepCopyObject ¶
func (in *BackupList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (BackupList) GetPendingBackupNames ¶ added in v1.21.0
func (list BackupList) GetPendingBackupNames() []string
GetPendingBackupNames returns the pending backup list
func (*BackupList) SortByName ¶ added in v1.21.0
func (list *BackupList) SortByName()
SortByName sorts the backup items in alphabetical order
func (*BackupList) SortByReverseCreationTime ¶ added in v1.21.0
func (list *BackupList) SortByReverseCreationTime()
SortByReverseCreationTime sorts the backup items in reverse creation time (starting from the latest one)
type BackupMethod ¶ added in v1.21.0
type BackupMethod string
BackupMethod defines the way of executing the physical base backups of the selected PostgreSQL instance
const ( // BackupMethodVolumeSnapshot means using the volume snapshot // Kubernetes feature BackupMethodVolumeSnapshot BackupMethod = "volumeSnapshot" // BackupMethodBarmanObjectStore means using barman to backup the // PostgreSQL cluster BackupMethodBarmanObjectStore BackupMethod = "barmanObjectStore" // BackupMethodPlugin means that this backup should be handled by // a plugin BackupMethodPlugin BackupMethod = "plugin" )
func (BackupMethod) IsManagedByInstance ¶ added in v1.27.1
func (b BackupMethod) IsManagedByInstance() bool
IsManagedByInstance returns true if the backup is managed by the instance manager
func (BackupMethod) IsManagedByOperator ¶ added in v1.27.1
func (b BackupMethod) IsManagedByOperator() bool
IsManagedByOperator returns true if the backup is managed by the operator
type BackupPluginConfiguration ¶ added in v1.23.0
type BackupPluginConfiguration struct {
// Name is the name of the plugin managing this backup
Name string `json:"name"`
// Parameters are the configuration parameters passed to the backup
// plugin for this backup
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
}
BackupPluginConfiguration contains the backup configuration used by the backup plugin
func (*BackupPluginConfiguration) DeepCopy ¶ added in v1.23.0
func (in *BackupPluginConfiguration) DeepCopy() *BackupPluginConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupPluginConfiguration.
func (*BackupPluginConfiguration) DeepCopyInto ¶ added in v1.23.0
func (in *BackupPluginConfiguration) DeepCopyInto(out *BackupPluginConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BackupPluginConfiguration) IsEmpty ¶ added in v1.23.0
func (configuration *BackupPluginConfiguration) IsEmpty() bool
IsEmpty checks if the plugin configuration is empty or not
type BackupSnapshotElementStatus ¶ added in v1.21.0
type BackupSnapshotElementStatus struct {
// Name is the snapshot resource name
Name string `json:"name"`
// Type is tho role of the snapshot in the cluster, such as PG_DATA, PG_WAL and PG_TABLESPACE
Type string `json:"type"`
// TablespaceName is the name of the snapshotted tablespace. Only set
// when type is PG_TABLESPACE
// +optional
TablespaceName string `json:"tablespaceName,omitempty"`
}
BackupSnapshotElementStatus is a volume snapshot that is part of a volume snapshot method backup
func (*BackupSnapshotElementStatus) DeepCopy ¶ added in v1.21.0
func (in *BackupSnapshotElementStatus) DeepCopy() *BackupSnapshotElementStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSnapshotElementStatus.
func (*BackupSnapshotElementStatus) DeepCopyInto ¶ added in v1.21.0
func (in *BackupSnapshotElementStatus) DeepCopyInto(out *BackupSnapshotElementStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BackupSnapshotStatus ¶ added in v1.21.0
type BackupSnapshotStatus struct {
// The elements list, populated with the gathered volume snapshots
// +optional
Elements []BackupSnapshotElementStatus `json:"elements,omitempty"`
}
BackupSnapshotStatus the fields exclusive to the volumeSnapshot method backup
func (*BackupSnapshotStatus) DeepCopy ¶ added in v1.21.0
func (in *BackupSnapshotStatus) DeepCopy() *BackupSnapshotStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSnapshotStatus.
func (*BackupSnapshotStatus) DeepCopyInto ¶ added in v1.21.0
func (in *BackupSnapshotStatus) DeepCopyInto(out *BackupSnapshotStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BackupSnapshotStatus) SetSnapshotElements ¶ added in v1.21.0
func (snapshotStatus *BackupSnapshotStatus) SetSnapshotElements(snapshots []volumesnapshotv1.VolumeSnapshot)
SetSnapshotElements sets the Snapshots field from a list of VolumeSnapshot
type BackupSource ¶
type BackupSource struct {
LocalObjectReference `json:",inline"`
// 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.
// +optional
EndpointCA *SecretKeySelector `json:"endpointCA,omitempty"`
}
BackupSource contains the backup we need to restore from, plus some information that could be needed to correctly restore it.
func (*BackupSource) DeepCopy ¶
func (in *BackupSource) DeepCopy() *BackupSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSource.
func (*BackupSource) DeepCopyInto ¶
func (in *BackupSource) DeepCopyInto(out *BackupSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BackupSpec ¶
type BackupSpec struct {
// The cluster to backup
Cluster LocalObjectReference `json:"cluster"`
// 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.
// +optional
// +kubebuilder:validation:Enum=primary;prefer-standby
Target BackupTarget `json:"target,omitempty"`
// The backup method to be used, possible options are `barmanObjectStore`,
// `volumeSnapshot` or `plugin`. Defaults to: `barmanObjectStore`.
// +optional
// +kubebuilder:validation:Enum=barmanObjectStore;volumeSnapshot;plugin
// +kubebuilder:default:=barmanObjectStore
Method BackupMethod `json:"method,omitempty"`
// Configuration parameters passed to the plugin managing this backup
// +optional
PluginConfiguration *BackupPluginConfiguration `json:"pluginConfiguration,omitempty"`
// Whether the default type of backup with volume snapshots is
// online/hot (`true`, default) or offline/cold (`false`)
// Overrides the default setting specified in the cluster field '.spec.backup.volumeSnapshot.online'
// +optional
Online *bool `json:"online,omitempty"`
// Configuration parameters to control the online/hot backup with volume snapshots
// Overrides the default settings specified in the cluster '.backup.volumeSnapshot.onlineConfiguration' stanza
// +optional
OnlineConfiguration *OnlineConfiguration `json:"onlineConfiguration,omitempty"`
}
BackupSpec defines the desired state of Backup +kubebuilder:validation:XValidation:rule="oldSelf == self",message="BackupSpec is immutable once set"
func (*BackupSpec) DeepCopy ¶
func (in *BackupSpec) DeepCopy() *BackupSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec.
func (*BackupSpec) DeepCopyInto ¶
func (in *BackupSpec) DeepCopyInto(out *BackupSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BackupStatus ¶
type BackupStatus struct {
// The potential credentials for each cloud provider
BarmanCredentials `json:",inline"`
// The PostgreSQL major version that was running when the
// backup was taken.
MajorVersion int `json:"majorVersion,omitempty"`
// 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.
// +optional
EndpointCA *SecretKeySelector `json:"endpointCA,omitempty"`
// Endpoint to be used to upload data to the cloud,
// overriding the automatic endpoint discovery
// +optional
EndpointURL string `json:"endpointURL,omitempty"`
// 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.
// +optional
DestinationPath string `json:"destinationPath,omitempty"`
// The server name on S3, the cluster name is used if this
// parameter is omitted
// +optional
ServerName string `json:"serverName,omitempty"`
// Encryption method required to S3 API
// +optional
Encryption string `json:"encryption,omitempty"`
// The ID of the Barman backup
// +optional
BackupID string `json:"backupId,omitempty"`
// The Name of the Barman backup
// +optional
BackupName string `json:"backupName,omitempty"`
// The last backup status
// +optional
Phase BackupPhase `json:"phase,omitempty"`
// When the backup was started
// +optional
StartedAt *metav1.Time `json:"startedAt,omitempty"`
// When the backup was terminated
// +optional
StoppedAt *metav1.Time `json:"stoppedAt,omitempty"`
// The starting WAL
// +optional
BeginWal string `json:"beginWal,omitempty"`
// The ending WAL
// +optional
EndWal string `json:"endWal,omitempty"`
// The starting xlog
// +optional
BeginLSN string `json:"beginLSN,omitempty"`
// The ending xlog
// +optional
EndLSN string `json:"endLSN,omitempty"`
// The detected error
// +optional
Error string `json:"error,omitempty"`
// Unused. Retained for compatibility with old versions.
// +optional
CommandOutput string `json:"commandOutput,omitempty"`
// The backup command output in case of error
// +optional
CommandError string `json:"commandError,omitempty"`
// Backup label file content as returned by Postgres in case of online (hot) backups
// +optional
BackupLabelFile []byte `json:"backupLabelFile,omitempty"`
// Tablespace map file content as returned by Postgres in case of online (hot) backups
// +optional
TablespaceMapFile []byte `json:"tablespaceMapFile,omitempty"`
// Information to identify the instance where the backup has been taken from
// +optional
InstanceID *InstanceID `json:"instanceID,omitempty"`
// Status of the volumeSnapshot backup
// +optional
BackupSnapshotStatus BackupSnapshotStatus `json:"snapshotBackupStatus,omitempty"`
// The backup method being used
// +optional
Method BackupMethod `json:"method,omitempty"`
// Whether the backup was online/hot (`true`) or offline/cold (`false`)
// +optional
Online *bool `json:"online,omitempty"`
// A map containing the plugin metadata
// +optional
PluginMetadata map[string]string `json:"pluginMetadata,omitempty"`
}
BackupStatus defines the observed state of Backup
func (*BackupStatus) DeepCopy ¶
func (in *BackupStatus) DeepCopy() *BackupStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus.
func (*BackupStatus) DeepCopyInto ¶
func (in *BackupStatus) DeepCopyInto(out *BackupStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BackupStatus) GetOnline ¶ added in v1.21.1
func (backupStatus *BackupStatus) GetOnline() bool
GetOnline tells whether this backup was taken while the database was up
func (*BackupStatus) IsDone ¶
func (backupStatus *BackupStatus) IsDone() bool
IsDone check if a backup is completed or still in progress
func (*BackupStatus) IsInProgress ¶
func (backupStatus *BackupStatus) IsInProgress() bool
IsInProgress check if a certain backup is in progress or not
func (*BackupStatus) SetAsCompleted ¶
func (backupStatus *BackupStatus) SetAsCompleted()
SetAsCompleted marks a certain backup as completed
func (*BackupStatus) SetAsFailed ¶
func (backupStatus *BackupStatus) SetAsFailed( err error, )
SetAsFailed marks a certain backup as invalid
func (*BackupStatus) SetAsFinalizing ¶ added in v1.21.1
func (backupStatus *BackupStatus) SetAsFinalizing()
SetAsFinalizing marks a certain backup as finalizing
func (*BackupStatus) SetAsStarted ¶ added in v1.21.0
func (backupStatus *BackupStatus) SetAsStarted(podName, containerID string, method BackupMethod)
SetAsStarted marks a certain backup as started
type BackupTarget ¶ added in v1.19.0
type BackupTarget string
BackupTarget describes the preferred targets for a backup
type BarmanCredentials ¶ added in v1.16.1
type BarmanCredentials = barmanApi.BarmanCredentials
BarmanCredentials an object containing the potential credentials for each cloud provider +kubebuilder:object:generate:=false
type BarmanObjectStoreConfiguration ¶
type BarmanObjectStoreConfiguration = barmanApi.BarmanObjectStoreConfiguration
BarmanObjectStoreConfiguration contains the backup configuration using Barman against an S3-compatible object storage +kubebuilder:object:generate:=false
type BootstrapConfiguration ¶
type BootstrapConfiguration struct {
// Bootstrap the cluster via initdb
// +optional
InitDB *BootstrapInitDB `json:"initdb,omitempty"`
// Bootstrap the cluster from a backup
// +optional
Recovery *BootstrapRecovery `json:"recovery,omitempty"`
// Bootstrap the cluster taking a physical backup of another compatible
// PostgreSQL instance
// +optional
PgBaseBackup *BootstrapPgBaseBackup `json:"pg_basebackup,omitempty"`
}
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.
func (*BootstrapConfiguration) DeepCopy ¶
func (in *BootstrapConfiguration) DeepCopy() *BootstrapConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapConfiguration.
func (*BootstrapConfiguration) DeepCopyInto ¶
func (in *BootstrapConfiguration) DeepCopyInto(out *BootstrapConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BootstrapInitDB ¶
type BootstrapInitDB struct {
// Name of the database used by the application. Default: `app`.
// +optional
Database string `json:"database,omitempty"`
// Name of the owner of the database in the instance to be used
// by applications. Defaults to the value of the `database` key.
// +optional
Owner string `json:"owner,omitempty"`
// 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
// +optional
Secret *LocalObjectReference `json:"secret,omitempty"`
// 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.
// +optional
Options []string `json:"options,omitempty"`
// Whether the `-k` option should be passed to initdb,
// enabling checksums on data pages (default: `false`)
// +optional
DataChecksums *bool `json:"dataChecksums,omitempty"`
// The value to be passed as option `--encoding` for initdb (default:`UTF8`)
// +optional
Encoding string `json:"encoding,omitempty"`
// The value to be passed as option `--lc-collate` for initdb (default:`C`)
// +optional
LocaleCollate string `json:"localeCollate,omitempty"`
// The value to be passed as option `--lc-ctype` for initdb (default:`C`)
// +optional
LocaleCType string `json:"localeCType,omitempty"`
// Sets the default collation order and character classification in the new database.
// +optional
Locale string `json:"locale,omitempty"`
// This option sets the locale provider for databases created in the new cluster.
// Available from PostgreSQL 16.
// +optional
LocaleProvider string `json:"localeProvider,omitempty"`
// Specifies the ICU locale when the ICU provider is used.
// This option requires `localeProvider` to be set to `icu`.
// Available from PostgreSQL 15.
// +optional
IcuLocale string `json:"icuLocale,omitempty"`
// Specifies additional collation rules to customize the behavior of the default collation.
// This option requires `localeProvider` to be set to `icu`.
// Available from PostgreSQL 16.
// +optional
IcuRules string `json:"icuRules,omitempty"`
// Specifies the locale name when the builtin provider is used.
// This option requires `localeProvider` to be set to `builtin`.
// Available from PostgreSQL 17.
// +optional
BuiltinLocale string `json:"builtinLocale,omitempty"`
// The value in megabytes (1 to 1024) to be passed to the `--wal-segsize`
// option for initdb (default: empty, resulting in PostgreSQL default: 16MB)
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=1024
// +optional
WalSegmentSize int `json:"walSegmentSize,omitempty"`
// List of SQL queries to be executed as a superuser in the `postgres`
// database right after the cluster has been created - to be used with extreme care
// (by default empty)
// +optional
PostInitSQL []string `json:"postInitSQL,omitempty"`
// List of SQL queries to be executed as a superuser in the application
// database right after the cluster has been created - to be used with extreme care
// (by default empty)
// +optional
PostInitApplicationSQL []string `json:"postInitApplicationSQL,omitempty"`
// List of SQL queries to be executed as a superuser in the `template1`
// database right after the cluster has been created - to be used with extreme care
// (by default empty)
// +optional
PostInitTemplateSQL []string `json:"postInitTemplateSQL,omitempty"`
// Bootstraps the new cluster by importing data from an existing PostgreSQL
// instance using logical backup (`pg_dump` and `pg_restore`)
// +optional
Import *Import `json:"import,omitempty"`
// List of references to ConfigMaps or Secrets containing SQL files
// to be executed as a superuser in the application database right after
// the cluster has been created. The references are processed in a specific order:
// first, all Secrets are processed, followed by all ConfigMaps.
// Within each group, the processing order follows the sequence specified
// in their respective arrays.
// (by default empty)
// +optional
PostInitApplicationSQLRefs *SQLRefs `json:"postInitApplicationSQLRefs,omitempty"`
// List of references to ConfigMaps or Secrets containing SQL files
// to be executed as a superuser in the `template1` database right after
// the cluster has been created. The references are processed in a specific order:
// first, all Secrets are processed, followed by all ConfigMaps.
// Within each group, the processing order follows the sequence specified
// in their respective arrays.
// (by default empty)
// +optional
PostInitTemplateSQLRefs *SQLRefs `json:"postInitTemplateSQLRefs,omitempty"`
// List of references to ConfigMaps or Secrets containing SQL files
// to be executed as a superuser in the `postgres` database right after
// the cluster has been created. The references are processed in a specific order:
// first, all Secrets are processed, followed by all ConfigMaps.
// Within each group, the processing order follows the sequence specified
// in their respective arrays.
// (by default empty)
// +optional
PostInitSQLRefs *SQLRefs `json:"postInitSQLRefs,omitempty"`
}
BootstrapInitDB is the configuration of the bootstrap process when initdb is used Refer to the Bootstrap page of the documentation for more information. +kubebuilder:validation:XValidation:rule="!has(self.builtinLocale) || self.localeProvider == 'builtin'",message="builtinLocale is only available when localeProvider is set to `builtin`" +kubebuilder:validation:XValidation:rule="!has(self.icuLocale) || self.localeProvider == 'icu'",message="icuLocale is only available when localeProvider is set to `icu`" +kubebuilder:validation:XValidation:rule="!has(self.icuRules) || self.localeProvider == 'icu'",message="icuRules is only available when localeProvider is set to `icu`"
func (*BootstrapInitDB) DeepCopy ¶
func (in *BootstrapInitDB) DeepCopy() *BootstrapInitDB
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapInitDB.
func (*BootstrapInitDB) DeepCopyInto ¶
func (in *BootstrapInitDB) DeepCopyInto(out *BootstrapInitDB)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BootstrapPgBaseBackup ¶
type BootstrapPgBaseBackup struct {
// The name of the server of which we need to take a physical backup
// +kubebuilder:validation:MinLength=1
Source string `json:"source"`
// Name of the database used by the application. Default: `app`.
// +optional
Database string `json:"database,omitempty"`
// Name of the owner of the database in the instance to be used
// by applications. Defaults to the value of the `database` key.
// +optional
Owner string `json:"owner,omitempty"`
// 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
// +optional
Secret *LocalObjectReference `json:"secret,omitempty"`
}
BootstrapPgBaseBackup contains the configuration required to take a physical backup of an existing PostgreSQL cluster
func (*BootstrapPgBaseBackup) DeepCopy ¶
func (in *BootstrapPgBaseBackup) DeepCopy() *BootstrapPgBaseBackup
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapPgBaseBackup.
func (*BootstrapPgBaseBackup) DeepCopyInto ¶
func (in *BootstrapPgBaseBackup) DeepCopyInto(out *BootstrapPgBaseBackup)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BootstrapRecovery ¶
type BootstrapRecovery struct {
// The backup object containing the physical base backup from which to
// initiate the recovery procedure.
// Mutually exclusive with `source` and `volumeSnapshots`.
// +optional
Backup *BackupSource `json:"backup,omitempty"`
// 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`.
// +optional
Source string `json:"source,omitempty"`
// 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`.
// +optional
VolumeSnapshots *DataSource `json:"volumeSnapshots,omitempty"`
// 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
// +optional
RecoveryTarget *RecoveryTarget `json:"recoveryTarget,omitempty"`
// Name of the database used by the application. Default: `app`.
// +optional
Database string `json:"database,omitempty"`
// Name of the owner of the database in the instance to be used
// by applications. Defaults to the value of the `database` key.
// +optional
Owner string `json:"owner,omitempty"`
// 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
// +optional
Secret *LocalObjectReference `json:"secret,omitempty"`
}
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.
func (*BootstrapRecovery) DeepCopy ¶
func (in *BootstrapRecovery) DeepCopy() *BootstrapRecovery
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapRecovery.
func (*BootstrapRecovery) DeepCopyInto ¶
func (in *BootstrapRecovery) DeepCopyInto(out *BootstrapRecovery)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CatalogImage ¶ added in v1.23.0
type CatalogImage struct {
// The image reference
Image string `json:"image"`
// +kubebuilder:validation:Minimum=10
// The PostgreSQL major version of the image. Must be unique within the catalog.
Major int `json:"major"`
}
CatalogImage defines the image and major version
func (*CatalogImage) DeepCopy ¶ added in v1.23.0
func (in *CatalogImage) DeepCopy() *CatalogImage
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogImage.
func (*CatalogImage) DeepCopyInto ¶ added in v1.23.0
func (in *CatalogImage) DeepCopyInto(out *CatalogImage)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CertificatesConfiguration ¶
type CertificatesConfiguration struct {
// 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.<br />
// <br />
// Contains:<br />
// <br />
// - `ca.crt`: CA that should be used to validate the server certificate,
// used as `sslrootcert` in client connection strings.<br />
// - `ca.key`: key used to generate Server SSL certs, if ServerTLSSecret is provided,
// this can be omitted.<br />
// +optional
ServerCASecret string `json:"serverCASecret,omitempty"`
// 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.
// +optional
ServerTLSSecret string `json:"serverTLSSecret,omitempty"`
// 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.
// +optional
ReplicationTLSSecret string `json:"replicationTLSSecret,omitempty"`
// 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.<br />
// <br />
// Contains:<br />
// <br />
// - `ca.crt`: CA that should be used to validate the client certificates,
// used as `ssl_ca_file` of all the instances.<br />
// - `ca.key`: key used to generate client certificates, if ReplicationTLSSecret is provided,
// this can be omitted.<br />
// +optional
ClientCASecret string `json:"clientCASecret,omitempty"`
// The list of the server alternative DNS names to be added to the generated server TLS certificates, when required.
// +optional
ServerAltDNSNames []string `json:"serverAltDNSNames,omitempty"`
}
CertificatesConfiguration contains the needed configurations to handle server certificates.
func (*CertificatesConfiguration) DeepCopy ¶
func (in *CertificatesConfiguration) DeepCopy() *CertificatesConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificatesConfiguration.
func (*CertificatesConfiguration) DeepCopyInto ¶
func (in *CertificatesConfiguration) DeepCopyInto(out *CertificatesConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CertificatesStatus ¶
type CertificatesStatus struct {
// Needed configurations to handle server certificates, initialized with default values, if needed.
CertificatesConfiguration `json:",inline"`
// Expiration dates for all certificates.
// +optional
Expirations map[string]string `json:"expirations,omitempty"`
}
CertificatesStatus contains configuration certificates and related expiration dates.
func (*CertificatesStatus) DeepCopy ¶
func (in *CertificatesStatus) DeepCopy() *CertificatesStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificatesStatus.
func (*CertificatesStatus) DeepCopyInto ¶
func (in *CertificatesStatus) DeepCopyInto(out *CertificatesStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Cluster ¶
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// 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
Spec ClusterSpec `json:"spec"`
// 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
// +optional
Status ClusterStatus `json:"status,omitempty"`
}
Cluster defines the API schema for a highly available PostgreSQL database cluster managed by CloudNativePG.
func (*Cluster) ContainsManagedRolesConfiguration ¶ added in v1.20.0
ContainsManagedRolesConfiguration returns true iff there are managed roles configured
func (*Cluster) ContainsTablespaces ¶ added in v1.22.0
ContainsTablespaces returns true if for this cluster, we need to create tablespaces
func (*Cluster) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (*Cluster) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Cluster) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Cluster) Default ¶
func (r *Cluster) Default()
Default apply the defaults to undefined values in a Cluster preserving the user settings
func (*Cluster) EnsureGVKIsPresent ¶ added in v1.25.0
func (cluster *Cluster) EnsureGVKIsPresent()
EnsureGVKIsPresent ensures that the GroupVersionKind (GVK) metadata is present in the Backup object. This is necessary because informers do not automatically include metadata inside the object. By setting the GVK, we ensure that components such as the plugins have enough metadata to typecheck the object.
func (Cluster) ExternalCluster ¶
func (cluster Cluster) ExternalCluster(name string) (ExternalCluster, bool)
ExternalCluster gets the external server with a known name, returning true if the server was found and false otherwise
func (*Cluster) GetApplicationDatabaseName ¶ added in v1.16.0
GetApplicationDatabaseName get the name of the application database for a specific bootstrap
func (*Cluster) GetApplicationDatabaseOwner ¶ added in v1.16.0
GetApplicationDatabaseOwner get the owner user of the application database for a specific bootstrap
func (*Cluster) GetApplicationSecretName ¶
GetApplicationSecretName get the name of the application secret for any bootstrap type
func (Cluster) GetBarmanEndpointCAForReplicaCluster ¶
func (cluster Cluster) GetBarmanEndpointCAForReplicaCluster() *SecretKeySelector
GetBarmanEndpointCAForReplicaCluster checks if this is a replica cluster which needs barman endpoint CA
func (*Cluster) GetClientCASecretName ¶
GetClientCASecretName get the name of the secret containing the CA of the cluster
func (*Cluster) GetClusterAltDNSNames ¶
GetClusterAltDNSNames returns all the names needed to build a valid Server Certificate
func (*Cluster) GetCoredumpFilter ¶ added in v1.19.5
GetCoredumpFilter get the coredump filter value from the cluster annotation
func (*Cluster) GetEnableLDAPAuth ¶
GetEnableLDAPAuth return true if bind or bind+search method are configured in the cluster configuration
func (*Cluster) GetEnablePDB ¶ added in v1.23.0
GetEnablePDB get the cluster EnablePDB value, defaults to true
func (*Cluster) GetEnableSuperuserAccess ¶
GetEnableSuperuserAccess returns if the superuser access is enabled or not
func (*Cluster) GetEnabledWALArchivePluginName ¶ added in v1.24.3
GetEnabledWALArchivePluginName returns the name of the enabled backup plugin or an empty string if no backup plugin is enabled
func (*Cluster) GetExternalClusterSecrets ¶ added in v1.20.5
GetExternalClusterSecrets returns the secrets used by external Clusters
func (*Cluster) GetFixedInheritedAnnotations ¶
GetFixedInheritedAnnotations gets the annotations that should be inherited by all resources according to the cluster spec and the operator version
func (*Cluster) GetFixedInheritedLabels ¶
GetFixedInheritedLabels gets the labels that should be inherited by all resources according the cluster spec
func (*Cluster) GetImagePullSecret ¶
GetImagePullSecret get the name of the pull secret to use to download the PostgreSQL image
func (*Cluster) GetInstanceEnabledPluginNames ¶ added in v1.27.0
GetInstanceEnabledPluginNames gets the name of the plugins that are available to the instance container
func (*Cluster) GetJobEnabledPluginNames ¶ added in v1.27.0
GetJobEnabledPluginNames gets the name of the plugins that are available to the job container
func (*Cluster) GetLDAPSecretName ¶
GetLDAPSecretName gets the secret name containing the LDAP password
func (*Cluster) GetMaxStartDelay ¶
GetMaxStartDelay get the amount of time of startDelay config option
func (*Cluster) GetMaxStopDelay ¶
GetMaxStopDelay get the amount of time PostgreSQL has to stop
func (*Cluster) GetMaxSwitchoverDelay ¶
GetMaxSwitchoverDelay get the amount of time PostgreSQL has to stop before switchover
func (*Cluster) GetPgCtlTimeoutForPromotion ¶
GetPgCtlTimeoutForPromotion returns the timeout that should be waited for an instance to be promoted to primary. As default, DefaultPgCtlTimeoutForPromotion is big enough to simulate an infinite timeout
func (Cluster) GetPostgresGID ¶
GetPostgresGID returns the GID that is being used for the "postgres" user
func (Cluster) GetPostgresUID ¶
GetPostgresUID returns the UID that is being used for the "postgres" user
func (*Cluster) GetPostgresqlMajorVersion ¶ added in v1.23.0
GetPostgresqlMajorVersion gets the PostgreSQL image major version detecting it from the image name or from the ImageCatalogRef.
func (*Cluster) GetPrimaryUpdateMethod ¶
func (cluster *Cluster) GetPrimaryUpdateMethod() PrimaryUpdateMethod
GetPrimaryUpdateMethod get the cluster primary update method, defaulting to restart
func (*Cluster) GetPrimaryUpdateStrategy ¶
func (cluster *Cluster) GetPrimaryUpdateStrategy() PrimaryUpdateStrategy
GetPrimaryUpdateStrategy get the cluster primary update strategy, defaulting to unsupervised
func (*Cluster) GetRecoverySourcePlugin ¶ added in v1.25.0
func (cluster *Cluster) GetRecoverySourcePlugin() *PluginConfiguration
GetRecoverySourcePlugin returns the configuration of the plugin being the recovery source of the cluster. If no such plugin have been configured, nil is returned
func (*Cluster) GetReplicationSecretName ¶
GetReplicationSecretName get the name of the secret for the replication user
func (*Cluster) GetRestartTimeout ¶ added in v1.21.6
GetRestartTimeout is used to have a timeout for operations that involve a restart of a PostgreSQL instance
func (*Cluster) GetSeccompProfile ¶ added in v1.18.4
func (cluster *Cluster) GetSeccompProfile() *corev1.SeccompProfile
GetSeccompProfile return the proper SeccompProfile set in the cluster for Pods and Containers
func (*Cluster) GetServerCASecretName ¶
GetServerCASecretName get the name of the secret containing the CA of the cluster
func (*Cluster) GetServerCASecretObjectKey ¶ added in v1.24.0
func (cluster *Cluster) GetServerCASecretObjectKey() types.NamespacedName
GetServerCASecretObjectKey returns a types.NamespacedName pointing to the secret
func (*Cluster) GetServerTLSSecretName ¶
GetServerTLSSecretName get the name of the secret containing the certificate that is used for the PostgreSQL servers
func (*Cluster) GetServiceAnyName ¶
GetServiceAnyName return the name of the service that is used as DNS domain for all the nodes, even if they are not ready
func (*Cluster) GetServiceReadName ¶
GetServiceReadName return the default name of the service that is used for read transactions (including the primary)
func (*Cluster) GetServiceReadOnlyName ¶
GetServiceReadOnlyName return the default name of the service that is used for read-only transactions (excluding the primary)
func (*Cluster) GetServiceReadWriteName ¶
GetServiceReadWriteName return the default name of the service that is used for read-write transactions
func (Cluster) GetSlotNameFromInstanceName ¶ added in v1.18.0
GetSlotNameFromInstanceName returns the slot name, given the instance name. It returns an empty string if High Availability Replication Slots are disabled
func (*Cluster) GetSmartShutdownTimeout ¶ added in v1.21.0
GetSmartShutdownTimeout is used to ensure that smart shutdown timeout is a positive integer
func (*Cluster) GetSuperuserSecretName ¶
GetSuperuserSecretName get the secret name of the PostgreSQL superuser
func (*Cluster) GetTablespaceConfiguration ¶ added in v1.22.0
func (cluster *Cluster) GetTablespaceConfiguration(name string) *TablespaceConfiguration
GetTablespaceConfiguration returns the tablespaceConfiguration for the given name otherwise return nil
func (*Cluster) IsFailoverQuorumActive ¶ added in v1.27.0
IsFailoverQuorumActive check if we should enable the quorum failover protection alpha-feature.
func (*Cluster) IsInplaceRestartPhase ¶ added in v1.19.5
IsInplaceRestartPhase returns true if the cluster is in a phase that handles the Inplace restart
func (*Cluster) IsInstanceFenced ¶
IsInstanceFenced check if in a given instance should be fenced
func (*Cluster) IsMetricsTLSEnabled ¶ added in v1.24.0
IsMetricsTLSEnabled checks if the metrics endpoint should use TLS
func (*Cluster) IsNodeMaintenanceWindowInProgress ¶
IsNodeMaintenanceWindowInProgress check if the upgrade mode is active or not
func (*Cluster) IsPodMonitorEnabled ¶
IsPodMonitorEnabled checks if the PodMonitor object needs to be created
func (*Cluster) IsReadOnlyServiceEnabled ¶ added in v1.24.0
IsReadOnlyServiceEnabled checks if the read-only service is enabled for the cluster. It returns false if the read-only service is listed in the DisabledDefaultServices slice.
func (*Cluster) IsReadServiceEnabled ¶ added in v1.24.0
IsReadServiceEnabled checks if the read service is enabled for the cluster. It returns false if the read service is listed in the DisabledDefaultServices slice.
func (*Cluster) IsReadWriteServiceEnabled ¶ added in v1.24.0
IsReadWriteServiceEnabled checks if the read-write service is enabled for the cluster. It returns false if the read-write service is listed in the DisabledDefaultServices slice.
func (*Cluster) IsReusePVCEnabled ¶
IsReusePVCEnabled check if in a maintenance window we should reuse PVCs
func (*Cluster) LogTimestampsWithMessage ¶ added in v1.15.3
LogTimestampsWithMessage prints useful information about timestamps in stdout
func (*Cluster) SetDefaults ¶
func (r *Cluster) SetDefaults()
SetDefaults apply the defaults to undefined values in a Cluster
func (*Cluster) SetInContext ¶ added in v1.23.0
SetInContext records the cluster in the given context
func (*Cluster) SetInheritedData ¶ added in v1.19.4
func (cluster *Cluster) SetInheritedData(obj *metav1.ObjectMeta)
SetInheritedData sets all the needed annotations and labels
func (*Cluster) SetInheritedDataAndOwnership ¶ added in v1.17.4
func (cluster *Cluster) SetInheritedDataAndOwnership(obj *metav1.ObjectMeta)
SetInheritedDataAndOwnership sets the cluster as owner of the passed object and then sets all the needed annotations and labels
func (*Cluster) ShouldCreateApplicationDatabase ¶
ShouldCreateApplicationDatabase returns true if for this cluster, during the bootstrap phase, we need to create an application database
func (*Cluster) ShouldCreateApplicationSecret ¶ added in v1.16.0
ShouldCreateApplicationSecret returns true if for this cluster, during the bootstrap phase, we need to create a secret to store application credentials
func (*Cluster) ShouldCreateProjectedVolume ¶ added in v1.18.2
ShouldCreateProjectedVolume returns whether we should create the projected all in one volume
func (*Cluster) ShouldCreateWalArchiveVolume ¶ added in v1.17.0
ShouldCreateWalArchiveVolume returns whether we should create the wal archive volume
func (*Cluster) ShouldForceLegacyBackup ¶ added in v1.18.3
ShouldForceLegacyBackup if present takes a backup without passing the name argument even on barman version 3.3.0+. This is needed to test both backup system in the E2E suite
func (*Cluster) ShouldInitDBCreateApplicationDatabase ¶ added in v1.16.0
ShouldInitDBCreateApplicationDatabase returns true if the application database needs to be created during initdb job
func (*Cluster) ShouldInitDBCreateApplicationSecret ¶ added in v1.16.0
ShouldInitDBCreateApplicationSecret returns true if for this cluster, during the bootstrap phase using initDB, we need to create an new application secret
func (*Cluster) ShouldInitDBRunPostInitApplicationSQLRefs ¶ added in v1.17.0
ShouldInitDBRunPostInitApplicationSQLRefs returns true if for this cluster, during the bootstrap phase using initDB, we need to run post init SQL files for the application database from provided references.
func (*Cluster) ShouldInitDBRunPostInitSQLRefs ¶ added in v1.24.0
ShouldInitDBRunPostInitSQLRefs returns true if for this cluster, during the bootstrap phase using initDB, we need to run post init SQL files for the `postgres` database from provided references.
func (*Cluster) ShouldInitDBRunPostInitTemplateSQLRefs ¶ added in v1.24.0
ShouldInitDBRunPostInitTemplateSQLRefs returns true if for this cluster, during the bootstrap phase using initDB, we need to run post init SQL files for the `template1` database from provided references.
func (*Cluster) ShouldPgBaseBackupCreateApplicationDatabase ¶ added in v1.16.0
ShouldPgBaseBackupCreateApplicationDatabase returns true if the application database needs to be created during the pg_basebackup job
func (*Cluster) ShouldPgBaseBackupCreateApplicationSecret ¶ added in v1.16.0
ShouldPgBaseBackupCreateApplicationSecret returns true if for this cluster, during the bootstrap phase using pg_basebackup, we need to create an application secret
func (*Cluster) ShouldPromoteFromReplicaCluster ¶ added in v1.24.0
ShouldPromoteFromReplicaCluster returns true if the cluster should promote
func (*Cluster) ShouldRecoveryCreateApplicationDatabase ¶ added in v1.16.0
ShouldRecoveryCreateApplicationDatabase returns true if the application database needs to be created during the recovery job
func (*Cluster) ShouldRecoveryCreateApplicationSecret ¶ added in v1.16.0
ShouldRecoveryCreateApplicationSecret returns true if for this cluster, during the bootstrap phase using recovery, we need to create an application secret
func (*Cluster) ShouldResizeInUseVolumes ¶
ShouldResizeInUseVolumes is true when we should resize PVC we already created
func (*Cluster) UpdateBackupTimes ¶ added in v1.21.2
func (cluster *Cluster) UpdateBackupTimes( backupMethod BackupMethod, firstRecoverabilityPoint *time.Time, lastSuccessfulBackup *time.Time, )
UpdateBackupTimes sets the firstRecoverabilityPoint and lastSuccessfulBackup for the provided method, as well as the overall firstRecoverabilityPoint and lastSuccessfulBackup for the cluster
func (*Cluster) UsesConfigMap ¶
UsesConfigMap checks whether a given secret is used by a Cluster
func (*Cluster) UsesSecret ¶
UsesSecret checks whether a given secret is used by a Cluster.
This function is also used to discover the set of clusters that should be reconciled when a certain secret changes.
func (*Cluster) UsesSecretInManagedRoles ¶ added in v1.20.0
UsesSecretInManagedRoles checks if the given secret name is used in a managed role
type ClusterConditionType ¶
type ClusterConditionType string
ClusterConditionType defines types of cluster conditions
const ( // ConditionContinuousArchiving represents whether WAL archiving is working ConditionContinuousArchiving ClusterConditionType = "ContinuousArchiving" // ConditionBackup represents the last backup's status ConditionBackup ClusterConditionType = "LastBackupSucceeded" // ConditionClusterReady represents whether a cluster is Ready ConditionClusterReady ClusterConditionType = "Ready" // ConditionConsistentSystemID is true when the all the instances of the // cluster report the same System ID. ConditionConsistentSystemID ClusterConditionType = "ConsistentSystemID" )
These are valid conditions of a Cluster, some of the conditions could be owned by Instance Manager and some of them could be owned by reconciler.
type ClusterImageCatalog ¶ added in v1.23.0
type ClusterImageCatalog struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// Specification of the desired behavior of the ClusterImageCatalog.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec ImageCatalogSpec `json:"spec"`
}
ClusterImageCatalog is the Schema for the clusterimagecatalogs API
func (*ClusterImageCatalog) DeepCopy ¶ added in v1.23.0
func (in *ClusterImageCatalog) DeepCopy() *ClusterImageCatalog
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImageCatalog.
func (*ClusterImageCatalog) DeepCopyInto ¶ added in v1.23.0
func (in *ClusterImageCatalog) DeepCopyInto(out *ClusterImageCatalog)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterImageCatalog) DeepCopyObject ¶ added in v1.23.0
func (in *ClusterImageCatalog) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterImageCatalog) GetSpec ¶ added in v1.23.0
func (c *ClusterImageCatalog) GetSpec() *ImageCatalogSpec
GetSpec returns the Spec of the ClusterImageCatalog
type ClusterImageCatalogList ¶ added in v1.23.0
type ClusterImageCatalogList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metav1.ListMeta `json:"metadata"`
// List of ClusterImageCatalogs
Items []ClusterImageCatalog `json:"items"`
}
ClusterImageCatalogList contains a list of ClusterImageCatalog
func (*ClusterImageCatalogList) DeepCopy ¶ added in v1.23.0
func (in *ClusterImageCatalogList) DeepCopy() *ClusterImageCatalogList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImageCatalogList.
func (*ClusterImageCatalogList) DeepCopyInto ¶ added in v1.23.0
func (in *ClusterImageCatalogList) DeepCopyInto(out *ClusterImageCatalogList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterImageCatalogList) DeepCopyObject ¶ added in v1.23.0
func (in *ClusterImageCatalogList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterList ¶
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// List of clusters
Items []Cluster `json:"items"`
}
ClusterList contains a list of Cluster
func (*ClusterList) DeepCopy ¶
func (in *ClusterList) DeepCopy() *ClusterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
func (*ClusterList) DeepCopyInto ¶
func (in *ClusterList) DeepCopyInto(out *ClusterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterList) DeepCopyObject ¶
func (in *ClusterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterMonitoringTLSConfiguration ¶ added in v1.24.0
type ClusterMonitoringTLSConfiguration struct {
// Enable TLS for the monitoring endpoint.
// Changing this option will force a rollout of all instances.
// +kubebuilder:default:=false
// +optional
Enabled bool `json:"enabled,omitempty"`
}
ClusterMonitoringTLSConfiguration is the type containing the TLS configuration for the cluster's monitoring
func (*ClusterMonitoringTLSConfiguration) DeepCopy ¶ added in v1.24.0
func (in *ClusterMonitoringTLSConfiguration) DeepCopy() *ClusterMonitoringTLSConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterMonitoringTLSConfiguration.
func (*ClusterMonitoringTLSConfiguration) DeepCopyInto ¶ added in v1.24.0
func (in *ClusterMonitoringTLSConfiguration) DeepCopyInto(out *ClusterMonitoringTLSConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterSpec ¶
type ClusterSpec struct {
// Description of this PostgreSQL cluster
// +optional
Description string `json:"description,omitempty"`
// Metadata that will be inherited by all objects related to the Cluster
// +optional
InheritedMetadata *EmbeddedObjectMetadata `json:"inheritedMetadata,omitempty"`
// Name of the container image, supporting both tags (`<image>:<tag>`)
// and digests for deterministic and repeatable deployments
// (`<image>:<tag>@sha256:<digestValue>`)
// +optional
ImageName string `json:"imageName,omitempty"`
// Defines the major PostgreSQL version we want to use within an ImageCatalog
// +optional
ImageCatalogRef *ImageCatalogRef `json:"imageCatalogRef,omitempty"`
// 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
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// 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/
// +optional
SchedulerName string `json:"schedulerName,omitempty"`
// The UID of the `postgres` user inside the image, defaults to `26`
// +kubebuilder:default:=26
// +optional
PostgresUID int64 `json:"postgresUID,omitempty"`
// The GID of the `postgres` user inside the image, defaults to `26`
// +kubebuilder:default:=26
// +optional
PostgresGID int64 `json:"postgresGID,omitempty"`
// Number of instances required in the cluster
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default:=1
Instances int `json:"instances"`
// Minimum number of instances required in synchronous replication with the
// primary. Undefined or 0 allow writes to complete when no standby is
// available.
// +kubebuilder:default:=0
// +kubebuilder:validation:Minimum=0
// +optional
MinSyncReplicas int `json:"minSyncReplicas,omitempty"`
// 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.
// +kubebuilder:default:=0
// +kubebuilder:validation:Minimum=0
// +optional
MaxSyncReplicas int `json:"maxSyncReplicas,omitempty"`
// Configuration of the PostgreSQL server
// +optional
PostgresConfiguration PostgresConfiguration `json:"postgresql,omitempty"`
// Replication slots management configuration
// +kubebuilder:default:={"highAvailability":{"enabled":true}}
// +optional
ReplicationSlots *ReplicationSlotsConfiguration `json:"replicationSlots,omitempty"`
// Instructions to bootstrap this cluster
// +optional
Bootstrap *BootstrapConfiguration `json:"bootstrap,omitempty"`
// Replica cluster configuration
// +optional
ReplicaCluster *ReplicaClusterConfiguration `json:"replica,omitempty"`
// The secret containing the superuser password. If not defined a new
// secret will be created with a randomly generated password
// +optional
SuperuserSecret *LocalObjectReference `json:"superuserSecret,omitempty"`
// 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.
// +kubebuilder:default:=false
// +optional
EnableSuperuserAccess *bool `json:"enableSuperuserAccess,omitempty"`
// The configuration for the CA and related certificates
// +optional
Certificates *CertificatesConfiguration `json:"certificates,omitempty"`
// The list of pull secrets to be used to pull the images
// +optional
ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"`
// Configuration of the storage of the instances
// +optional
StorageConfiguration StorageConfiguration `json:"storage,omitempty"`
// Configure the generation of the service account
// +optional
ServiceAccountTemplate *ServiceAccountTemplate `json:"serviceAccountTemplate,omitempty"`
// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
// +optional
WalStorage *StorageConfiguration `json:"walStorage,omitempty"`
// EphemeralVolumeSource allows the user to configure the source of ephemeral volumes.
// +optional
EphemeralVolumeSource *corev1.EphemeralVolumeSource `json:"ephemeralVolumeSource,omitempty"`
// 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).
// +kubebuilder:default:=3600
// +optional
MaxStartDelay int32 `json:"startDelay,omitempty"`
// The time in seconds that is allowed for a PostgreSQL instance to
// gracefully shutdown (default 1800)
// +kubebuilder:default:=1800
// +optional
MaxStopDelay int32 `json:"stopDelay,omitempty"`
// 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`). Default is 180 seconds.
// +kubebuilder:default:=180
// +optional
SmartShutdownTimeout *int32 `json:"smartShutdownTimeout,omitempty"`
// 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).
// +kubebuilder:default:=3600
// +optional
MaxSwitchoverDelay int32 `json:"switchoverDelay,omitempty"`
// 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
// +kubebuilder:default:=0
// +optional
FailoverDelay int32 `json:"failoverDelay,omitempty"`
// LivenessProbeTimeout is the time (in seconds) that is allowed for a PostgreSQL instance
// to successfully respond to the liveness probe (default 30).
// The Liveness probe failure threshold is derived from this value using the formula:
// ceiling(livenessProbe / 10).
// +optional
LivenessProbeTimeout *int32 `json:"livenessProbeTimeout,omitempty"`
// Affinity/Anti-affinity rules for Pods
// +optional
Affinity AffinityConfiguration `json:"affinity,omitempty"`
// TopologySpreadConstraints specifies how to spread matching pods among the given topology.
// More info:
// https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
// +optional
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// Resources requirements of every generated Pod. Please refer to
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// for more information.
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// EphemeralVolumesSizeLimit allows the user to set the limits for the ephemeral
// volumes
// +optional
EphemeralVolumesSizeLimit *EphemeralVolumesSizeLimitConfiguration `json:"ephemeralVolumesSizeLimit,omitempty"`
// 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
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`
// 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`)
// +kubebuilder:default:=unsupervised
// +kubebuilder:validation:Enum:=unsupervised;supervised
// +optional
PrimaryUpdateStrategy PrimaryUpdateStrategy `json:"primaryUpdateStrategy,omitempty"`
// 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)
// +kubebuilder:default:=restart
// +kubebuilder:validation:Enum:=switchover;restart
// +optional
PrimaryUpdateMethod PrimaryUpdateMethod `json:"primaryUpdateMethod,omitempty"`
// The configuration to be used for backups
// +optional
Backup *BackupConfiguration `json:"backup,omitempty"`
// Define a maintenance window for the Kubernetes nodes
// +optional
NodeMaintenanceWindow *NodeMaintenanceWindow `json:"nodeMaintenanceWindow,omitempty"`
// The configuration of the monitoring infrastructure of this cluster
// +optional
Monitoring *MonitoringConfiguration `json:"monitoring,omitempty"`
// The list of external clusters which are used in the configuration
// +optional
ExternalClusters []ExternalCluster `json:"externalClusters,omitempty"`
// The instances' log level, one of the following values: error, warning, info (default), debug, trace
// +kubebuilder:default:=info
// +kubebuilder:validation:Enum:=error;warning;info;debug;trace
// +optional
LogLevel string `json:"logLevel,omitempty"`
// Template to be used to define projected volumes, projected volumes will be mounted
// under `/projected` base folder
// +optional
ProjectedVolumeTemplate *corev1.ProjectedVolumeSource `json:"projectedVolumeTemplate,omitempty"`
// Env follows the Env format to pass environment variables
// to the pods created in the cluster
// +optional
// +patchMergeKey=name
// +patchStrategy=merge
Env []corev1.EnvVar `json:"env,omitempty"`
// EnvFrom follows the EnvFrom format to pass environment variables
// sources to the pods to be used by Env
// +optional
EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
// The configuration that is used by the portions of PostgreSQL that are managed by the instance manager
// +optional
Managed *ManagedConfiguration `json:"managed,omitempty"`
// The SeccompProfile applied to every Pod and Container.
// Defaults to: `RuntimeDefault`
// +optional
SeccompProfile *corev1.SeccompProfile `json:"seccompProfile,omitempty"`
// The tablespaces configuration
// +optional
Tablespaces []TablespaceConfiguration `json:"tablespaces,omitempty"`
// Manage the `PodDisruptionBudget` resources within the cluster. When
// configured as `true` (default setting), the pod disruption budgets
// will safeguard the primary node from being terminated. Conversely,
// setting it to `false` will result in the absence of any
// `PodDisruptionBudget` resource, permitting the shutdown of all nodes
// hosting the PostgreSQL cluster. This latter configuration is
// advisable for any PostgreSQL cluster employed for
// development/staging purposes.
// +kubebuilder:default:=true
// +optional
EnablePDB *bool `json:"enablePDB,omitempty"`
// The plugins configuration, containing
// any plugin to be loaded with the corresponding configuration
// +optional
Plugins []PluginConfiguration `json:"plugins,omitempty"`
// The configuration of the probes to be injected
// in the PostgreSQL Pods.
// +optional
Probes *ProbesConfiguration `json:"probes,omitempty"`
}
ClusterSpec defines the desired state of a PostgreSQL cluster managed by CloudNativePG.
func (*ClusterSpec) DeepCopy ¶
func (in *ClusterSpec) DeepCopy() *ClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (*ClusterSpec) DeepCopyInto ¶
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterStatus ¶
type ClusterStatus struct {
// The total number of PVC Groups detected in the cluster. It may differ from the number of existing instance pods.
// +optional
Instances int `json:"instances,omitempty"`
// The total number of ready instances in the cluster. It is equal to the number of ready instance pods.
// +optional
ReadyInstances int `json:"readyInstances,omitempty"`
// InstancesStatus indicates in which status the instances are
// +optional
InstancesStatus map[PodStatus][]string `json:"instancesStatus,omitempty"`
// The reported state of the instances during the last reconciliation loop
// +optional
InstancesReportedState map[PodName]InstanceReportedState `json:"instancesReportedState,omitempty"`
// ManagedRolesStatus reports the state of the managed roles in the cluster
// +optional
ManagedRolesStatus ManagedRoles `json:"managedRolesStatus,omitempty"`
// TablespacesStatus reports the state of the declarative tablespaces in the cluster
// +optional
TablespacesStatus []TablespaceState `json:"tablespacesStatus,omitempty"`
// The timeline of the Postgres cluster
// +optional
TimelineID int `json:"timelineID,omitempty"`
// Instances topology.
// +optional
Topology Topology `json:"topology,omitempty"`
// ID of the latest generated node (used to avoid node name clashing)
// +optional
LatestGeneratedNode int `json:"latestGeneratedNode,omitempty"`
// Current primary instance
// +optional
CurrentPrimary string `json:"currentPrimary,omitempty"`
// Target primary instance, this is different from the previous one
// during a switchover or a failover
// +optional
TargetPrimary string `json:"targetPrimary,omitempty"`
// LastPromotionToken is the last verified promotion token that
// was used to promote a replica cluster
// +optional
LastPromotionToken string `json:"lastPromotionToken,omitempty"`
// How many PVCs have been created by this cluster
// +optional
PVCCount int32 `json:"pvcCount,omitempty"`
// How many Jobs have been created by this cluster
// +optional
JobCount int32 `json:"jobCount,omitempty"`
// List of all the PVCs created by this cluster and still available
// which are not attached to a Pod
// +optional
DanglingPVC []string `json:"danglingPVC,omitempty"`
// List of all the PVCs that have ResizingPVC condition.
// +optional
ResizingPVC []string `json:"resizingPVC,omitempty"`
// List of all the PVCs that are being initialized by this cluster
// +optional
InitializingPVC []string `json:"initializingPVC,omitempty"`
// List of all the PVCs not dangling nor initializing
// +optional
HealthyPVC []string `json:"healthyPVC,omitempty"`
// List of all the PVCs that are unusable because another PVC is missing
// +optional
UnusablePVC []string `json:"unusablePVC,omitempty"`
// Current write pod
// +optional
WriteService string `json:"writeService,omitempty"`
// Current list of read pods
// +optional
ReadService string `json:"readService,omitempty"`
// Current phase of the cluster
// +optional
Phase string `json:"phase,omitempty"`
// Reason for the current phase
// +optional
PhaseReason string `json:"phaseReason,omitempty"`
// 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
// +optional
SecretsResourceVersion SecretsResourceVersion `json:"secretsResourceVersion,omitempty"`
// 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
// +optional
ConfigMapResourceVersion ConfigMapResourceVersion `json:"configMapResourceVersion,omitempty"`
// The configuration for the CA and related certificates, initialized with defaults.
// +optional
Certificates CertificatesStatus `json:"certificates,omitempty"`
// The first recoverability point, stored as a date in RFC3339 format.
// This field is calculated from the content of FirstRecoverabilityPointByMethod.
//
// Deprecated: the field is not set for backup plugins.
// +optional
FirstRecoverabilityPoint string `json:"firstRecoverabilityPoint,omitempty"`
// The first recoverability point, stored as a date in RFC3339 format, per backup method type.
//
// Deprecated: the field is not set for backup plugins.
// +optional
FirstRecoverabilityPointByMethod map[BackupMethod]metav1.Time `json:"firstRecoverabilityPointByMethod,omitempty"`
// Last successful backup, stored as a date in RFC3339 format.
// This field is calculated from the content of LastSuccessfulBackupByMethod.
//
// Deprecated: the field is not set for backup plugins.
// +optional
LastSuccessfulBackup string `json:"lastSuccessfulBackup,omitempty"`
// Last successful backup, stored as a date in RFC3339 format, per backup method type.
//
// Deprecated: the field is not set for backup plugins.
// +optional
LastSuccessfulBackupByMethod map[BackupMethod]metav1.Time `json:"lastSuccessfulBackupByMethod,omitempty"`
// Last failed backup, stored as a date in RFC3339 format.
//
// Deprecated: the field is not set for backup plugins.
// +optional
LastFailedBackup string `json:"lastFailedBackup,omitempty"`
// The commit hash number of which this operator running
// +optional
CommitHash string `json:"cloudNativePGCommitHash,omitempty"`
// The timestamp when the last actual promotion to primary has occurred
// +optional
CurrentPrimaryTimestamp string `json:"currentPrimaryTimestamp,omitempty"`
// The timestamp when the primary was detected to be unhealthy
// This field is reported when `.spec.failoverDelay` is populated or during online upgrades
// +optional
CurrentPrimaryFailingSinceTimestamp string `json:"currentPrimaryFailingSinceTimestamp,omitempty"`
// The timestamp when the last request for a new primary has occurred
// +optional
TargetPrimaryTimestamp string `json:"targetPrimaryTimestamp,omitempty"`
// The integration needed by poolers referencing the cluster
// +optional
PoolerIntegrations *PoolerIntegrations `json:"poolerIntegrations,omitempty"`
// The hash of the binary of the operator
// +optional
OperatorHash string `json:"cloudNativePGOperatorHash,omitempty"`
// AvailableArchitectures reports the available architectures of a cluster
// +optional
AvailableArchitectures []AvailableArchitecture `json:"availableArchitectures,omitempty"`
// Conditions for cluster object
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// List of instance names in the cluster
// +optional
InstanceNames []string `json:"instanceNames,omitempty"`
// OnlineUpdateEnabled shows if the online upgrade is enabled inside the cluster
// +optional
OnlineUpdateEnabled bool `json:"onlineUpdateEnabled,omitempty"`
// Image contains the image name used by the pods
// +optional
Image string `json:"image,omitempty"`
// PGDataImageInfo contains the details of the latest image that has run on the current data directory.
// +optional
PGDataImageInfo *ImageInfo `json:"pgDataImageInfo,omitempty"`
// PluginStatus is the status of the loaded plugins
// +optional
PluginStatus []PluginStatus `json:"pluginStatus,omitempty"`
// SwitchReplicaClusterStatus is the status of the switch to replica cluster
// +optional
SwitchReplicaClusterStatus SwitchReplicaClusterStatus `json:"switchReplicaClusterStatus,omitempty"`
// DemotionToken is a JSON token containing the information
// from pg_controldata such as Database system identifier, Latest checkpoint's
// TimeLineID, Latest checkpoint's REDO location, Latest checkpoint's REDO
// WAL file, and Time of latest checkpoint
// +optional
DemotionToken string `json:"demotionToken,omitempty"`
// SystemID is the latest detected PostgreSQL SystemID
// +optional
SystemID string `json:"systemID,omitempty"`
}
ClusterStatus defines the observed state of a PostgreSQL cluster managed by CloudNativePG.
func (*ClusterStatus) DeepCopy ¶
func (in *ClusterStatus) DeepCopy() *ClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (*ClusterStatus) DeepCopyInto ¶
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterStatus) GetAvailableArchitecture ¶ added in v1.21.4
func (status *ClusterStatus) GetAvailableArchitecture(archName string) *AvailableArchitecture
GetAvailableArchitecture returns an AvailableArchitecture given it's name. It returns nil if it's not found.
type ConditionReason ¶ added in v1.15.5
type ConditionReason string
ConditionReason defines the reason why a certain condition changed
const ( // ConditionBackupStarted means that the condition changed because the debug // started ConditionBackupStarted ConditionReason = "BackupStarted" // ConditionReasonLastBackupSucceeded means that the condition changed because the last backup // has been taken successfully ConditionReasonLastBackupSucceeded ConditionReason = "LastBackupSucceeded" // ConditionReasonLastBackupFailed means that the condition changed because the last backup // failed ConditionReasonLastBackupFailed ConditionReason = "LastBackupFailed" // ConditionReasonContinuousArchivingSuccess means that the condition changed because the // WAL archiving was working correctly ConditionReasonContinuousArchivingSuccess ConditionReason = "ContinuousArchivingSuccess" // ConditionReasonContinuousArchivingFailing means that the condition has changed because // the WAL archiving is not working correctly ConditionReasonContinuousArchivingFailing ConditionReason = "ContinuousArchivingFailing" // ClusterReady means that the condition changed because the cluster is ready and working properly ClusterReady ConditionReason = "ClusterIsReady" // ClusterIsNotReady means that the condition changed because the cluster is not ready ClusterIsNotReady ConditionReason = "ClusterIsNotReady" // DetachedVolume is the reason that is set when we do a rolling upgrade to add a PVC volume to a cluster DetachedVolume ConditionReason = "DetachedVolume" )
type ConditionStatus ¶
type ConditionStatus string
ConditionStatus defines conditions of resources
const ( ConditionTrue ConditionStatus = "True" ConditionFalse ConditionStatus = "False" ConditionUnknown ConditionStatus = "Unknown" )
These are valid condition statuses. "ConditionTrue" means a resource is in the condition; "ConditionFalse" means a resource is not in the condition; "ConditionUnknown" means kubernetes can't decide if a resource is in the condition or not. In the future, we could add other intermediate conditions, e.g. ConditionDegraded
type ConfigMapKeySelector ¶
type ConfigMapKeySelector = machineryapi.ConfigMapKeySelector
ConfigMapKeySelector contains enough information to let you locate the key of a ConfigMap +kubebuilder:object:generate:=false
type ConfigMapResourceVersion ¶
type ConfigMapResourceVersion struct {
// 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
// +optional
Metrics map[string]string `json:"metrics,omitempty"`
}
ConfigMapResourceVersion is the resource versions of the secrets managed by the operator
func (*ConfigMapResourceVersion) DeepCopy ¶
func (in *ConfigMapResourceVersion) DeepCopy() *ConfigMapResourceVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapResourceVersion.
func (*ConfigMapResourceVersion) DeepCopyInto ¶
func (in *ConfigMapResourceVersion) DeepCopyInto(out *ConfigMapResourceVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DataBackupConfiguration ¶
type DataBackupConfiguration = barmanApi.DataBackupConfiguration
DataBackupConfiguration is the configuration of the backup of the data directory +kubebuilder:object:generate:=false
type DataDurabilityLevel ¶ added in v1.25.0
type DataDurabilityLevel string
DataDurabilityLevel specifies how strictly to enforce synchronous replication when cluster instances are unavailable. Options are `required` or `preferred`.
const ( // DataDurabilityLevelRequired means that data durability is strictly enforced DataDurabilityLevelRequired DataDurabilityLevel = "required" // DataDurabilityLevelPreferred means that data durability is enforced // only when healthy replicas are available DataDurabilityLevelPreferred DataDurabilityLevel = "preferred" )
type DataSource ¶ added in v1.18.5
type DataSource struct {
// Configuration of the storage of the instances
Storage corev1.TypedLocalObjectReference `json:"storage"`
// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
// +optional
WalStorage *corev1.TypedLocalObjectReference `json:"walStorage,omitempty"`
// Configuration of the storage for PostgreSQL tablespaces
// +optional
TablespaceStorage map[string]corev1.TypedLocalObjectReference `json:"tablespaceStorage,omitempty"`
}
DataSource contains the configuration required to bootstrap a PostgreSQL cluster from an existing storage
func (*DataSource) DeepCopy ¶ added in v1.18.5
func (in *DataSource) DeepCopy() *DataSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataSource.
func (*DataSource) DeepCopyInto ¶ added in v1.18.5
func (in *DataSource) DeepCopyInto(out *DataSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Database ¶ added in v1.25.0
type Database struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// Specification of the desired Database.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec DatabaseSpec `json:"spec"`
// Most recently observed status of the Database. 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
// +optional
Status DatabaseStatus `json:"status,omitempty"`
}
Database is the Schema for the databases API
func (*Database) DeepCopy ¶ added in v1.25.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Database.
func (*Database) DeepCopyInto ¶ added in v1.25.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Database) DeepCopyObject ¶ added in v1.25.0
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Database) GetClusterRef ¶ added in v1.25.0
func (db *Database) GetClusterRef() corev1.LocalObjectReference
GetClusterRef returns the cluster reference of the database
func (*Database) GetManagedObjectName ¶ added in v1.25.0
GetManagedObjectName returns the name of the managed database object
func (*Database) GetStatusMessage ¶ added in v1.25.0
GetStatusMessage returns the status message of the database
func (*Database) HasReconciliations ¶ added in v1.25.0
HasReconciliations returns true if the database object has been reconciled at least once
func (*Database) SetAsFailed ¶ added in v1.25.0
SetAsFailed sets the database as failed with the given error
func (*Database) SetAsReady ¶ added in v1.25.0
func (db *Database) SetAsReady()
SetAsReady sets the database as working correctly
func (*Database) SetAsUnknown ¶ added in v1.25.0
SetAsUnknown sets the database as unknown with the given error
func (*Database) SetStatusObservedGeneration ¶ added in v1.25.1
SetStatusObservedGeneration sets the observed generation of the database
type DatabaseList ¶ added in v1.25.0
type DatabaseList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Database `json:"items"`
}
DatabaseList contains a list of Database
func (*DatabaseList) DeepCopy ¶ added in v1.25.0
func (in *DatabaseList) DeepCopy() *DatabaseList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseList.
func (*DatabaseList) DeepCopyInto ¶ added in v1.25.0
func (in *DatabaseList) DeepCopyInto(out *DatabaseList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DatabaseList) DeepCopyObject ¶ added in v1.25.0
func (in *DatabaseList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*DatabaseList) MustHaveManagedResourceExclusivity ¶ added in v1.25.0
func (dbList *DatabaseList) MustHaveManagedResourceExclusivity(reference *Database) error
MustHaveManagedResourceExclusivity detects conflicting databases
type DatabaseObjectSpec ¶ added in v1.26.0
type DatabaseObjectSpec struct {
// Name of the extension/schema
Name string `json:"name"`
// Specifies whether an extension/schema should be present or absent in
// the database. If set to `present`, the extension/schema will be
// created if it does not exist. If set to `absent`, the
// extension/schema will be removed if it exists.
// +kubebuilder:default:="present"
// +kubebuilder:validation:Enum=present;absent
// +optional
Ensure EnsureOption `json:"ensure"`
}
DatabaseObjectSpec contains the fields which are common to every database object
func (*DatabaseObjectSpec) DeepCopy ¶ added in v1.26.0
func (in *DatabaseObjectSpec) DeepCopy() *DatabaseObjectSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObjectSpec.
func (*DatabaseObjectSpec) DeepCopyInto ¶ added in v1.26.0
func (in *DatabaseObjectSpec) DeepCopyInto(out *DatabaseObjectSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (DatabaseObjectSpec) GetEnsure ¶ added in v1.26.0
func (dbObject DatabaseObjectSpec) GetEnsure() EnsureOption
GetEnsure gets the ensure status of the resource
func (DatabaseObjectSpec) GetName ¶ added in v1.26.0
func (dbObject DatabaseObjectSpec) GetName() string
GetName gets the name of the resource
type DatabaseObjectStatus ¶ added in v1.26.0
type DatabaseObjectStatus struct {
// The name of the object
Name string `json:"name"`
// True of the object has been installed successfully in
// the database
Applied bool `json:"applied"`
// Message is the object reconciliation message
// +optional
Message string `json:"message,omitempty"`
}
DatabaseObjectStatus is the status of the managed database objects
func (*DatabaseObjectStatus) DeepCopy ¶ added in v1.26.0
func (in *DatabaseObjectStatus) DeepCopy() *DatabaseObjectStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObjectStatus.
func (*DatabaseObjectStatus) DeepCopyInto ¶ added in v1.26.0
func (in *DatabaseObjectStatus) DeepCopyInto(out *DatabaseObjectStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseReclaimPolicy ¶ added in v1.25.0
type DatabaseReclaimPolicy string
DatabaseReclaimPolicy describes a policy for end-of-life maintenance of databases. +enum
const ( // DatabaseReclaimDelete means the database will be deleted from its PostgreSQL Cluster on release // from its claim. DatabaseReclaimDelete DatabaseReclaimPolicy = "delete" // DatabaseReclaimRetain means the database will be left in its current phase for manual // reclamation by the administrator. The default policy is Retain. DatabaseReclaimRetain DatabaseReclaimPolicy = "retain" )
type DatabaseRoleRef ¶ added in v1.22.0
type DatabaseRoleRef struct {
// +optional
Name string `json:"name,omitempty"`
}
DatabaseRoleRef is a reference an a role available inside PostgreSQL
func (*DatabaseRoleRef) DeepCopy ¶ added in v1.22.0
func (in *DatabaseRoleRef) DeepCopy() *DatabaseRoleRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseRoleRef.
func (*DatabaseRoleRef) DeepCopyInto ¶ added in v1.22.0
func (in *DatabaseRoleRef) DeepCopyInto(out *DatabaseRoleRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseSpec ¶ added in v1.25.0
type DatabaseSpec struct {
// The name of the PostgreSQL cluster hosting the database.
ClusterRef corev1.LocalObjectReference `json:"cluster"`
// Ensure the PostgreSQL database is `present` or `absent` - defaults to "present".
// +kubebuilder:default:="present"
// +kubebuilder:validation:Enum=present;absent
// +optional
Ensure EnsureOption `json:"ensure,omitempty"`
// The name of the database to create inside PostgreSQL. This setting cannot be changed.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
// +kubebuilder:validation:XValidation:rule="self != 'postgres'",message="the name postgres is reserved"
// +kubebuilder:validation:XValidation:rule="self != 'template0'",message="the name template0 is reserved"
// +kubebuilder:validation:XValidation:rule="self != 'template1'",message="the name template1 is reserved"
Name string `json:"name"`
// Maps to the `OWNER` parameter of `CREATE DATABASE`.
// Maps to the `OWNER TO` command of `ALTER DATABASE`.
// The role name of the user who owns the database inside PostgreSQL.
Owner string `json:"owner"`
// Maps to the `TEMPLATE` parameter of `CREATE DATABASE`. This setting
// cannot be changed. The name of the template from which to create
// this database.
// +optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="template is immutable"
Template string `json:"template,omitempty"`
// Maps to the `ENCODING` parameter of `CREATE DATABASE`. This setting
// cannot be changed. Character set encoding to use in the database.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="encoding is immutable"
// +optional
Encoding string `json:"encoding,omitempty"`
// Maps to the `LOCALE` parameter of `CREATE DATABASE`. This setting
// cannot be changed. Sets the default collation order and character
// classification in the new database.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="locale is immutable"
// +optional
Locale string `json:"locale,omitempty"`
// Maps to the `LOCALE_PROVIDER` parameter of `CREATE DATABASE`. This
// setting cannot be changed. This option sets the locale provider for
// databases created in the new cluster. Available from PostgreSQL 16.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="localeProvider is immutable"
// +optional
LocaleProvider string `json:"localeProvider,omitempty"`
// Maps to the `LC_COLLATE` parameter of `CREATE DATABASE`. This
// setting cannot be changed.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="localeCollate is immutable"
// +optional
LcCollate string `json:"localeCollate,omitempty"`
// Maps to the `LC_CTYPE` parameter of `CREATE DATABASE`. This setting
// cannot be changed.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="localeCType is immutable"
// +optional
LcCtype string `json:"localeCType,omitempty"`
// Maps to the `ICU_LOCALE` parameter of `CREATE DATABASE`. This
// setting cannot be changed. Specifies the ICU locale when the ICU
// provider is used. This option requires `localeProvider` to be set to
// `icu`. Available from PostgreSQL 15.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="icuLocale is immutable"
// +optional
IcuLocale string `json:"icuLocale,omitempty"`
// Maps to the `ICU_RULES` parameter of `CREATE DATABASE`. This setting
// cannot be changed. Specifies additional collation rules to customize
// the behavior of the default collation. This option requires
// `localeProvider` to be set to `icu`. Available from PostgreSQL 16.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="icuRules is immutable"
// +optional
IcuRules string `json:"icuRules,omitempty"`
// Maps to the `BUILTIN_LOCALE` parameter of `CREATE DATABASE`. This
// setting cannot be changed. Specifies the locale name when the
// builtin provider is used. This option requires `localeProvider` to
// be set to `builtin`. Available from PostgreSQL 17.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="builtinLocale is immutable"
// +optional
BuiltinLocale string `json:"builtinLocale,omitempty"`
// Maps to the `COLLATION_VERSION` parameter of `CREATE DATABASE`. This
// setting cannot be changed.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="collationVersion is immutable"
// +optional
CollationVersion string `json:"collationVersion,omitempty"`
// Maps to the `IS_TEMPLATE` parameter of `CREATE DATABASE` and `ALTER
// DATABASE`. If true, this database is considered a template and can
// be cloned by any user with `CREATEDB` privileges.
// +optional
IsTemplate *bool `json:"isTemplate,omitempty"`
// Maps to the `ALLOW_CONNECTIONS` parameter of `CREATE DATABASE` and
// `ALTER DATABASE`. If false then no one can connect to this database.
// +optional
AllowConnections *bool `json:"allowConnections,omitempty"`
// Maps to the `CONNECTION LIMIT` clause of `CREATE DATABASE` and
// `ALTER DATABASE`. How many concurrent connections can be made to
// this database. -1 (the default) means no limit.
// +optional
ConnectionLimit *int `json:"connectionLimit,omitempty"`
// Maps to the `TABLESPACE` parameter of `CREATE DATABASE`.
// Maps to the `SET TABLESPACE` command of `ALTER DATABASE`.
// The name of the tablespace (in PostgreSQL) that will be associated
// with the new database. This tablespace will be the default
// tablespace used for objects created in this database.
// +optional
Tablespace string `json:"tablespace,omitempty"`
// The policy for end-of-life maintenance of this database.
// +kubebuilder:validation:Enum=delete;retain
// +kubebuilder:default:=retain
// +optional
ReclaimPolicy DatabaseReclaimPolicy `json:"databaseReclaimPolicy,omitempty"`
// The list of schemas to be managed in the database
// +optional
Schemas []SchemaSpec `json:"schemas,omitempty"`
// The list of extensions to be managed in the database
// +optional
Extensions []ExtensionSpec `json:"extensions,omitempty"`
}
DatabaseSpec is the specification of a Postgresql Database, built around the `CREATE DATABASE`, `ALTER DATABASE`, and `DROP DATABASE` SQL commands of PostgreSQL. +kubebuilder:validation:XValidation:rule="!has(self.builtinLocale) || self.localeProvider == 'builtin'",message="builtinLocale is only available when localeProvider is set to `builtin`" +kubebuilder:validation:XValidation:rule="!has(self.icuLocale) || self.localeProvider == 'icu'",message="icuLocale is only available when localeProvider is set to `icu`" +kubebuilder:validation:XValidation:rule="!has(self.icuRules) || self.localeProvider == 'icu'",message="icuRules is only available when localeProvider is set to `icu`"
func (*DatabaseSpec) DeepCopy ¶ added in v1.25.0
func (in *DatabaseSpec) DeepCopy() *DatabaseSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec.
func (*DatabaseSpec) DeepCopyInto ¶ added in v1.25.0
func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseStatus ¶ added in v1.25.0
type DatabaseStatus struct {
// A sequence number representing the latest
// desired state that was synchronized
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Applied is true if the database was reconciled correctly
// +optional
Applied *bool `json:"applied,omitempty"`
// Message is the reconciliation output message
// +optional
Message string `json:"message,omitempty"`
// Schemas is the status of the managed schemas
// +optional
Schemas []DatabaseObjectStatus `json:"schemas,omitempty"`
// Extensions is the status of the managed extensions
// +optional
Extensions []DatabaseObjectStatus `json:"extensions,omitempty"`
}
DatabaseStatus defines the observed state of Database
func (*DatabaseStatus) DeepCopy ¶ added in v1.25.0
func (in *DatabaseStatus) DeepCopy() *DatabaseStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus.
func (*DatabaseStatus) DeepCopyInto ¶ added in v1.25.0
func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EmbeddedObjectMetadata ¶
type EmbeddedObjectMetadata struct {
// +optional
Labels map[string]string `json:"labels,omitempty"`
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
EmbeddedObjectMetadata contains metadata to be inherited by all resources related to a Cluster
func (*EmbeddedObjectMetadata) DeepCopy ¶
func (in *EmbeddedObjectMetadata) DeepCopy() *EmbeddedObjectMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedObjectMetadata.
func (*EmbeddedObjectMetadata) DeepCopyInto ¶
func (in *EmbeddedObjectMetadata) DeepCopyInto(out *EmbeddedObjectMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EnsureOption ¶ added in v1.20.0
type EnsureOption string
EnsureOption represents whether we should enforce the presence or absence of a Role in a PostgreSQL instance
const ( EnsurePresent EnsureOption = "present" EnsureAbsent EnsureOption = "absent" )
values taken by EnsureOption
type EphemeralVolumesSizeLimitConfiguration ¶ added in v1.19.5
type EphemeralVolumesSizeLimitConfiguration struct {
// Shm is the size limit of the shared memory volume
// +optional
Shm *resource.Quantity `json:"shm,omitempty"`
// TemporaryData is the size limit of the temporary data volume
// +optional
TemporaryData *resource.Quantity `json:"temporaryData,omitempty"`
}
EphemeralVolumesSizeLimitConfiguration contains the configuration of the ephemeral storage
func (*EphemeralVolumesSizeLimitConfiguration) DeepCopy ¶ added in v1.19.5
func (in *EphemeralVolumesSizeLimitConfiguration) DeepCopy() *EphemeralVolumesSizeLimitConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralVolumesSizeLimitConfiguration.
func (*EphemeralVolumesSizeLimitConfiguration) DeepCopyInto ¶ added in v1.19.5
func (in *EphemeralVolumesSizeLimitConfiguration) DeepCopyInto(out *EphemeralVolumesSizeLimitConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*EphemeralVolumesSizeLimitConfiguration) GetShmLimit ¶ added in v1.19.5
func (e *EphemeralVolumesSizeLimitConfiguration) GetShmLimit() *resource.Quantity
GetShmLimit gets the `/dev/shm` memory size limit
func (*EphemeralVolumesSizeLimitConfiguration) GetTemporaryDataLimit ¶ added in v1.19.5
func (e *EphemeralVolumesSizeLimitConfiguration) GetTemporaryDataLimit() *resource.Quantity
GetTemporaryDataLimit gets the temporary storage size limit
type ExtensionConfiguration ¶ added in v1.27.0
type ExtensionConfiguration struct {
// The name of the extension, required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
Name string `json:"name"`
// The image containing the extension, required
// +kubebuilder:validation:XValidation:rule="has(self.reference)",message="An image reference is required"
ImageVolumeSource corev1.ImageVolumeSource `json:"image"`
// The list of directories inside the image which should be added to extension_control_path.
// If not defined, defaults to "/share".
// +optional
ExtensionControlPath []string `json:"extension_control_path,omitempty"`
// The list of directories inside the image which should be added to dynamic_library_path.
// If not defined, defaults to "/lib".
// +optional
DynamicLibraryPath []string `json:"dynamic_library_path,omitempty"`
// The list of directories inside the image which should be added to ld_library_path.
// +optional
LdLibraryPath []string `json:"ld_library_path,omitempty"`
}
ExtensionConfiguration is the configuration used to add PostgreSQL extensions to the Cluster.
func (*ExtensionConfiguration) DeepCopy ¶ added in v1.27.0
func (in *ExtensionConfiguration) DeepCopy() *ExtensionConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfiguration.
func (*ExtensionConfiguration) DeepCopyInto ¶ added in v1.27.0
func (in *ExtensionConfiguration) DeepCopyInto(out *ExtensionConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExtensionSpec ¶ added in v1.26.0
type ExtensionSpec struct {
// Common fields
DatabaseObjectSpec `json:",inline"`
// The version of the extension to install. If empty, the operator will
// install the default version (whatever is specified in the
// extension's control file)
Version string `json:"version,omitempty"`
// The name of the schema in which to install the extension's objects,
// in case the extension allows its contents to be relocated. If not
// specified (default), and the extension's control file does not
// specify a schema either, the current default object creation schema
// is used.
Schema string `json:"schema,omitempty"`
}
ExtensionSpec configures an extension in a database
func (*ExtensionSpec) DeepCopy ¶ added in v1.26.0
func (in *ExtensionSpec) DeepCopy() *ExtensionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionSpec.
func (*ExtensionSpec) DeepCopyInto ¶ added in v1.26.0
func (in *ExtensionSpec) DeepCopyInto(out *ExtensionSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExternalCluster ¶
type ExternalCluster struct {
// The server name, required
Name string `json:"name"`
// The list of connection parameters, such as dbname, host, username, etc
// +optional
ConnectionParameters map[string]string `json:"connectionParameters,omitempty"`
// The reference to an SSL certificate to be used to connect to this
// instance
// +optional
SSLCert *corev1.SecretKeySelector `json:"sslCert,omitempty"`
// The reference to an SSL private key to be used to connect to this
// instance
// +optional
SSLKey *corev1.SecretKeySelector `json:"sslKey,omitempty"`
// The reference to an SSL CA public key to be used to connect to this
// instance
// +optional
SSLRootCert *corev1.SecretKeySelector `json:"sslRootCert,omitempty"`
// The reference to the password to be used to connect to the server.
// If a password is provided, CloudNativePG creates a PostgreSQL
// passfile at `/controller/external/NAME/pass` (where "NAME" is the
// cluster's name). This passfile is automatically referenced in the
// connection string when establishing a connection to the remote
// PostgreSQL server from the current PostgreSQL `Cluster`. This ensures
// secure and efficient password management for external clusters.
// +optional
Password *corev1.SecretKeySelector `json:"password,omitempty"`
// The configuration for the barman-cloud tool suite
// +optional
BarmanObjectStore *BarmanObjectStoreConfiguration `json:"barmanObjectStore,omitempty"`
// The configuration of the plugin that is taking care
// of WAL archiving and backups for this external cluster
PluginConfiguration *PluginConfiguration `json:"plugin,omitempty"`
}
ExternalCluster represents the connection parameters to an external cluster which is used in the other sections of the configuration
func (*ExternalCluster) DeepCopy ¶
func (in *ExternalCluster) DeepCopy() *ExternalCluster
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalCluster.
func (*ExternalCluster) DeepCopyInto ¶
func (in *ExternalCluster) DeepCopyInto(out *ExternalCluster)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ExternalCluster) GetServerName ¶
func (in ExternalCluster) GetServerName() string
GetServerName returns the server name, defaulting to the name of the external cluster or using the one specified in the BarmanObjectStore
type FailoverQuorum ¶ added in v1.27.0
type FailoverQuorum struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// Most recently observed status of the failover quorum.
// +optional
Status FailoverQuorumStatus `json:"status"`
}
FailoverQuorum contains the information about the current failover quorum status of a PG cluster. It is updated by the instance manager of the primary node and reset to zero by the operator to trigger an update.
func (*FailoverQuorum) DeepCopy ¶ added in v1.27.0
func (in *FailoverQuorum) DeepCopy() *FailoverQuorum
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverQuorum.
func (*FailoverQuorum) DeepCopyInto ¶ added in v1.27.0
func (in *FailoverQuorum) DeepCopyInto(out *FailoverQuorum)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FailoverQuorum) DeepCopyObject ¶ added in v1.27.0
func (in *FailoverQuorum) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FailoverQuorumList ¶ added in v1.27.0
type FailoverQuorumList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// List of failoverquorums
Items []FailoverQuorum `json:"items"`
}
FailoverQuorumList contains a list of FailoverQuorum
func (*FailoverQuorumList) DeepCopy ¶ added in v1.27.0
func (in *FailoverQuorumList) DeepCopy() *FailoverQuorumList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverQuorumList.
func (*FailoverQuorumList) DeepCopyInto ¶ added in v1.27.0
func (in *FailoverQuorumList) DeepCopyInto(out *FailoverQuorumList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FailoverQuorumList) DeepCopyObject ¶ added in v1.27.0
func (in *FailoverQuorumList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FailoverQuorumStatus ¶ added in v1.27.0
type FailoverQuorumStatus struct {
// Contains the latest reported Method value.
// +optional
Method string `json:"method,omitempty"`
// StandbyNames is the list of potentially synchronous
// instance names.
// +optional
StandbyNames []string `json:"standbyNames,omitempty"`
// StandbyNumber is the number of synchronous standbys that transactions
// need to wait for replies from.
// +optional
StandbyNumber int `json:"standbyNumber,omitempty"`
// Primary is the name of the primary instance that updated
// this object the latest time.
// +optional
Primary string `json:"primary,omitempty"`
}
FailoverQuorumStatus is the latest observed status of the failover quorum of the PG cluster.
func (*FailoverQuorumStatus) DeepCopy ¶ added in v1.27.0
func (in *FailoverQuorumStatus) DeepCopy() *FailoverQuorumStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverQuorumStatus.
func (*FailoverQuorumStatus) DeepCopyInto ¶ added in v1.27.0
func (in *FailoverQuorumStatus) DeepCopyInto(out *FailoverQuorumStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GenericImageCatalog ¶ added in v1.23.0
type GenericImageCatalog interface {
runtime.Object
metav1.Object
// GetSpec returns the Spec of the GenericImageCatalog
GetSpec() *ImageCatalogSpec
}
GenericImageCatalog is an interface used to manage ClusterImageCatalog and ImageCatalog in the same way
type GoogleCredentials ¶
type GoogleCredentials = barmanApi.GoogleCredentials
GoogleCredentials is the type for the Google Cloud Storage credentials. This needs to be specified even if we run inside a GKE environment. +kubebuilder:object:generate:=false
type ImageCatalog ¶ added in v1.23.0
type ImageCatalog struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// Specification of the desired behavior of the ImageCatalog.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec ImageCatalogSpec `json:"spec"`
}
ImageCatalog is the Schema for the imagecatalogs API
func (*ImageCatalog) DeepCopy ¶ added in v1.23.0
func (in *ImageCatalog) DeepCopy() *ImageCatalog
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageCatalog.
func (*ImageCatalog) DeepCopyInto ¶ added in v1.23.0
func (in *ImageCatalog) DeepCopyInto(out *ImageCatalog)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ImageCatalog) DeepCopyObject ¶ added in v1.23.0
func (in *ImageCatalog) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ImageCatalog) GetSpec ¶ added in v1.23.0
func (c *ImageCatalog) GetSpec() *ImageCatalogSpec
GetSpec returns the Spec of the ImageCatalog
type ImageCatalogList ¶ added in v1.23.0
type ImageCatalogList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metav1.ListMeta `json:"metadata"`
// List of ImageCatalogs
Items []ImageCatalog `json:"items"`
}
ImageCatalogList contains a list of ImageCatalog
func (*ImageCatalogList) DeepCopy ¶ added in v1.23.0
func (in *ImageCatalogList) DeepCopy() *ImageCatalogList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageCatalogList.
func (*ImageCatalogList) DeepCopyInto ¶ added in v1.23.0
func (in *ImageCatalogList) DeepCopyInto(out *ImageCatalogList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ImageCatalogList) DeepCopyObject ¶ added in v1.23.0
func (in *ImageCatalogList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ImageCatalogRef ¶ added in v1.23.0
type ImageCatalogRef struct {
// +kubebuilder:validation:XValidation:rule="self.kind == 'ImageCatalog' || self.kind == 'ClusterImageCatalog'",message="Only image catalogs are supported"
// +kubebuilder:validation:XValidation:rule="self.apiGroup == 'postgresql.cnpg.io'",message="Only image catalogs are supported"
corev1.TypedLocalObjectReference `json:",inline"`
// The major version of PostgreSQL we want to use from the ImageCatalog
Major int `json:"major"`
}
ImageCatalogRef defines the reference to a major version in an ImageCatalog
func (*ImageCatalogRef) DeepCopy ¶ added in v1.23.0
func (in *ImageCatalogRef) DeepCopy() *ImageCatalogRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageCatalogRef.
func (*ImageCatalogRef) DeepCopyInto ¶ added in v1.23.0
func (in *ImageCatalogRef) DeepCopyInto(out *ImageCatalogRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ImageCatalogSpec ¶ added in v1.23.0
type ImageCatalogSpec struct {
// List of CatalogImages available in the catalog
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:XValidation:rule="self.all(e, self.filter(f, f.major==e.major).size() == 1)",message=Images must have unique major versions
Images []CatalogImage `json:"images"`
}
ImageCatalogSpec defines the desired ImageCatalog
func (*ImageCatalogSpec) DeepCopy ¶ added in v1.23.0
func (in *ImageCatalogSpec) DeepCopy() *ImageCatalogSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageCatalogSpec.
func (*ImageCatalogSpec) DeepCopyInto ¶ added in v1.23.0
func (in *ImageCatalogSpec) DeepCopyInto(out *ImageCatalogSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ImageCatalogSpec) FindImageForMajor ¶ added in v1.23.0
func (spec *ImageCatalogSpec) FindImageForMajor(major int) (string, bool)
FindImageForMajor finds the correct image for the selected major version
type ImageInfo ¶ added in v1.26.0
type ImageInfo struct {
// Image is the image name
Image string `json:"image"`
// MajorVersion is the major version of the image
MajorVersion int `json:"majorVersion"`
}
ImageInfo contains the information about a PostgreSQL image
func (*ImageInfo) DeepCopy ¶ added in v1.26.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageInfo.
func (*ImageInfo) DeepCopyInto ¶ added in v1.26.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Import ¶ added in v1.16.0
type Import struct {
// The source of the import
Source ImportSource `json:"source"`
// The import type. Can be `microservice` or `monolith`.
// +kubebuilder:validation:Enum=microservice;monolith
Type SnapshotType `json:"type"`
// The databases to import
Databases []string `json:"databases"`
// The roles to import
// +optional
Roles []string `json:"roles,omitempty"`
// 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.
// +optional
PostImportApplicationSQL []string `json:"postImportApplicationSQL,omitempty"`
// When set to true, only the `pre-data` and `post-data` sections of
// `pg_restore` are invoked, avoiding data import. Default: `false`.
// +optional
SchemaOnly bool `json:"schemaOnly,omitempty"`
// List of custom options to pass to the `pg_dump` command. IMPORTANT:
// Use these options with caution and at your own risk, as the operator
// does not validate their content. Be aware that certain options may
// conflict with the operator's intended functionality or design.
// +optional
PgDumpExtraOptions []string `json:"pgDumpExtraOptions,omitempty"`
// List of custom options to pass to the `pg_restore` command. IMPORTANT:
// Use these options with caution and at your own risk, as the operator
// does not validate their content. Be aware that certain options may
// conflict with the operator's intended functionality or design.
// +optional
PgRestoreExtraOptions []string `json:"pgRestoreExtraOptions,omitempty"`
}
Import contains the configuration to init a database from a logic snapshot of an externalCluster
func (*Import) DeepCopy ¶ added in v1.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Import.
func (*Import) DeepCopyInto ¶ added in v1.16.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ImportSource ¶ added in v1.16.0
type ImportSource struct {
// The name of the externalCluster used for import
ExternalCluster string `json:"externalCluster"`
}
ImportSource describes the source for the logical snapshot
func (*ImportSource) DeepCopy ¶ added in v1.16.0
func (in *ImportSource) DeepCopy() *ImportSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportSource.
func (*ImportSource) DeepCopyInto ¶ added in v1.16.0
func (in *ImportSource) DeepCopyInto(out *ImportSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstanceID ¶
type InstanceID struct {
// The pod name
// +optional
PodName string `json:"podName,omitempty"`
// The container ID
// +optional
ContainerID string `json:"ContainerID,omitempty"`
}
InstanceID contains the information to identify an instance
func (*InstanceID) DeepCopy ¶
func (in *InstanceID) DeepCopy() *InstanceID
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceID.
func (*InstanceID) DeepCopyInto ¶
func (in *InstanceID) DeepCopyInto(out *InstanceID)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstanceReportedState ¶ added in v1.16.1
type InstanceReportedState struct {
// indicates if an instance is the primary one
IsPrimary bool `json:"isPrimary"`
// indicates on which TimelineId the instance is
// +optional
TimeLineID int `json:"timeLineID,omitempty"`
// IP address of the instance
IP string `json:"ip,omitempty"`
}
InstanceReportedState describes the last reported state of an instance during a reconciliation loop
func (*InstanceReportedState) DeepCopy ¶ added in v1.16.1
func (in *InstanceReportedState) DeepCopy() *InstanceReportedState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceReportedState.
func (*InstanceReportedState) DeepCopyInto ¶ added in v1.16.1
func (in *InstanceReportedState) DeepCopyInto(out *InstanceReportedState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IsolationCheckConfiguration ¶ added in v1.27.0
type IsolationCheckConfiguration struct {
// Whether primary isolation checking is enabled for the liveness probe
// +optional
// +kubebuilder:default:=true
Enabled *bool `json:"enabled,omitempty"`
// Timeout in milliseconds for requests during the primary isolation check
// +optional
// +kubebuilder:default:=1000
RequestTimeout int `json:"requestTimeout,omitempty"`
// Timeout in milliseconds for connections during the primary isolation check
// +optional
// +kubebuilder:default:=1000
ConnectionTimeout int `json:"connectionTimeout,omitempty"`
}
IsolationCheckConfiguration contains the configuration for the isolation check functionality in the liveness probe
func NewLivenessPingerConfigFromAnnotations ¶ added in v1.27.0
func NewLivenessPingerConfigFromAnnotations( annotations map[string]string, ) (*IsolationCheckConfiguration, error)
NewLivenessPingerConfigFromAnnotations creates a new pinger configuration from the annotations in the cluster definition
func (*IsolationCheckConfiguration) DeepCopy ¶ added in v1.27.0
func (in *IsolationCheckConfiguration) DeepCopy() *IsolationCheckConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IsolationCheckConfiguration.
func (*IsolationCheckConfiguration) DeepCopyInto ¶ added in v1.27.0
func (in *IsolationCheckConfiguration) DeepCopyInto(out *IsolationCheckConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KubernetesUpgradeStrategy ¶
type KubernetesUpgradeStrategy string
KubernetesUpgradeStrategy tells the operator if the user want to allocate more space while upgrading a k8s node which is hosting the PostgreSQL Pods or just wait for the node to come up
type LDAPBindAsAuth ¶
type LDAPBindAsAuth struct {
// Prefix for the bind authentication option
// +optional
Prefix string `json:"prefix,omitempty"`
// Suffix for the bind authentication option
// +optional
Suffix string `json:"suffix,omitempty"`
}
LDAPBindAsAuth provides the required fields to use the bind authentication for LDAP
func (*LDAPBindAsAuth) DeepCopy ¶
func (in *LDAPBindAsAuth) DeepCopy() *LDAPBindAsAuth
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LDAPBindAsAuth.
func (*LDAPBindAsAuth) DeepCopyInto ¶
func (in *LDAPBindAsAuth) DeepCopyInto(out *LDAPBindAsAuth)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LDAPBindSearchAuth ¶
type LDAPBindSearchAuth struct {
// Root DN to begin the user search
// +optional
BaseDN string `json:"baseDN,omitempty"`
// DN of the user to bind to the directory
// +optional
BindDN string `json:"bindDN,omitempty"`
// Secret with the password for the user to bind to the directory
// +optional
BindPassword *corev1.SecretKeySelector `json:"bindPassword,omitempty"`
// Attribute to match against the username
// +optional
SearchAttribute string `json:"searchAttribute,omitempty"`
// Search filter to use when doing the search+bind authentication
// +optional
SearchFilter string `json:"searchFilter,omitempty"`
}
LDAPBindSearchAuth provides the required fields to use the bind+search LDAP authentication process
func (*LDAPBindSearchAuth) DeepCopy ¶
func (in *LDAPBindSearchAuth) DeepCopy() *LDAPBindSearchAuth
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LDAPBindSearchAuth.
func (*LDAPBindSearchAuth) DeepCopyInto ¶
func (in *LDAPBindSearchAuth) DeepCopyInto(out *LDAPBindSearchAuth)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LDAPConfig ¶
type LDAPConfig struct {
// LDAP hostname or IP address
// +optional
Server string `json:"server,omitempty"`
// LDAP server port
// +optional
Port int `json:"port,omitempty"`
// LDAP schema to be used, possible options are `ldap` and `ldaps`
// +kubebuilder:validation:Enum=ldap;ldaps
// +optional
Scheme LDAPScheme `json:"scheme,omitempty"`
// Bind as authentication configuration
// +optional
BindAsAuth *LDAPBindAsAuth `json:"bindAsAuth,omitempty"`
// Bind+Search authentication configuration
// +optional
BindSearchAuth *LDAPBindSearchAuth `json:"bindSearchAuth,omitempty"`
// Set to 'true' to enable LDAP over TLS. 'false' is default
// +optional
TLS bool `json:"tls,omitempty"`
}
LDAPConfig contains the parameters needed for LDAP authentication
func (*LDAPConfig) DeepCopy ¶
func (in *LDAPConfig) DeepCopy() *LDAPConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LDAPConfig.
func (*LDAPConfig) DeepCopyInto ¶
func (in *LDAPConfig) DeepCopyInto(out *LDAPConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LDAPScheme ¶
type LDAPScheme string
LDAPScheme defines the possible schemes for LDAP
const ( LDAPSchemeLDAP LDAPScheme = "ldap" LDAPSchemeLDAPS LDAPScheme = "ldaps" )
These are the valid LDAP schemes
type LivenessProbe ¶ added in v1.27.0
type LivenessProbe struct {
// Probe is the standard probe configuration
Probe `json:",inline"`
// Configure the feature that extends the liveness probe for a primary
// instance. In addition to the basic checks, this verifies whether the
// primary is isolated from the Kubernetes API server and from its
// replicas, ensuring that it can be safely shut down if network
// partition or API unavailability is detected. Enabled by default.
// +optional
IsolationCheck *IsolationCheckConfiguration `json:"isolationCheck,omitempty"`
}
LivenessProbe is the configuration of the liveness probe
func (*LivenessProbe) DeepCopy ¶ added in v1.27.0
func (in *LivenessProbe) DeepCopy() *LivenessProbe
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LivenessProbe.
func (*LivenessProbe) DeepCopyInto ¶ added in v1.27.0
func (in *LivenessProbe) DeepCopyInto(out *LivenessProbe)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LocalObjectReference ¶
type LocalObjectReference = machineryapi.LocalObjectReference
LocalObjectReference contains enough information to let you locate a local object with a known type inside the same namespace +kubebuilder:object:generate:=false
type ManagedConfiguration ¶ added in v1.20.0
type ManagedConfiguration struct {
// Database roles managed by the `Cluster`
// +optional
Roles []RoleConfiguration `json:"roles,omitempty"`
// Services roles managed by the `Cluster`
// +optional
Services *ManagedServices `json:"services,omitempty"`
}
ManagedConfiguration represents the portions of PostgreSQL that are managed by the instance manager
func (*ManagedConfiguration) DeepCopy ¶ added in v1.20.0
func (in *ManagedConfiguration) DeepCopy() *ManagedConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedConfiguration.
func (*ManagedConfiguration) DeepCopyInto ¶ added in v1.20.0
func (in *ManagedConfiguration) DeepCopyInto(out *ManagedConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManagedRoles ¶ added in v1.20.0
type ManagedRoles struct {
// ByStatus gives the list of roles in each state
// +optional
ByStatus map[RoleStatus][]string `json:"byStatus,omitempty"`
// CannotReconcile lists roles that cannot be reconciled in PostgreSQL,
// with an explanation of the cause
// +optional
CannotReconcile map[string][]string `json:"cannotReconcile,omitempty"`
// PasswordStatus gives the last transaction id and password secret version for each managed role
// +optional
PasswordStatus map[string]PasswordState `json:"passwordStatus,omitempty"`
}
ManagedRoles tracks the status of a cluster's managed roles
func (*ManagedRoles) DeepCopy ¶ added in v1.20.0
func (in *ManagedRoles) DeepCopy() *ManagedRoles
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedRoles.
func (*ManagedRoles) DeepCopyInto ¶ added in v1.20.0
func (in *ManagedRoles) DeepCopyInto(out *ManagedRoles)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManagedService ¶ added in v1.24.0
type ManagedService struct {
// SelectorType specifies the type of selectors that the service will have.
// Valid values are "rw", "r", and "ro", representing read-write, read, and read-only services.
SelectorType ServiceSelectorType `json:"selectorType"`
// UpdateStrategy describes how the service differences should be reconciled
// +kubebuilder:default:="patch"
// +optional
UpdateStrategy ServiceUpdateStrategy `json:"updateStrategy,omitempty"`
// ServiceTemplate is the template specification for the service.
ServiceTemplate ServiceTemplateSpec `json:"serviceTemplate"`
}
ManagedService represents a specific service managed by the cluster. It includes the type of service and its associated template specification.
func (*ManagedService) DeepCopy ¶ added in v1.24.0
func (in *ManagedService) DeepCopy() *ManagedService
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedService.
func (*ManagedService) DeepCopyInto ¶ added in v1.24.0
func (in *ManagedService) DeepCopyInto(out *ManagedService)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManagedServices ¶ added in v1.24.0
type ManagedServices struct {
// DisabledDefaultServices is a list of service types that are disabled by default.
// Valid values are "r", and "ro", representing read, and read-only services.
// +optional
DisabledDefaultServices []ServiceSelectorType `json:"disabledDefaultServices,omitempty"`
// Additional is a list of additional managed services specified by the user.
// +optional
Additional []ManagedService `json:"additional,omitempty"`
}
ManagedServices represents the services managed by the cluster.
func (*ManagedServices) DeepCopy ¶ added in v1.24.0
func (in *ManagedServices) DeepCopy() *ManagedServices
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedServices.
func (*ManagedServices) DeepCopyInto ¶ added in v1.24.0
func (in *ManagedServices) DeepCopyInto(out *ManagedServices)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Metadata ¶ added in v1.18.1
type Metadata struct {
// The name of the resource. Only supported for certain types
// +optional
Name string `json:"name,omitempty"`
// 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
// +optional
Labels map[string]string `json:"labels,omitempty"`
// 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
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
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.
func (*Metadata) DeepCopy ¶ added in v1.18.1
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.
func (*Metadata) DeepCopyInto ¶ added in v1.18.1
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MonitoringConfiguration ¶
type MonitoringConfiguration struct {
// 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.
// +kubebuilder:default:=false
// +optional
DisableDefaultQueries *bool `json:"disableDefaultQueries,omitempty"`
// The list of config maps containing the custom queries
// +optional
CustomQueriesConfigMap []ConfigMapKeySelector `json:"customQueriesConfigMap,omitempty"`
// The list of secrets containing the custom queries
// +optional
CustomQueriesSecret []SecretKeySelector `json:"customQueriesSecret,omitempty"`
// Enable or disable the `PodMonitor`
// +kubebuilder:default:=false
//
// Deprecated: This feature will be removed in an upcoming release. If
// you need this functionality, you can create a PodMonitor manually.
// +optional
EnablePodMonitor bool `json:"enablePodMonitor,omitempty"`
// Configure TLS communication for the metrics endpoint.
// Changing tls.enabled option will force a rollout of all instances.
// +optional
TLSConfig *ClusterMonitoringTLSConfiguration `json:"tls,omitempty"`
// The list of metric relabelings for the `PodMonitor`. Applied to samples before ingestion.
//
// Deprecated: This feature will be removed in an upcoming release. If
// you need this functionality, you can create a PodMonitor manually.
// +optional
PodMonitorMetricRelabelConfigs []monitoringv1.RelabelConfig `json:"podMonitorMetricRelabelings,omitempty"`
// The list of relabelings for the `PodMonitor`. Applied to samples before scraping.
//
// Deprecated: This feature will be removed in an upcoming release. If
// you need this functionality, you can create a PodMonitor manually.
// +optional
PodMonitorRelabelConfigs []monitoringv1.RelabelConfig `json:"podMonitorRelabelings,omitempty"`
}
MonitoringConfiguration is the type containing all the monitoring configuration for a certain cluster
func (*MonitoringConfiguration) AreDefaultQueriesDisabled ¶
func (m *MonitoringConfiguration) AreDefaultQueriesDisabled() bool
AreDefaultQueriesDisabled checks whether default monitoring queries should be disabled
func (*MonitoringConfiguration) DeepCopy ¶
func (in *MonitoringConfiguration) DeepCopy() *MonitoringConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringConfiguration.
func (*MonitoringConfiguration) DeepCopyInto ¶
func (in *MonitoringConfiguration) DeepCopyInto(out *MonitoringConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodeMaintenanceWindow ¶
type NodeMaintenanceWindow struct {
// Reuse the existing PVC (wait for the node to come
// up again) or not (recreate it elsewhere - when `instances` >1)
// +optional
// +kubebuilder:default:=true
ReusePVC *bool `json:"reusePVC,omitempty"`
// Is there a node maintenance activity in progress?
// +optional
// +kubebuilder:default:=false
InProgress bool `json:"inProgress,omitempty"`
}
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.
func (*NodeMaintenanceWindow) DeepCopy ¶
func (in *NodeMaintenanceWindow) DeepCopy() *NodeMaintenanceWindow
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeMaintenanceWindow.
func (*NodeMaintenanceWindow) DeepCopyInto ¶
func (in *NodeMaintenanceWindow) DeepCopyInto(out *NodeMaintenanceWindow)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OnlineConfiguration ¶ added in v1.21.1
type OnlineConfiguration struct {
// If false, the function will return immediately after the backup is completed,
// without waiting for WAL to be archived.
// This behavior is only useful with backup software that independently monitors WAL archiving.
// Otherwise, WAL required to make the backup consistent might be missing and make the backup useless.
// By default, or when this parameter is true, pg_backup_stop will wait for WAL to be archived when archiving is
// enabled.
// On a standby, this means that it will wait only when archive_mode = always.
// If write activity on the primary is low, it may be useful to run pg_switch_wal on the primary in order to trigger
// an immediate segment switch.
// +kubebuilder:default:=true
// +optional
WaitForArchive *bool `json:"waitForArchive,omitempty"`
// 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.
// +optional
ImmediateCheckpoint *bool `json:"immediateCheckpoint,omitempty"`
}
OnlineConfiguration contains the configuration parameters for the online volume snapshot
func (*OnlineConfiguration) DeepCopy ¶ added in v1.21.1
func (in *OnlineConfiguration) DeepCopy() *OnlineConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OnlineConfiguration.
func (*OnlineConfiguration) DeepCopyInto ¶ added in v1.21.1
func (in *OnlineConfiguration) DeepCopyInto(out *OnlineConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (OnlineConfiguration) GetImmediateCheckpoint ¶ added in v1.21.1
func (o OnlineConfiguration) GetImmediateCheckpoint() bool
GetImmediateCheckpoint tells whether to execute an immediate checkpoint
func (OnlineConfiguration) GetWaitForArchive ¶ added in v1.21.1
func (o OnlineConfiguration) GetWaitForArchive() bool
GetWaitForArchive tells whether to wait for archive or not
type PasswordState ¶ added in v1.20.0
type PasswordState struct {
// the last transaction ID to affect the role definition in PostgreSQL
// +optional
TransactionID int64 `json:"transactionID,omitempty"`
// the resource version of the password secret
// +optional
SecretResourceVersion string `json:"resourceVersion,omitempty"`
}
PasswordState represents the state of the password of a managed RoleConfiguration
func (*PasswordState) DeepCopy ¶ added in v1.20.0
func (in *PasswordState) DeepCopy() *PasswordState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PasswordState.
func (*PasswordState) DeepCopyInto ¶ added in v1.20.0
func (in *PasswordState) DeepCopyInto(out *PasswordState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PgBouncerIntegrationStatus ¶
type PgBouncerIntegrationStatus struct {
// +optional
Secrets []string `json:"secrets,omitempty"`
}
PgBouncerIntegrationStatus encapsulates the needed integration for the pgbouncer poolers referencing the cluster
func (*PgBouncerIntegrationStatus) DeepCopy ¶
func (in *PgBouncerIntegrationStatus) DeepCopy() *PgBouncerIntegrationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgBouncerIntegrationStatus.
func (*PgBouncerIntegrationStatus) DeepCopyInto ¶
func (in *PgBouncerIntegrationStatus) DeepCopyInto(out *PgBouncerIntegrationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PgBouncerPoolMode ¶
type PgBouncerPoolMode string
PgBouncerPoolMode is the mode of PgBouncer +kubebuilder:validation:Enum=session;transaction
type PgBouncerSecrets ¶
type PgBouncerSecrets struct {
// The auth query secret version
// +optional
AuthQuery SecretVersion `json:"authQuery,omitempty"`
}
PgBouncerSecrets contains the versions of the secrets used by pgbouncer
func (*PgBouncerSecrets) DeepCopy ¶
func (in *PgBouncerSecrets) DeepCopy() *PgBouncerSecrets
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgBouncerSecrets.
func (*PgBouncerSecrets) DeepCopyInto ¶
func (in *PgBouncerSecrets) DeepCopyInto(out *PgBouncerSecrets)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PgBouncerSpec ¶
type PgBouncerSpec struct {
// The pool mode. Default: `session`.
// +kubebuilder:default:=session
// +optional
PoolMode PgBouncerPoolMode `json:"poolMode,omitempty"`
// 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_catalog.pg_shadow WHERE usename=$1")
// has to be specified and no automatic CNPG Cluster integration will be triggered.
// +optional
AuthQuerySecret *LocalObjectReference `json:"authQuerySecret,omitempty"`
// The query that will be used to download the hash of the password
// of a certain user. Default: "SELECT usename, passwd FROM public.user_search($1)".
// In case it is specified, also an AuthQuerySecret has to be specified and
// no automatic CNPG Cluster integration will be triggered.
// +optional
AuthQuery string `json:"authQuery,omitempty"`
// Additional parameters to be passed to PgBouncer - please check
// the CNPG documentation for a list of options you can configure
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
// PostgreSQL Host Based Authentication rules (lines to be appended
// to the pg_hba.conf file)
// +optional
PgHBA []string `json:"pg_hba,omitempty"`
// 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.
// +kubebuilder:default:=false
// +optional
Paused *bool `json:"paused,omitempty"`
}
PgBouncerSpec defines how to configure PgBouncer
func (*PgBouncerSpec) DeepCopy ¶
func (in *PgBouncerSpec) DeepCopy() *PgBouncerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgBouncerSpec.
func (*PgBouncerSpec) DeepCopyInto ¶
func (in *PgBouncerSpec) DeepCopyInto(out *PgBouncerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (PgBouncerSpec) IsPaused ¶
func (in PgBouncerSpec) IsPaused() bool
IsPaused returns whether all database should be paused or not.
type PluginConfiguration ¶ added in v1.23.0
type PluginConfiguration struct {
// Name is the plugin name
Name string `json:"name"`
// Enabled is true if this plugin will be used
// +kubebuilder:default:=true
// +optional
Enabled *bool `json:"enabled,omitempty"`
// Marks the plugin as the WAL archiver. At most one plugin can be
// designated as a WAL archiver. This cannot be enabled if the
// `.spec.backup.barmanObjectStore` configuration is present.
// +kubebuilder:default:=false
// +optional
IsWALArchiver *bool `json:"isWALArchiver,omitempty"`
// Parameters is the configuration of the plugin
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
}
PluginConfiguration specifies a plugin that need to be loaded for this cluster to be reconciled
func (*PluginConfiguration) DeepCopy ¶ added in v1.23.0
func (in *PluginConfiguration) DeepCopy() *PluginConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginConfiguration.
func (*PluginConfiguration) DeepCopyInto ¶ added in v1.23.0
func (in *PluginConfiguration) DeepCopyInto(out *PluginConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PluginConfiguration) IsEnabled ¶ added in v1.25.0
func (config *PluginConfiguration) IsEnabled() bool
IsEnabled returns true when this plugin is enabled
type PluginStatus ¶ added in v1.23.0
type PluginStatus struct {
// Name is the name of the plugin
Name string `json:"name"`
// Version is the version of the plugin loaded by the
// latest reconciliation loop
Version string `json:"version"`
// Capabilities are the list of capabilities of the
// plugin
// +optional
Capabilities []string `json:"capabilities,omitempty"`
// OperatorCapabilities are the list of capabilities of the
// plugin regarding the reconciler
// +optional
OperatorCapabilities []string `json:"operatorCapabilities,omitempty"`
// WALCapabilities are the list of capabilities of the
// plugin regarding the WAL management
// +optional
WALCapabilities []string `json:"walCapabilities,omitempty"`
// BackupCapabilities are the list of capabilities of the
// plugin regarding the Backup management
// +optional
BackupCapabilities []string `json:"backupCapabilities,omitempty"`
// RestoreJobHookCapabilities are the list of capabilities of the
// plugin regarding the RestoreJobHook management
// +optional
RestoreJobHookCapabilities []string `json:"restoreJobHookCapabilities,omitempty"`
// Status contain the status reported by the plugin through the SetStatusInCluster interface
// +optional
Status string `json:"status,omitempty"`
}
PluginStatus is the status of a loaded plugin
func (*PluginStatus) DeepCopy ¶ added in v1.23.0
func (in *PluginStatus) DeepCopy() *PluginStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginStatus.
func (*PluginStatus) DeepCopyInto ¶ added in v1.23.0
func (in *PluginStatus) DeepCopyInto(out *PluginStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodStatus ¶ added in v1.23.5
type PodStatus string
PodStatus represent the possible status of pods
type PodTemplateSpec ¶
type PodTemplateSpec struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
ObjectMeta Metadata `json:"metadata,omitempty"`
// 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
// +optional
Spec corev1.PodSpec `json:"spec,omitempty"`
}
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
func (*PodTemplateSpec) DeepCopy ¶
func (in *PodTemplateSpec) DeepCopy() *PodTemplateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTemplateSpec.
func (*PodTemplateSpec) DeepCopyInto ¶
func (in *PodTemplateSpec) DeepCopyInto(out *PodTemplateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodTopologyLabels ¶ added in v1.16.0
PodTopologyLabels represent the topology of a Pod. map[labelName]labelValue
func (PodTopologyLabels) DeepCopy ¶ added in v1.16.0
func (in PodTopologyLabels) DeepCopy() PodTopologyLabels
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTopologyLabels.
func (PodTopologyLabels) DeepCopyInto ¶ added in v1.16.0
func (in PodTopologyLabels) DeepCopyInto(out *PodTopologyLabels)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (PodTopologyLabels) MatchesTopology ¶ added in v1.24.0
func (topologyLabels PodTopologyLabels) MatchesTopology(instanceTopology PodTopologyLabels) bool
MatchesTopology checks if the two topologies have the same label values (labels are specified in SyncReplicaElectionConstraints.NodeLabelsAntiAffinity)
type Pooler ¶
type Pooler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// 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
Spec PoolerSpec `json:"spec"`
// 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
// +optional
Status PoolerStatus `json:"status,omitempty"`
}
Pooler is the Schema for the poolers API
func (*Pooler) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pooler.
func (*Pooler) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Pooler) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Pooler) GetAuthQuery ¶
GetAuthQuery returns the specified AuthQuery name for PgBouncer if provided or the default name otherwise.
func (*Pooler) GetAuthQuerySecretName ¶
GetAuthQuerySecretName returns the specified AuthQuerySecret name for PgBouncer if provided or the default name otherwise.
func (*Pooler) GetResourcesRequirements ¶ added in v1.25.3
func (in *Pooler) GetResourcesRequirements() corev1.ResourceRequirements
GetResourcesRequirements returns the resource requirements for the Pooler
func (*Pooler) IsAutomatedIntegration ¶ added in v1.20.6
IsAutomatedIntegration returns whether the Pooler integration with the Cluster is automated or not.
type PoolerIntegrations ¶
type PoolerIntegrations struct {
// +optional
PgBouncerIntegration PgBouncerIntegrationStatus `json:"pgBouncerIntegration,omitempty"`
}
PoolerIntegrations encapsulates the needed integration for the poolers referencing the cluster
func (*PoolerIntegrations) DeepCopy ¶
func (in *PoolerIntegrations) DeepCopy() *PoolerIntegrations
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolerIntegrations.
func (*PoolerIntegrations) DeepCopyInto ¶
func (in *PoolerIntegrations) DeepCopyInto(out *PoolerIntegrations)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolerList ¶
type PoolerList struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
Items []Pooler `json:"items"`
}
PoolerList contains a list of Pooler
func (*PoolerList) DeepCopy ¶
func (in *PoolerList) DeepCopy() *PoolerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolerList.
func (*PoolerList) DeepCopyInto ¶
func (in *PoolerList) DeepCopyInto(out *PoolerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PoolerList) DeepCopyObject ¶
func (in *PoolerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PoolerMonitoringConfiguration ¶ added in v1.18.5
type PoolerMonitoringConfiguration struct {
// Enable or disable the `PodMonitor`
// +kubebuilder:default:=false
// +optional
EnablePodMonitor bool `json:"enablePodMonitor,omitempty"`
// The list of metric relabelings for the `PodMonitor`. Applied to samples before ingestion.
// +optional
PodMonitorMetricRelabelConfigs []monitoringv1.RelabelConfig `json:"podMonitorMetricRelabelings,omitempty"`
// The list of relabelings for the `PodMonitor`. Applied to samples before scraping.
// +optional
PodMonitorRelabelConfigs []monitoringv1.RelabelConfig `json:"podMonitorRelabelings,omitempty"`
}
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.
func (*PoolerMonitoringConfiguration) DeepCopy ¶ added in v1.18.5
func (in *PoolerMonitoringConfiguration) DeepCopy() *PoolerMonitoringConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolerMonitoringConfiguration.
func (*PoolerMonitoringConfiguration) DeepCopyInto ¶ added in v1.18.5
func (in *PoolerMonitoringConfiguration) DeepCopyInto(out *PoolerMonitoringConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolerSecrets ¶
type PoolerSecrets struct {
// The server TLS secret version
// +optional
ServerTLS SecretVersion `json:"serverTLS,omitempty"`
// The server CA secret version
// +optional
ServerCA SecretVersion `json:"serverCA,omitempty"`
// The client CA secret version
// +optional
ClientCA SecretVersion `json:"clientCA,omitempty"`
// The version of the secrets used by PgBouncer
// +optional
PgBouncerSecrets *PgBouncerSecrets `json:"pgBouncerSecrets,omitempty"`
}
PoolerSecrets contains the versions of all the secrets used
func (*PoolerSecrets) DeepCopy ¶
func (in *PoolerSecrets) DeepCopy() *PoolerSecrets
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolerSecrets.
func (*PoolerSecrets) DeepCopyInto ¶
func (in *PoolerSecrets) DeepCopyInto(out *PoolerSecrets)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolerSpec ¶
type PoolerSpec struct {
// This is the cluster reference on which the Pooler will work.
// Pooler name should never match with any cluster name within the same namespace.
Cluster LocalObjectReference `json:"cluster"`
// Type of service to forward traffic to. Default: `rw`.
// +kubebuilder:default:=rw
// +optional
Type PoolerType `json:"type,omitempty"`
// The number of replicas we want. Default: 1.
// +kubebuilder:default:=1
// +optional
Instances *int32 `json:"instances,omitempty"`
// The template of the Pod to be created
// +optional
Template *PodTemplateSpec `json:"template,omitempty"`
// The PgBouncer configuration
PgBouncer *PgBouncerSpec `json:"pgbouncer"`
// The deployment strategy to use for pgbouncer to replace existing pods with new ones
// +optional
DeploymentStrategy *appsv1.DeploymentStrategy `json:"deploymentStrategy,omitempty"`
// The configuration of the monitoring infrastructure of this pooler.
//
// Deprecated: This feature will be removed in an upcoming release. If
// you need this functionality, you can create a PodMonitor manually.
// +optional
Monitoring *PoolerMonitoringConfiguration `json:"monitoring,omitempty"`
// Template for the Service to be created
// +optional
ServiceTemplate *ServiceTemplateSpec `json:"serviceTemplate,omitempty"`
}
PoolerSpec defines the desired state of Pooler
func (*PoolerSpec) DeepCopy ¶
func (in *PoolerSpec) DeepCopy() *PoolerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolerSpec.
func (*PoolerSpec) DeepCopyInto ¶
func (in *PoolerSpec) DeepCopyInto(out *PoolerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolerStatus ¶
type PoolerStatus struct {
// The resource version of the config object
// +optional
Secrets *PoolerSecrets `json:"secrets,omitempty"`
// The number of pods trying to be scheduled
// +optional
Instances int32 `json:"instances,omitempty"`
}
PoolerStatus defines the observed state of Pooler
func (*PoolerStatus) DeepCopy ¶
func (in *PoolerStatus) DeepCopy() *PoolerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolerStatus.
func (*PoolerStatus) DeepCopyInto ¶
func (in *PoolerStatus) DeepCopyInto(out *PoolerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PoolerType ¶
type PoolerType string
PoolerType is the type of the connection pool, meaning the service we are targeting. Allowed values are `rw` and `ro`. +kubebuilder:validation:Enum=rw;ro;r
type PostgresConfiguration ¶
type PostgresConfiguration struct {
// PostgreSQL configuration options (postgresql.conf)
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
// Configuration of the PostgreSQL synchronous replication feature
// +optional
Synchronous *SynchronousReplicaConfiguration `json:"synchronous,omitempty"`
// PostgreSQL Host Based Authentication rules (lines to be appended
// to the pg_hba.conf file)
// +optional
PgHBA []string `json:"pg_hba,omitempty"`
// PostgreSQL User Name Maps rules (lines to be appended
// to the pg_ident.conf file)
// +optional
PgIdent []string `json:"pg_ident,omitempty"`
// Requirements to be met by sync replicas. This will affect how the "synchronous_standby_names" parameter will be
// set up.
// +optional
SyncReplicaElectionConstraint SyncReplicaElectionConstraints `json:"syncReplicaElectionConstraint,omitempty"`
// Lists of shared preload libraries to add to the default ones
// +optional
AdditionalLibraries []string `json:"shared_preload_libraries,omitempty"`
// Options to specify LDAP configuration
// +optional
LDAP *LDAPConfig `json:"ldap,omitempty"`
// 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
// +optional
PgCtlTimeoutForPromotion int32 `json:"promotionTimeout,omitempty"`
// If this parameter is true, the user will be able to invoke `ALTER SYSTEM`
// on this CloudNativePG Cluster.
// This should only be used for debugging and troubleshooting.
// Defaults to false.
// +optional
EnableAlterSystem bool `json:"enableAlterSystem,omitempty"`
// The configuration of the extensions to be added
// +optional
Extensions []ExtensionConfiguration `json:"extensions,omitempty"`
}
PostgresConfiguration defines the PostgreSQL configuration
func (*PostgresConfiguration) DeepCopy ¶
func (in *PostgresConfiguration) DeepCopy() *PostgresConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConfiguration.
func (*PostgresConfiguration) DeepCopyInto ¶
func (in *PostgresConfiguration) DeepCopyInto(out *PostgresConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrimaryUpdateMethod ¶
type PrimaryUpdateMethod string
PrimaryUpdateMethod contains the method to use when upgrading the primary server of the cluster as part of rolling updates
type PrimaryUpdateStrategy ¶
type PrimaryUpdateStrategy string
PrimaryUpdateStrategy contains the strategy to follow when upgrading the primary server of the cluster as part of rolling updates
type Probe ¶ added in v1.23.6
type Probe struct {
// Number of seconds after the container has started before liveness probes are initiated.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
// Number of seconds after which the probe times out.
// Defaults to 1 second. Minimum value is 1.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe.
// Default to 10 seconds. Minimum value is 1.
// +optional
PeriodSeconds int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed.
// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
// +optional
SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
// Defaults to 3. Minimum value is 1.
// +optional
FailureThreshold int32 `json:"failureThreshold,omitempty"`
// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
// The grace period is the duration in seconds after the processes running in the pod are sent
// a termination signal and the time when the processes are forcibly halted with a kill signal.
// Set this value longer than the expected cleanup time for your process.
// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
// value overrides the value provided by the pod spec.
// Value must be non-negative integer. The value zero indicates stop immediately via
// the kill signal (no opportunity to shut down).
// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
// +optional
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
func (*Probe) ApplyInto ¶ added in v1.23.6
ApplyInto applies the content of the probe configuration in a Kubernetes probe
func (*Probe) DeepCopy ¶ added in v1.23.6
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe.
func (*Probe) DeepCopyInto ¶ added in v1.23.6
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProbeStrategyType ¶ added in v1.26.0
type ProbeStrategyType string
ProbeStrategyType is the type of the strategy used to declare a PostgreSQL instance ready
const ( // ProbeStrategyPgIsReady means that the pg_isready tool is used to determine // whether PostgreSQL is started up ProbeStrategyPgIsReady ProbeStrategyType = "pg_isready" // ProbeStrategyStreaming means that pg_isready is positive and the replica is // connected via streaming replication to the current primary and the lag is, if specified, // within the limit. ProbeStrategyStreaming ProbeStrategyType = "streaming" // ProbeStrategyQuery means that the server is able to connect to the superuser database // and able to execute a simple query like "-- ping" ProbeStrategyQuery ProbeStrategyType = "query" )
type ProbeWithStrategy ¶ added in v1.26.0
type ProbeWithStrategy struct {
// Probe is the standard probe configuration
Probe `json:",inline"`
// The probe strategy
// +kubebuilder:validation:Enum=pg_isready;streaming;query
// +optional
Type ProbeStrategyType `json:"type,omitempty"`
// Lag limit. Used only for `streaming` strategy
// +optional
MaximumLag *resource.Quantity `json:"maximumLag,omitempty"`
}
ProbeWithStrategy is the configuration of the startup probe
func (*ProbeWithStrategy) ApplyInto ¶ added in v1.26.0
func (p *ProbeWithStrategy) ApplyInto(k8sProbe *corev1.Probe)
ApplyInto applies the content of the probe configuration in a Kubernetes probe
func (*ProbeWithStrategy) DeepCopy ¶ added in v1.26.0
func (in *ProbeWithStrategy) DeepCopy() *ProbeWithStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeWithStrategy.
func (*ProbeWithStrategy) DeepCopyInto ¶ added in v1.26.0
func (in *ProbeWithStrategy) DeepCopyInto(out *ProbeWithStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProbesConfiguration ¶ added in v1.23.6
type ProbesConfiguration struct {
// The startup probe configuration
Startup *ProbeWithStrategy `json:"startup,omitempty"`
// The liveness probe configuration
Liveness *LivenessProbe `json:"liveness,omitempty"`
// The readiness probe configuration
Readiness *ProbeWithStrategy `json:"readiness,omitempty"`
}
ProbesConfiguration represent the configuration for the probes to be injected in the PostgreSQL Pods
func (*ProbesConfiguration) DeepCopy ¶ added in v1.23.6
func (in *ProbesConfiguration) DeepCopy() *ProbesConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbesConfiguration.
func (*ProbesConfiguration) DeepCopyInto ¶ added in v1.23.6
func (in *ProbesConfiguration) DeepCopyInto(out *ProbesConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Publication ¶ added in v1.25.0
type Publication struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec PublicationSpec `json:"spec"`
Status PublicationStatus `json:"status,omitempty"`
}
Publication is the Schema for the publications API
func (*Publication) DeepCopy ¶ added in v1.25.0
func (in *Publication) DeepCopy() *Publication
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Publication.
func (*Publication) DeepCopyInto ¶ added in v1.25.0
func (in *Publication) DeepCopyInto(out *Publication)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Publication) DeepCopyObject ¶ added in v1.25.0
func (in *Publication) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Publication) GetClusterRef ¶ added in v1.25.0
func (pub *Publication) GetClusterRef() corev1.LocalObjectReference
GetClusterRef returns the cluster reference of the publication
func (*Publication) GetManagedObjectName ¶ added in v1.25.0
func (pub *Publication) GetManagedObjectName() string
GetManagedObjectName returns the name of the managed publication object
func (*Publication) GetName ¶ added in v1.25.0
func (pub *Publication) GetName() string
GetName returns the publication name
func (*Publication) GetStatusMessage ¶ added in v1.25.0
func (pub *Publication) GetStatusMessage() string
GetStatusMessage returns the status message of the publication
func (*Publication) HasReconciliations ¶ added in v1.25.0
func (pub *Publication) HasReconciliations() bool
HasReconciliations returns true if the publication has been reconciled at least once
func (*Publication) SetAsFailed ¶ added in v1.25.0
func (pub *Publication) SetAsFailed(err error)
SetAsFailed sets the publication as failed with the given error
func (*Publication) SetAsReady ¶ added in v1.25.0
func (pub *Publication) SetAsReady()
SetAsReady sets the subscription as working correctly
func (*Publication) SetAsUnknown ¶ added in v1.25.0
func (pub *Publication) SetAsUnknown(err error)
SetAsUnknown sets the publication as unknown with the given error
func (*Publication) SetStatusObservedGeneration ¶ added in v1.25.1
func (pub *Publication) SetStatusObservedGeneration(obsGeneration int64)
SetStatusObservedGeneration sets the observed generation of the publication
type PublicationList ¶ added in v1.25.0
type PublicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Publication `json:"items"`
}
PublicationList contains a list of Publication
func (*PublicationList) DeepCopy ¶ added in v1.25.0
func (in *PublicationList) DeepCopy() *PublicationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicationList.
func (*PublicationList) DeepCopyInto ¶ added in v1.25.0
func (in *PublicationList) DeepCopyInto(out *PublicationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PublicationList) DeepCopyObject ¶ added in v1.25.0
func (in *PublicationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*PublicationList) MustHaveManagedResourceExclusivity ¶ added in v1.25.0
func (pub *PublicationList) MustHaveManagedResourceExclusivity(reference *Publication) error
MustHaveManagedResourceExclusivity detects conflicting publications
type PublicationReclaimPolicy ¶ added in v1.25.0
type PublicationReclaimPolicy string
PublicationReclaimPolicy defines a policy for end-of-life maintenance of Publications. +enum
const ( // PublicationReclaimDelete means the publication will be deleted from Kubernetes on release // from its claim. PublicationReclaimDelete PublicationReclaimPolicy = "delete" // PublicationReclaimRetain means the publication will be left in its current phase for manual // reclamation by the administrator. The default policy is Retain. PublicationReclaimRetain PublicationReclaimPolicy = "retain" )
type PublicationSpec ¶ added in v1.25.0
type PublicationSpec struct {
// The name of the PostgreSQL cluster that identifies the "publisher"
ClusterRef corev1.LocalObjectReference `json:"cluster"`
// The name of the publication inside PostgreSQL
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
Name string `json:"name"`
// The name of the database where the publication will be installed in
// the "publisher" cluster
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="dbname is immutable"
DBName string `json:"dbname"`
// Publication parameters part of the `WITH` clause as expected by
// PostgreSQL `CREATE PUBLICATION` command
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
// Target of the publication as expected by PostgreSQL `CREATE PUBLICATION` command
Target PublicationTarget `json:"target"`
// The policy for end-of-life maintenance of this publication
// +kubebuilder:validation:Enum=delete;retain
// +kubebuilder:default:=retain
// +optional
ReclaimPolicy PublicationReclaimPolicy `json:"publicationReclaimPolicy,omitempty"`
}
PublicationSpec defines the desired state of Publication
func (*PublicationSpec) DeepCopy ¶ added in v1.25.0
func (in *PublicationSpec) DeepCopy() *PublicationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicationSpec.
func (*PublicationSpec) DeepCopyInto ¶ added in v1.25.0
func (in *PublicationSpec) DeepCopyInto(out *PublicationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PublicationStatus ¶ added in v1.25.0
type PublicationStatus struct {
// A sequence number representing the latest
// desired state that was synchronized
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Applied is true if the publication was reconciled correctly
// +optional
Applied *bool `json:"applied,omitempty"`
// Message is the reconciliation output message
// +optional
Message string `json:"message,omitempty"`
}
PublicationStatus defines the observed state of Publication
func (*PublicationStatus) DeepCopy ¶ added in v1.25.0
func (in *PublicationStatus) DeepCopy() *PublicationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicationStatus.
func (*PublicationStatus) DeepCopyInto ¶ added in v1.25.0
func (in *PublicationStatus) DeepCopyInto(out *PublicationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PublicationTarget ¶ added in v1.25.0
type PublicationTarget struct {
// Marks the publication as one that replicates changes for all tables
// in the database, including tables created in the future.
// Corresponding to `FOR ALL TABLES` in PostgreSQL.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="allTables is immutable"
// +optional
AllTables bool `json:"allTables,omitempty"`
// Just the following schema objects
// +kubebuilder:validation:XValidation:rule="!(self.exists(o, has(o.table) && has(o.table.columns)) && self.exists(o, has(o.tablesInSchema)))",message="specifying a column list when the publication also publishes tablesInSchema is not supported"
// +kubebuilder:validation:MaxItems=100000
// +optional
Objects []PublicationTargetObject `json:"objects,omitempty"`
}
PublicationTarget is what this publication should publish +kubebuilder:validation:XValidation:rule="(has(self.allTables) && !has(self.objects)) || (!has(self.allTables) && has(self.objects))",message="allTables and objects are mutually exclusive"
func (*PublicationTarget) DeepCopy ¶ added in v1.25.0
func (in *PublicationTarget) DeepCopy() *PublicationTarget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicationTarget.
func (*PublicationTarget) DeepCopyInto ¶ added in v1.25.0
func (in *PublicationTarget) DeepCopyInto(out *PublicationTarget)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PublicationTargetObject ¶ added in v1.25.0
type PublicationTargetObject struct {
// Marks the publication as one that replicates changes for all tables
// in the specified list of schemas, including tables created in the
// future. Corresponding to `FOR TABLES IN SCHEMA` in PostgreSQL.
// +optional
TablesInSchema string `json:"tablesInSchema,omitempty"`
// Specifies a list of tables to add to the publication. Corresponding
// to `FOR TABLE` in PostgreSQL.
// +optional
Table *PublicationTargetTable `json:"table,omitempty"`
}
PublicationTargetObject is an object to publish +kubebuilder:validation:XValidation:rule="(has(self.tablesInSchema) && !has(self.table)) || (!has(self.tablesInSchema) && has(self.table))",message="tablesInSchema and table are mutually exclusive"
func (*PublicationTargetObject) DeepCopy ¶ added in v1.25.0
func (in *PublicationTargetObject) DeepCopy() *PublicationTargetObject
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicationTargetObject.
func (*PublicationTargetObject) DeepCopyInto ¶ added in v1.25.0
func (in *PublicationTargetObject) DeepCopyInto(out *PublicationTargetObject)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PublicationTargetTable ¶ added in v1.25.0
type PublicationTargetTable struct {
// Whether to limit to the table only or include all its descendants
// +optional
Only bool `json:"only,omitempty"`
// The table name
Name string `json:"name"`
// The schema name
// +optional
Schema string `json:"schema,omitempty"`
// The columns to publish
// +optional
Columns []string `json:"columns,omitempty"`
}
PublicationTargetTable is a table to publish
func (*PublicationTargetTable) DeepCopy ¶ added in v1.25.0
func (in *PublicationTargetTable) DeepCopy() *PublicationTargetTable
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicationTargetTable.
func (*PublicationTargetTable) DeepCopyInto ¶ added in v1.25.0
func (in *PublicationTargetTable) DeepCopyInto(out *PublicationTargetTable)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RecoveryTarget ¶
type RecoveryTarget struct {
// 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.
// +optional
BackupID string `json:"backupID,omitempty"`
// The target timeline ("latest" or a positive integer)
// +optional
TargetTLI string `json:"targetTLI,omitempty"`
// The target transaction ID
// +optional
TargetXID string `json:"targetXID,omitempty"`
// The target name (to be previously created
// with `pg_create_restore_point`)
// +optional
TargetName string `json:"targetName,omitempty"`
// The target LSN (Log Sequence Number)
// +optional
TargetLSN string `json:"targetLSN,omitempty"`
// The target time as a timestamp in the RFC3339 standard
// +optional
TargetTime string `json:"targetTime,omitempty"`
// End recovery as soon as a consistent state is reached
// +optional
TargetImmediate *bool `json:"targetImmediate,omitempty"`
// Set the target to be exclusive. If omitted, defaults to false, so that
// in Postgres, `recovery_target_inclusive` will be true
// +optional
Exclusive *bool `json:"exclusive,omitempty"`
}
RecoveryTarget allows to configure the moment where the recovery process will stop. All the target options except TargetTLI are mutually exclusive.
func (*RecoveryTarget) BuildPostgresOptions ¶
func (target *RecoveryTarget) BuildPostgresOptions() string
BuildPostgresOptions create the list of options that should be added to the PostgreSQL configuration to recover given a certain target
func (*RecoveryTarget) DeepCopy ¶
func (in *RecoveryTarget) DeepCopy() *RecoveryTarget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecoveryTarget.
func (*RecoveryTarget) DeepCopyInto ¶
func (in *RecoveryTarget) DeepCopyInto(out *RecoveryTarget)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RecoveryTarget) GetBackupID ¶ added in v1.23.5
func (target *RecoveryTarget) GetBackupID() string
GetBackupID gets the backup ID
func (*RecoveryTarget) GetTargetLSN ¶ added in v1.23.5
func (target *RecoveryTarget) GetTargetLSN() string
GetTargetLSN gets the target LSN
func (*RecoveryTarget) GetTargetTLI ¶ added in v1.23.5
func (target *RecoveryTarget) GetTargetTLI() string
GetTargetTLI gets the target timeline
func (*RecoveryTarget) GetTargetTime ¶ added in v1.23.5
func (target *RecoveryTarget) GetTargetTime() string
GetTargetTime gets the target time
type ReplicaClusterConfiguration ¶
type ReplicaClusterConfiguration struct {
// Self defines the name of this cluster. It is used to determine if this is a primary
// or a replica cluster, comparing it with `primary`
// +optional
Self string `json:"self,omitempty"`
// Primary defines which Cluster is defined to be the primary in the distributed PostgreSQL cluster, based on the
// topology specified in externalClusters
// +optional
Primary string `json:"primary,omitempty"`
// The name of the external cluster which is the replication origin
// +kubebuilder:validation:MinLength=1
Source string `json:"source"`
// 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.
// +optional
Enabled *bool `json:"enabled,omitempty"`
// A demotion token generated by an external cluster used to
// check if the promotion requirements are met.
// +optional
PromotionToken string `json:"promotionToken,omitempty"`
// When replica mode is enabled, this parameter allows you to replay
// transactions only when the system time is at least the configured
// time past the commit time. This provides an opportunity to correct
// data loss errors. Note that when this parameter is set, a promotion
// token cannot be used.
// +optional
MinApplyDelay *metav1.Duration `json:"minApplyDelay,omitempty"`
}
ReplicaClusterConfiguration encapsulates the configuration of a replica cluster
func (*ReplicaClusterConfiguration) DeepCopy ¶
func (in *ReplicaClusterConfiguration) DeepCopy() *ReplicaClusterConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaClusterConfiguration.
func (*ReplicaClusterConfiguration) DeepCopyInto ¶
func (in *ReplicaClusterConfiguration) DeepCopyInto(out *ReplicaClusterConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicationSlotsConfiguration ¶ added in v1.18.0
type ReplicationSlotsConfiguration struct {
// Replication slots for high availability configuration
// +kubebuilder:default:={"enabled": true}
// +optional
HighAvailability *ReplicationSlotsHAConfiguration `json:"highAvailability,omitempty"`
// Standby will update the status of the local replication slots
// every `updateInterval` seconds (default 30).
// +kubebuilder:default:=30
// +kubebuilder:validation:Minimum=1
// +optional
UpdateInterval int `json:"updateInterval,omitempty"`
// Configures the synchronization of the user defined physical replication slots
// +optional
SynchronizeReplicas *SynchronizeReplicasConfiguration `json:"synchronizeReplicas,omitempty"`
}
ReplicationSlotsConfiguration encapsulates the configuration of replication slots
func (*ReplicationSlotsConfiguration) DeepCopy ¶ added in v1.18.0
func (in *ReplicationSlotsConfiguration) DeepCopy() *ReplicationSlotsConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationSlotsConfiguration.
func (*ReplicationSlotsConfiguration) DeepCopyInto ¶ added in v1.18.0
func (in *ReplicationSlotsConfiguration) DeepCopyInto(out *ReplicationSlotsConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ReplicationSlotsConfiguration) GetEnabled ¶ added in v1.23.0
func (r *ReplicationSlotsConfiguration) GetEnabled() bool
GetEnabled returns false if replication slots are disabled, default is true
func (*ReplicationSlotsConfiguration) GetUpdateInterval ¶ added in v1.18.0
func (r *ReplicationSlotsConfiguration) GetUpdateInterval() time.Duration
GetUpdateInterval returns the update interval, defaulting to DefaultReplicationSlotsUpdateInterval if empty
type ReplicationSlotsHAConfiguration ¶ added in v1.18.0
type ReplicationSlotsHAConfiguration struct {
// 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.
// +optional
// +kubebuilder:default:=true
Enabled *bool `json:"enabled,omitempty"`
// 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_`.
// +kubebuilder:default:=_cnpg_
// +kubebuilder:validation:Pattern=^[0-9a-z_]*$
// +optional
SlotPrefix string `json:"slotPrefix,omitempty"`
// When enabled, the operator automatically manages synchronization of logical
// decoding (replication) slots across high-availability clusters.
//
// Requires one of the following conditions:
// - PostgreSQL version 17 or later
// - PostgreSQL version < 17 with pg_failover_slots extension enabled
//
// +optional
SynchronizeLogicalDecoding bool `json:"synchronizeLogicalDecoding,omitempty"`
}
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.
func (*ReplicationSlotsHAConfiguration) DeepCopy ¶ added in v1.18.0
func (in *ReplicationSlotsHAConfiguration) DeepCopy() *ReplicationSlotsHAConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationSlotsHAConfiguration.
func (*ReplicationSlotsHAConfiguration) DeepCopyInto ¶ added in v1.18.0
func (in *ReplicationSlotsHAConfiguration) DeepCopyInto(out *ReplicationSlotsHAConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ReplicationSlotsHAConfiguration) GetEnabled ¶ added in v1.18.4
func (r *ReplicationSlotsHAConfiguration) GetEnabled() bool
GetEnabled returns false if replication slots are disabled, default is true
func (*ReplicationSlotsHAConfiguration) GetSlotNameFromInstanceName ¶ added in v1.18.0
func (r *ReplicationSlotsHAConfiguration) GetSlotNameFromInstanceName(instanceName string) string
GetSlotNameFromInstanceName returns the slot name, given the instance name. It returns an empty string if High Availability Replication Slots are disabled
func (*ReplicationSlotsHAConfiguration) GetSlotPrefix ¶ added in v1.18.0
func (r *ReplicationSlotsHAConfiguration) GetSlotPrefix() string
GetSlotPrefix returns the HA slot prefix, defaulting to DefaultReplicationSlotsHASlotPrefix if empty
type RoleConfiguration ¶ added in v1.20.0
type RoleConfiguration struct {
// Name of the role
Name string `json:"name"`
// Description of the role
// +optional
Comment string `json:"comment,omitempty"`
// Ensure the role is `present` or `absent` - defaults to "present"
// +kubebuilder:default:="present"
// +kubebuilder:validation:Enum=present;absent
// +optional
Ensure EnsureOption `json:"ensure,omitempty"`
// Secret containing the password of the role (if present)
// If null, the password will be ignored unless DisablePassword is set
// +optional
PasswordSecret *LocalObjectReference `json:"passwordSecret,omitempty"`
// If the role can log in, this specifies how many concurrent
// connections the role can make. `-1` (the default) means no limit.
// +kubebuilder:default:=-1
// +optional
ConnectionLimit int64 `json:"connectionLimit,omitempty"`
// Date and time after which the role's password is no longer valid.
// When omitted, the password will never expire (default).
// +optional
ValidUntil *metav1.Time `json:"validUntil,omitempty"`
// List of one or more existing roles to which this role will be
// immediately added as a new member. Default empty.
// +optional
InRoles []string `json:"inRoles,omitempty"`
// Whether a role "inherits" the privileges of roles it is a member of.
// Defaults is `true`.
// +kubebuilder:default:=true
// +optional
Inherit *bool `json:"inherit,omitempty"` // IMPORTANT default is INHERIT
// DisablePassword indicates that a role's password should be set to NULL in Postgres
// +optional
DisablePassword bool `json:"disablePassword,omitempty"`
// 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`.
// +optional
Superuser bool `json:"superuser,omitempty"`
// 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.
// +optional
CreateDB bool `json:"createdb,omitempty"`
// 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`.
// +optional
CreateRole bool `json:"createrole,omitempty"`
// 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`.
// +optional
Login bool `json:"login,omitempty"`
// 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`.
// +optional
Replication bool `json:"replication,omitempty"`
// Whether a role bypasses every row-level security (RLS) policy.
// Default is `false`.
// +optional
BypassRLS bool `json:"bypassrls,omitempty"` // Row-Level Security
}
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
func (*RoleConfiguration) DeepCopy ¶ added in v1.20.0
func (in *RoleConfiguration) DeepCopy() *RoleConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleConfiguration.
func (*RoleConfiguration) DeepCopyInto ¶ added in v1.20.0
func (in *RoleConfiguration) DeepCopyInto(out *RoleConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RoleConfiguration) GetRoleInherit ¶ added in v1.20.0
func (roleConfiguration *RoleConfiguration) GetRoleInherit() bool
GetRoleInherit return the inherit attribute of a roleConfiguration
func (*RoleConfiguration) GetRoleSecretsName ¶ added in v1.20.0
func (roleConfiguration *RoleConfiguration) GetRoleSecretsName() string
GetRoleSecretsName gets the name of the secret which is used to store the role's password
type RoleStatus ¶ added in v1.20.0
type RoleStatus string
RoleStatus represents the status of a managed role in the cluster
const ( // RoleStatusReconciled indicates the role in DB matches the Spec RoleStatusReconciled RoleStatus = "reconciled" // RoleStatusNotManaged indicates the role is not in the Spec, therefore not managed RoleStatusNotManaged RoleStatus = "not-managed" // RoleStatusPendingReconciliation indicates the role in Spec requires updated/creation in DB RoleStatusPendingReconciliation RoleStatus = "pending-reconciliation" // RoleStatusReserved indicates this is one of the roles reserved by the operator. E.g. `postgres` RoleStatusReserved RoleStatus = "reserved" )
type S3Credentials ¶
type S3Credentials = barmanApi.S3Credentials
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 +kubebuilder:object:generate:=false
type SQLRefs ¶ added in v1.24.0
type SQLRefs struct {
// SecretRefs holds a list of references to Secrets
// +optional
SecretRefs []SecretKeySelector `json:"secretRefs,omitempty"`
// ConfigMapRefs holds a list of references to ConfigMaps
// +optional
ConfigMapRefs []ConfigMapKeySelector `json:"configMapRefs,omitempty"`
}
SQLRefs holds references to ConfigMaps or Secrets containing SQL files. The references are processed in a specific order: first, all Secrets are processed, followed by all ConfigMaps. Within each group, the processing order follows the sequence specified in their respective arrays.
func (*SQLRefs) DeepCopy ¶ added in v1.24.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SQLRefs.
func (*SQLRefs) DeepCopyInto ¶ added in v1.24.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SQLRefs) HasElements ¶ added in v1.24.0
HasElements returns true if it contains any Reference
type ScheduledBackup ¶
type ScheduledBackup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// 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
Spec ScheduledBackupSpec `json:"spec"`
// 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
// +optional
Status ScheduledBackupStatus `json:"status,omitempty"`
}
ScheduledBackup is the Schema for the scheduledbackups API
func (*ScheduledBackup) CreateBackup ¶
func (scheduledBackup *ScheduledBackup) CreateBackup(name string) *Backup
CreateBackup creates a backup from this scheduled backup
func (*ScheduledBackup) DeepCopy ¶
func (in *ScheduledBackup) DeepCopy() *ScheduledBackup
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledBackup.
func (*ScheduledBackup) DeepCopyInto ¶
func (in *ScheduledBackup) DeepCopyInto(out *ScheduledBackup)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ScheduledBackup) DeepCopyObject ¶
func (in *ScheduledBackup) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ScheduledBackup) GetName ¶
func (scheduledBackup *ScheduledBackup) GetName() string
GetName gets the scheduled backup name
func (*ScheduledBackup) GetNamespace ¶
func (scheduledBackup *ScheduledBackup) GetNamespace() string
GetNamespace gets the scheduled backup name
func (*ScheduledBackup) GetSchedule ¶
func (scheduledBackup *ScheduledBackup) GetSchedule() string
GetSchedule get the cron-like schedule of this scheduled backup
func (*ScheduledBackup) GetStatus ¶
func (scheduledBackup *ScheduledBackup) GetStatus() *ScheduledBackupStatus
GetStatus gets the status that the caller may update
func (ScheduledBackup) IsImmediate ¶
func (scheduledBackup ScheduledBackup) IsImmediate() bool
IsImmediate check if a backup has to be issued immediately upon creation or not
func (ScheduledBackup) IsSuspended ¶
func (scheduledBackup ScheduledBackup) IsSuspended() bool
IsSuspended check if a scheduled backup has been suspended or not
type ScheduledBackupList ¶
type ScheduledBackupList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// List of clusters
Items []ScheduledBackup `json:"items"`
}
ScheduledBackupList contains a list of ScheduledBackup
func (*ScheduledBackupList) DeepCopy ¶
func (in *ScheduledBackupList) DeepCopy() *ScheduledBackupList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledBackupList.
func (*ScheduledBackupList) DeepCopyInto ¶
func (in *ScheduledBackupList) DeepCopyInto(out *ScheduledBackupList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ScheduledBackupList) DeepCopyObject ¶
func (in *ScheduledBackupList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ScheduledBackupSpec ¶
type ScheduledBackupSpec struct {
// If this backup is suspended or not
// +optional
Suspend *bool `json:"suspend,omitempty"`
// If the first backup has to be immediately start after creation or not
// +optional
Immediate *bool `json:"immediate,omitempty"`
// 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
Schedule string `json:"schedule"`
// The cluster to backup
Cluster LocalObjectReference `json:"cluster"`
// Indicates which ownerReference should be put inside the created backup resources.<br />
// - none: no owner reference for created backup objects (same behavior as before the field was introduced)<br />
// - self: sets the Scheduled backup object as owner of the backup<br />
// - cluster: set the cluster as owner of the backup<br />
// +kubebuilder:validation:Enum=none;self;cluster
// +kubebuilder:default:=none
// +optional
BackupOwnerReference string `json:"backupOwnerReference,omitempty"`
// 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.
// +kubebuilder:validation:Enum=primary;prefer-standby
// +optional
Target BackupTarget `json:"target,omitempty"`
// The backup method to be used, possible options are `barmanObjectStore`,
// `volumeSnapshot` or `plugin`. Defaults to: `barmanObjectStore`.
// +optional
// +kubebuilder:validation:Enum=barmanObjectStore;volumeSnapshot;plugin
// +kubebuilder:default:=barmanObjectStore
Method BackupMethod `json:"method,omitempty"`
// Configuration parameters passed to the plugin managing this backup
// +optional
PluginConfiguration *BackupPluginConfiguration `json:"pluginConfiguration,omitempty"`
// Whether the default type of backup with volume snapshots is
// online/hot (`true`, default) or offline/cold (`false`)
// Overrides the default setting specified in the cluster field '.spec.backup.volumeSnapshot.online'
// +optional
Online *bool `json:"online,omitempty"`
// Configuration parameters to control the online/hot backup with volume snapshots
// Overrides the default settings specified in the cluster '.backup.volumeSnapshot.onlineConfiguration' stanza
// +optional
OnlineConfiguration *OnlineConfiguration `json:"onlineConfiguration,omitempty"`
}
ScheduledBackupSpec defines the desired state of ScheduledBackup
func (*ScheduledBackupSpec) DeepCopy ¶
func (in *ScheduledBackupSpec) DeepCopy() *ScheduledBackupSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledBackupSpec.
func (*ScheduledBackupSpec) DeepCopyInto ¶
func (in *ScheduledBackupSpec) DeepCopyInto(out *ScheduledBackupSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScheduledBackupStatus ¶
type ScheduledBackupStatus struct {
// The latest time the schedule
// +optional
LastCheckTime *metav1.Time `json:"lastCheckTime,omitempty"`
// Information when was the last time that backup was successfully scheduled.
// +optional
LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`
// Next time we will run a backup
// +optional
NextScheduleTime *metav1.Time `json:"nextScheduleTime,omitempty"`
}
ScheduledBackupStatus defines the observed state of ScheduledBackup
func (*ScheduledBackupStatus) DeepCopy ¶
func (in *ScheduledBackupStatus) DeepCopy() *ScheduledBackupStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledBackupStatus.
func (*ScheduledBackupStatus) DeepCopyInto ¶
func (in *ScheduledBackupStatus) DeepCopyInto(out *ScheduledBackupStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SchemaSpec ¶ added in v1.26.0
type SchemaSpec struct {
// Common fields
DatabaseObjectSpec `json:",inline"`
// The role name of the user who owns the schema inside PostgreSQL.
// It maps to the `AUTHORIZATION` parameter of `CREATE SCHEMA` and the
// `OWNER TO` command of `ALTER SCHEMA`.
Owner string `json:"owner,omitempty"`
}
SchemaSpec configures a schema in a database
func (*SchemaSpec) DeepCopy ¶ added in v1.26.0
func (in *SchemaSpec) DeepCopy() *SchemaSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaSpec.
func (*SchemaSpec) DeepCopyInto ¶ added in v1.26.0
func (in *SchemaSpec) DeepCopyInto(out *SchemaSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretKeySelector ¶
type SecretKeySelector = machineryapi.SecretKeySelector
SecretKeySelector contains enough information to let you locate the key of a Secret +kubebuilder:object:generate:=false
type SecretVersion ¶
type SecretVersion struct {
// The name of the secret
// +optional
Name string `json:"name,omitempty"`
// The ResourceVersion of the secret
// +optional
Version string `json:"version,omitempty"`
}
SecretVersion contains a secret name and its ResourceVersion
func (*SecretVersion) DeepCopy ¶
func (in *SecretVersion) DeepCopy() *SecretVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretVersion.
func (*SecretVersion) DeepCopyInto ¶
func (in *SecretVersion) DeepCopyInto(out *SecretVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretsResourceVersion ¶
type SecretsResourceVersion struct {
// The resource version of the "postgres" user secret
// +optional
SuperuserSecretVersion string `json:"superuserSecretVersion,omitempty"`
// The resource version of the "streaming_replica" user secret
// +optional
ReplicationSecretVersion string `json:"replicationSecretVersion,omitempty"`
// The resource version of the "app" user secret
// +optional
ApplicationSecretVersion string `json:"applicationSecretVersion,omitempty"`
// The resource versions of the managed roles secrets
// +optional
ManagedRoleSecretVersions map[string]string `json:"managedRoleSecretVersion,omitempty"`
// Unused. Retained for compatibility with old versions.
// +optional
CASecretVersion string `json:"caSecretVersion,omitempty"`
// The resource version of the PostgreSQL client-side CA secret version
// +optional
ClientCASecretVersion string `json:"clientCaSecretVersion,omitempty"`
// The resource version of the PostgreSQL server-side CA secret version
// +optional
ServerCASecretVersion string `json:"serverCaSecretVersion,omitempty"`
// The resource version of the PostgreSQL server-side secret version
// +optional
ServerSecretVersion string `json:"serverSecretVersion,omitempty"`
// The resource version of the Barman Endpoint CA if provided
// +optional
BarmanEndpointCA string `json:"barmanEndpointCA,omitempty"`
// The resource versions of the external cluster secrets
// +optional
ExternalClusterSecretVersions map[string]string `json:"externalClusterSecretVersion,omitempty"`
// A map with the versions of all the secrets used to pass metrics.
// Map keys are the secret names, map values are the versions
// +optional
Metrics map[string]string `json:"metrics,omitempty"`
}
SecretsResourceVersion is the resource versions of the secrets managed by the operator
func (*SecretsResourceVersion) DeepCopy ¶
func (in *SecretsResourceVersion) DeepCopy() *SecretsResourceVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsResourceVersion.
func (*SecretsResourceVersion) DeepCopyInto ¶
func (in *SecretsResourceVersion) DeepCopyInto(out *SecretsResourceVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SecretsResourceVersion) SetExternalClusterSecretVersion ¶ added in v1.20.5
func (secretResourceVersion *SecretsResourceVersion) SetExternalClusterSecretVersion( secretName string, version *string, )
SetExternalClusterSecretVersion Add or update or delete the resource version of the secret used in external clusters
func (*SecretsResourceVersion) SetManagedRoleSecretVersion ¶ added in v1.20.0
func (secretResourceVersion *SecretsResourceVersion) SetManagedRoleSecretVersion(secret string, version *string)
SetManagedRoleSecretVersion Add or update or delete the resource version of the managed role secret
type ServiceAccountTemplate ¶ added in v1.18.1
type ServiceAccountTemplate struct {
// Metadata are the metadata to be used for the generated
// service account
Metadata Metadata `json:"metadata"`
}
ServiceAccountTemplate contains the template needed to generate the service accounts
func (*ServiceAccountTemplate) DeepCopy ¶ added in v1.18.1
func (in *ServiceAccountTemplate) DeepCopy() *ServiceAccountTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountTemplate.
func (*ServiceAccountTemplate) DeepCopyInto ¶ added in v1.18.1
func (in *ServiceAccountTemplate) DeepCopyInto(out *ServiceAccountTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceAccountTemplate) MergeMetadata ¶ added in v1.18.1
func (st *ServiceAccountTemplate) MergeMetadata(sa *corev1.ServiceAccount)
MergeMetadata adds the passed custom annotations and labels in the service account.
type ServiceSelectorType ¶ added in v1.24.0
type ServiceSelectorType string
ServiceSelectorType describes a valid value for generating the service selectors. It indicates which type of service the selector applies to, such as read-write, read, or read-only +kubebuilder:validation:Enum=rw;r;ro
const ( // ServiceSelectorTypeRW selects the read-write service. ServiceSelectorTypeRW ServiceSelectorType = "rw" // ServiceSelectorTypeR selects the read service. ServiceSelectorTypeR ServiceSelectorType = "r" // ServiceSelectorTypeRO selects the read-only service. ServiceSelectorTypeRO ServiceSelectorType = "ro" )
Constants representing the valid values for ServiceSelectorType.
type ServiceTemplateSpec ¶ added in v1.23.0
type ServiceTemplateSpec struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
ObjectMeta Metadata `json:"metadata,omitempty"`
// Specification of the desired behavior of the service.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
// +optional
Spec corev1.ServiceSpec `json:"spec,omitempty"`
}
ServiceTemplateSpec is a structure allowing the user to set a template for Service generation.
func (*ServiceTemplateSpec) DeepCopy ¶ added in v1.23.0
func (in *ServiceTemplateSpec) DeepCopy() *ServiceTemplateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTemplateSpec.
func (*ServiceTemplateSpec) DeepCopyInto ¶ added in v1.23.0
func (in *ServiceTemplateSpec) DeepCopyInto(out *ServiceTemplateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceUpdateStrategy ¶ added in v1.24.0
type ServiceUpdateStrategy string
ServiceUpdateStrategy describes how the changes to the managed service should be handled +kubebuilder:validation:Enum=patch;replace
type SnapshotOwnerReference ¶ added in v1.21.0
type SnapshotOwnerReference string
SnapshotOwnerReference defines the reference type for the owner of the snapshot. This specifies which owner the processed resources should relate to.
const ( // ShapshotOwnerReferenceNone indicates that the snapshot does not have any owner reference. ShapshotOwnerReferenceNone SnapshotOwnerReference = "none" // SnapshotOwnerReferenceBackup indicates that the snapshot is owned by the backup resource. SnapshotOwnerReferenceBackup SnapshotOwnerReference = "backup" // SnapshotOwnerReferenceCluster indicates that the snapshot is owned by the cluster resource. SnapshotOwnerReferenceCluster SnapshotOwnerReference = "cluster" )
Constants to represent the allowed types for SnapshotOwnerReference.
type SnapshotType ¶ added in v1.16.0
type SnapshotType string
SnapshotType is a type of allowed import
const ( // MonolithSnapshotType indicates to execute the monolith clone typology MonolithSnapshotType SnapshotType = "monolith" // MicroserviceSnapshotType indicates to execute the microservice clone typology MicroserviceSnapshotType SnapshotType = "microservice" )
type StorageConfiguration ¶
type StorageConfiguration struct {
// StorageClass to use for PVCs. Applied after
// evaluating the PVC template, if available.
// If not specified, the generated PVCs will use the
// default storage class
// +optional
StorageClass *string `json:"storageClass,omitempty"`
// 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.
// +optional
Size string `json:"size,omitempty"`
// Resize existent PVCs, defaults to true
// +optional
// +kubebuilder:default:=true
ResizeInUseVolumes *bool `json:"resizeInUseVolumes,omitempty"`
// Template to be used to generate the Persistent Volume Claim
// +optional
PersistentVolumeClaimTemplate *corev1.PersistentVolumeClaimSpec `json:"pvcTemplate,omitempty"`
}
StorageConfiguration is the configuration used to create and reconcile PVCs, usable for WAL volumes, PGDATA volumes, or tablespaces
func (*StorageConfiguration) DeepCopy ¶
func (in *StorageConfiguration) DeepCopy() *StorageConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageConfiguration.
func (*StorageConfiguration) DeepCopyInto ¶
func (in *StorageConfiguration) DeepCopyInto(out *StorageConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*StorageConfiguration) GetSizeOrNil ¶ added in v1.17.4
func (s *StorageConfiguration) GetSizeOrNil() *resource.Quantity
GetSizeOrNil returns the requests storage size
type Subscription ¶ added in v1.25.0
type Subscription struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec SubscriptionSpec `json:"spec"`
Status SubscriptionStatus `json:"status,omitempty"`
}
Subscription is the Schema for the subscriptions API
func (*Subscription) DeepCopy ¶ added in v1.25.0
func (in *Subscription) DeepCopy() *Subscription
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subscription.
func (*Subscription) DeepCopyInto ¶ added in v1.25.0
func (in *Subscription) DeepCopyInto(out *Subscription)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Subscription) DeepCopyObject ¶ added in v1.25.0
func (in *Subscription) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Subscription) GetClusterRef ¶ added in v1.25.0
func (sub *Subscription) GetClusterRef() corev1.LocalObjectReference
GetClusterRef returns the cluster reference of the subscription
func (*Subscription) GetManagedObjectName ¶ added in v1.25.0
func (sub *Subscription) GetManagedObjectName() string
GetManagedObjectName returns the name of the managed subscription object
func (*Subscription) GetName ¶ added in v1.25.0
func (sub *Subscription) GetName() string
GetName returns the subscription object name
func (*Subscription) GetStatusMessage ¶ added in v1.25.0
func (sub *Subscription) GetStatusMessage() string
GetStatusMessage returns the status message of the subscription
func (*Subscription) HasReconciliations ¶ added in v1.25.0
func (sub *Subscription) HasReconciliations() bool
HasReconciliations returns true if the subscription has been reconciled at least once
func (*Subscription) SetAsFailed ¶ added in v1.25.0
func (sub *Subscription) SetAsFailed(err error)
SetAsFailed sets the subscription as failed with the given error
func (*Subscription) SetAsReady ¶ added in v1.25.0
func (sub *Subscription) SetAsReady()
SetAsReady sets the subscription as working correctly
func (*Subscription) SetAsUnknown ¶ added in v1.25.0
func (sub *Subscription) SetAsUnknown(err error)
SetAsUnknown sets the subscription as unknown with the given error
func (*Subscription) SetStatusObservedGeneration ¶ added in v1.25.1
func (sub *Subscription) SetStatusObservedGeneration(obsGeneration int64)
SetStatusObservedGeneration sets the observed generation of the subscription
type SubscriptionList ¶ added in v1.25.0
type SubscriptionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Subscription `json:"items"`
}
SubscriptionList contains a list of Subscription
func (*SubscriptionList) DeepCopy ¶ added in v1.25.0
func (in *SubscriptionList) DeepCopy() *SubscriptionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionList.
func (*SubscriptionList) DeepCopyInto ¶ added in v1.25.0
func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SubscriptionList) DeepCopyObject ¶ added in v1.25.0
func (in *SubscriptionList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*SubscriptionList) MustHaveManagedResourceExclusivity ¶ added in v1.25.0
func (pub *SubscriptionList) MustHaveManagedResourceExclusivity(reference *Subscription) error
MustHaveManagedResourceExclusivity detects conflicting subscriptions
type SubscriptionReclaimPolicy ¶ added in v1.25.0
type SubscriptionReclaimPolicy string
SubscriptionReclaimPolicy describes a policy for end-of-life maintenance of Subscriptions. +enum
const ( // SubscriptionReclaimDelete means the subscription will be deleted from Kubernetes on release // from its claim. SubscriptionReclaimDelete SubscriptionReclaimPolicy = "delete" // SubscriptionReclaimRetain means the subscription will be left in its current phase for manual // reclamation by the administrator. The default policy is Retain. SubscriptionReclaimRetain SubscriptionReclaimPolicy = "retain" )
type SubscriptionSpec ¶ added in v1.25.0
type SubscriptionSpec struct {
// The name of the PostgreSQL cluster that identifies the "subscriber"
ClusterRef corev1.LocalObjectReference `json:"cluster"`
// The name of the subscription inside PostgreSQL
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
Name string `json:"name"`
// The name of the database where the publication will be installed in
// the "subscriber" cluster
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="dbname is immutable"
DBName string `json:"dbname"`
// Subscription parameters included in the `WITH` clause of the PostgreSQL
// `CREATE SUBSCRIPTION` command. Most parameters cannot be changed
// after the subscription is created and will be ignored if modified
// later, except for a limited set documented at:
// https://www.postgresql.org/docs/current/sql-altersubscription.html#SQL-ALTERSUBSCRIPTION-PARAMS-SET
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
// The name of the publication inside the PostgreSQL database in the
// "publisher"
PublicationName string `json:"publicationName"`
// The name of the database containing the publication on the external
// cluster. Defaults to the one in the external cluster definition.
// +optional
PublicationDBName string `json:"publicationDBName,omitempty"`
// The name of the external cluster with the publication ("publisher")
ExternalClusterName string `json:"externalClusterName"`
// The policy for end-of-life maintenance of this subscription
// +kubebuilder:validation:Enum=delete;retain
// +kubebuilder:default:=retain
// +optional
ReclaimPolicy SubscriptionReclaimPolicy `json:"subscriptionReclaimPolicy,omitempty"`
}
SubscriptionSpec defines the desired state of Subscription
func (*SubscriptionSpec) DeepCopy ¶ added in v1.25.0
func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionSpec.
func (*SubscriptionSpec) DeepCopyInto ¶ added in v1.25.0
func (in *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SubscriptionStatus ¶ added in v1.25.0
type SubscriptionStatus struct {
// A sequence number representing the latest
// desired state that was synchronized
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Applied is true if the subscription was reconciled correctly
// +optional
Applied *bool `json:"applied,omitempty"`
// Message is the reconciliation output message
// +optional
Message string `json:"message,omitempty"`
}
SubscriptionStatus defines the observed state of Subscription
func (*SubscriptionStatus) DeepCopy ¶ added in v1.25.0
func (in *SubscriptionStatus) DeepCopy() *SubscriptionStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionStatus.
func (*SubscriptionStatus) DeepCopyInto ¶ added in v1.25.0
func (in *SubscriptionStatus) DeepCopyInto(out *SubscriptionStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SwitchReplicaClusterStatus ¶ added in v1.23.0
type SwitchReplicaClusterStatus struct {
// InProgress indicates if there is an ongoing procedure of switching a cluster to a replica cluster.
// +optional
InProgress bool `json:"inProgress,omitempty"`
}
SwitchReplicaClusterStatus contains all the statuses regarding the switch of a cluster to a replica cluster
func (*SwitchReplicaClusterStatus) DeepCopy ¶ added in v1.23.0
func (in *SwitchReplicaClusterStatus) DeepCopy() *SwitchReplicaClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SwitchReplicaClusterStatus.
func (*SwitchReplicaClusterStatus) DeepCopyInto ¶ added in v1.23.0
func (in *SwitchReplicaClusterStatus) DeepCopyInto(out *SwitchReplicaClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SyncReplicaElectionConstraints ¶ added in v1.16.0
type SyncReplicaElectionConstraints struct {
// A list of node labels values to extract and compare to evaluate if the pods reside in the same topology or not
// +optional
NodeLabelsAntiAffinity []string `json:"nodeLabelsAntiAffinity,omitempty"`
// This flag enables the constraints for sync replicas
Enabled bool `json:"enabled"`
}
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.
func (*SyncReplicaElectionConstraints) DeepCopy ¶ added in v1.16.0
func (in *SyncReplicaElectionConstraints) DeepCopy() *SyncReplicaElectionConstraints
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncReplicaElectionConstraints.
func (*SyncReplicaElectionConstraints) DeepCopyInto ¶ added in v1.16.0
func (in *SyncReplicaElectionConstraints) DeepCopyInto(out *SyncReplicaElectionConstraints)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SynchronizeReplicasConfiguration ¶ added in v1.23.0
type SynchronizeReplicasConfiguration struct {
// When set to true, every replication slot that is on the primary is synchronized on each standby
// +kubebuilder:default:=true
Enabled *bool `json:"enabled"`
// List of regular expression patterns to match the names of replication slots to be excluded (by default empty)
// +optional
ExcludePatterns []string `json:"excludePatterns,omitempty"`
}
SynchronizeReplicasConfiguration contains the configuration for the synchronization of user defined physical replication slots
func (*SynchronizeReplicasConfiguration) DeepCopy ¶ added in v1.23.0
func (in *SynchronizeReplicasConfiguration) DeepCopy() *SynchronizeReplicasConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SynchronizeReplicasConfiguration.
func (*SynchronizeReplicasConfiguration) DeepCopyInto ¶ added in v1.23.0
func (in *SynchronizeReplicasConfiguration) DeepCopyInto(out *SynchronizeReplicasConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SynchronizeReplicasConfiguration) GetEnabled ¶ added in v1.23.0
func (r *SynchronizeReplicasConfiguration) GetEnabled() bool
GetEnabled returns false if synchronized replication slots are disabled, defaults to true
func (*SynchronizeReplicasConfiguration) IsExcludedByUser ¶ added in v1.23.0
func (r *SynchronizeReplicasConfiguration) IsExcludedByUser(slotName string) (bool, error)
IsExcludedByUser returns if a replication slot should not be reconciled on the replicas
func (*SynchronizeReplicasConfiguration) ValidateRegex ¶ added in v1.24.3
func (r *SynchronizeReplicasConfiguration) ValidateRegex() error
ValidateRegex returns all the errors that happened during the regex compilation
type SynchronousReplicaConfiguration ¶ added in v1.24.0
type SynchronousReplicaConfiguration struct {
// Method to select synchronous replication standbys from the listed
// servers, accepting 'any' (quorum-based synchronous replication) or
// 'first' (priority-based synchronous replication) as values.
// +kubebuilder:validation:Enum=any;first
Method SynchronousReplicaConfigurationMethod `json:"method"`
// Specifies the number of synchronous standby servers that
// transactions must wait for responses from.
// +kubebuilder:validation:XValidation:rule="self > 0",message="The number of synchronous replicas should be greater than zero"
Number int `json:"number"`
// Specifies the maximum number of local cluster pods that can be
// automatically included in the `synchronous_standby_names` option in
// PostgreSQL.
// +optional
MaxStandbyNamesFromCluster *int `json:"maxStandbyNamesFromCluster,omitempty"`
// A user-defined list of application names to be added to
// `synchronous_standby_names` before local cluster pods (the order is
// only useful for priority-based synchronous replication).
// +optional
StandbyNamesPre []string `json:"standbyNamesPre,omitempty"`
// A user-defined list of application names to be added to
// `synchronous_standby_names` after local cluster pods (the order is
// only useful for priority-based synchronous replication).
// +optional
StandbyNamesPost []string `json:"standbyNamesPost,omitempty"`
// If set to "required", data durability is strictly enforced. Write operations
// with synchronous commit settings (`on`, `remote_write`, or `remote_apply`) will
// block if there are insufficient healthy replicas, ensuring data persistence.
// If set to "preferred", data durability is maintained when healthy replicas
// are available, but the required number of instances will adjust dynamically
// if replicas become unavailable. This setting relaxes strict durability enforcement
// to allow for operational continuity. This setting is only applicable if both
// `standbyNamesPre` and `standbyNamesPost` are unset (empty).
// +kubebuilder:validation:Enum=required;preferred
// +optional
DataDurability DataDurabilityLevel `json:"dataDurability,omitempty"`
}
SynchronousReplicaConfiguration contains the configuration of the PostgreSQL synchronous replication feature. Important: at this moment, also `.spec.minSyncReplicas` and `.spec.maxSyncReplicas` need to be considered. +kubebuilder:validation:XValidation:rule="self.dataDurability!='preferred' || ((!has(self.standbyNamesPre) || self.standbyNamesPre.size()==0) && (!has(self.standbyNamesPost) || self.standbyNamesPost.size()==0))",message="dataDurability set to 'preferred' requires empty 'standbyNamesPre' and empty 'standbyNamesPost'"
func (*SynchronousReplicaConfiguration) DeepCopy ¶ added in v1.24.0
func (in *SynchronousReplicaConfiguration) DeepCopy() *SynchronousReplicaConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SynchronousReplicaConfiguration.
func (*SynchronousReplicaConfiguration) DeepCopyInto ¶ added in v1.24.0
func (in *SynchronousReplicaConfiguration) DeepCopyInto(out *SynchronousReplicaConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SynchronousReplicaConfigurationMethod ¶ added in v1.24.0
type SynchronousReplicaConfigurationMethod string
SynchronousReplicaConfigurationMethod configures whether to use quorum based replication or a priority list
func (SynchronousReplicaConfigurationMethod) ToPostgreSQLConfigurationKeyword ¶ added in v1.24.0
func (s SynchronousReplicaConfigurationMethod) ToPostgreSQLConfigurationKeyword() string
ToPostgreSQLConfigurationKeyword returns the contained value as a valid PostgreSQL parameter to be injected in the 'synchronous_standby_names' field
type TablespaceConfiguration ¶ added in v1.22.0
type TablespaceConfiguration struct {
// The name of the tablespace
Name string `json:"name"`
// The storage configuration for the tablespace
Storage StorageConfiguration `json:"storage"`
// Owner is the PostgreSQL user owning the tablespace
// +optional
Owner DatabaseRoleRef `json:"owner,omitempty"`
// When set to true, the tablespace will be added as a `temp_tablespaces`
// entry in PostgreSQL, and will be available to automatically house temp
// database objects, or other temporary files. Please refer to PostgreSQL
// documentation for more information on the `temp_tablespaces` GUC.
// +optional
// +kubebuilder:default:=false
Temporary bool `json:"temporary,omitempty"`
}
TablespaceConfiguration is the configuration of a tablespace, and includes the storage specification for the tablespace
func (*TablespaceConfiguration) DeepCopy ¶ added in v1.22.0
func (in *TablespaceConfiguration) DeepCopy() *TablespaceConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TablespaceConfiguration.
func (*TablespaceConfiguration) DeepCopyInto ¶ added in v1.22.0
func (in *TablespaceConfiguration) DeepCopyInto(out *TablespaceConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TablespaceState ¶ added in v1.22.0
type TablespaceState struct {
// Name is the name of the tablespace
Name string `json:"name"`
// Owner is the PostgreSQL user owning the tablespace
// +optional
Owner string `json:"owner,omitempty"`
// State is the latest reconciliation state
State TablespaceStatus `json:"state"`
// Error is the reconciliation error, if any
// +optional
Error string `json:"error,omitempty"`
}
TablespaceState represents the state of a tablespace in a cluster
func (*TablespaceState) DeepCopy ¶ added in v1.22.0
func (in *TablespaceState) DeepCopy() *TablespaceState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TablespaceState.
func (*TablespaceState) DeepCopyInto ¶ added in v1.22.0
func (in *TablespaceState) DeepCopyInto(out *TablespaceState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TablespaceStatus ¶ added in v1.22.0
type TablespaceStatus string
TablespaceStatus represents the status of a tablespace in the cluster
const ( // TablespaceStatusReconciled indicates the tablespace in DB matches the Spec TablespaceStatusReconciled TablespaceStatus = "reconciled" // TablespaceStatusPendingReconciliation indicates the tablespace in Spec requires creation in the DB TablespaceStatusPendingReconciliation TablespaceStatus = "pending" )
type Topology ¶ added in v1.16.0
type Topology struct {
// Instances contains the pod topology of the instances
// +optional
Instances map[PodName]PodTopologyLabels `json:"instances,omitempty"`
// 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.
// +optional
NodesUsed int32 `json:"nodesUsed,omitempty"`
// SuccessfullyExtracted indicates if the topology data was extract. It is useful to enact fallback behaviors
// in synchronous replica election in case of failures
// +optional
SuccessfullyExtracted bool `json:"successfullyExtracted,omitempty"`
}
Topology contains the cluster topology
func (*Topology) DeepCopy ¶ added in v1.16.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology.
func (*Topology) DeepCopyInto ¶ added in v1.16.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VolumeSnapshotConfiguration ¶ added in v1.21.0
type VolumeSnapshotConfiguration struct {
// Labels are key-value pairs that will be added to .metadata.labels snapshot resources.
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Annotations key-value pairs that will be added to .metadata.annotations snapshot resources.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// 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
// +optional
ClassName string `json:"className,omitempty"`
// WalClassName specifies the Snapshot Class to be used for the PG_WAL PersistentVolumeClaim.
// +optional
WalClassName string `json:"walClassName,omitempty"`
// TablespaceClassName specifies the Snapshot Class to be used for the tablespaces.
// defaults to the PGDATA Snapshot Class, if set
// +optional
TablespaceClassName map[string]string `json:"tablespaceClassName,omitempty"`
// SnapshotOwnerReference indicates the type of owner reference the snapshot should have
// +optional
// +kubebuilder:validation:Enum:=none;cluster;backup
// +kubebuilder:default:=none
SnapshotOwnerReference SnapshotOwnerReference `json:"snapshotOwnerReference,omitempty"`
// Whether the default type of backup with volume snapshots is
// online/hot (`true`, default) or offline/cold (`false`)
// +optional
// +kubebuilder:default:=true
Online *bool `json:"online,omitempty"`
// Configuration parameters to control the online/hot backup with volume snapshots
// +kubebuilder:default:={waitForArchive:true,immediateCheckpoint:false}
// +optional
OnlineConfiguration OnlineConfiguration `json:"onlineConfiguration,omitempty"`
}
VolumeSnapshotConfiguration represents the configuration for the execution of snapshot backups.
func (*VolumeSnapshotConfiguration) DeepCopy ¶ added in v1.21.0
func (in *VolumeSnapshotConfiguration) DeepCopy() *VolumeSnapshotConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotConfiguration.
func (*VolumeSnapshotConfiguration) DeepCopyInto ¶ added in v1.21.0
func (in *VolumeSnapshotConfiguration) DeepCopyInto(out *VolumeSnapshotConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VolumeSnapshotConfiguration) GetOnline ¶ added in v1.21.1
func (configuration *VolumeSnapshotConfiguration) GetOnline() bool
GetOnline tells whether this volume snapshot configuration allows online backups
type WalBackupConfiguration ¶
type WalBackupConfiguration = barmanApi.WalBackupConfiguration
WalBackupConfiguration is the configuration of the backup of the WAL stream +kubebuilder:object:generate:=false
Source Files
¶
- backup_funcs.go
- backup_types.go
- base_funcs.go
- base_types.go
- cluster_conditions.go
- cluster_defaults.go
- cluster_funcs.go
- cluster_types.go
- clusterimagecatalog_funcs.go
- clusterimagecatalog_types.go
- common_types.go
- database_funcs.go
- database_types.go
- doc.go
- failoverquorum_types.go
- generic_funcs.go
- genericimagecatalog_iface.go
- groupversion_info.go
- imagecatalog_funcs.go
- imagecatalog_types.go
- pooler_funcs.go
- pooler_types.go
- publication_funcs.go
- publication_types.go
- scheduledbackup_funcs.go
- scheduledbackup_types.go
- subscription_funcs.go
- subscription_types.go
- zz_generated.deepcopy.go