v2

package
v3.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true +groupName=pgv2.percona.com

Index

Constants

View Source
const (
	PGBackrestAnnotationBackupName = "percona.com/backup-name"
	PGBackrestAnnotationJobName    = "percona.com/backup-job-name"
	PGBackrestAnnotationJobType    = "percona.com/backup-job-type"
)
View Source
const (
	PostgresDistributionPercona   = "percona"
	PostgresDistributionCommunity = "community"
)

PostgreSQL distribution values reported in PostgresStatus.Distribution.

View Source
const (
	// LogicalReplicaReasonSourceSlotMissing means the replication slot backing
	// this replica is gone from the primary. A slot lives only on the primary
	// that created it, so a failover is the most common cause.
	LogicalReplicaReasonSourceSlotMissing = "SourceSlotMissing"

	LogicalReplicaReasonSubscriptionDisabled = "SubscriptionDisabled"

	// LogicalReplicaReasonApplyWorkerDown means a subscription is enabled but has
	// no running apply worker, usually because it cannot reach the primary. It
	// retries forever without disabling the subscription, so nothing else shows
	// that replication has stopped.
	LogicalReplicaReasonApplyWorkerDown = "ApplyWorkerDown"

	LogicalReplicaReasonBootstrapFailed = "BootstrapFailed"
	LogicalReplicaReasonPodNotFound     = "LogicalReplicaPodNotFound"

	// LogicalReplicaReasonPrimaryNotReady means the primary does not yet carry
	// everything the bootstrap needs; the ReadyForLogicalReplication condition
	// says which prerequisite is missing.
	LogicalReplicaReasonPrimaryNotReady = "PrimaryNotReady"

	LogicalReplicaReasonClusterPaused = "ClusterPaused"

	LogicalReplicaReasonSourceRestoring = "SourceRestoring"

	// LogicalReplicaReasonSourceRestored means the data directory this replica was
	// seeded from has been replaced by a restore. The replication slots went with
	// it - pgBackRest does not back up pg_replslot - and a point-in-time restore
	// has rewound the primary past changes the replica already applied, so nothing
	// short of seeding it again fixes it.
	LogicalReplicaReasonSourceRestored = "SourceRestored"

	// LogicalReplicaReasonSourceUpgraded means the cluster went through a major
	// version upgrade after this replica was seeded.
	LogicalReplicaReasonSourceUpgraded = "SourceUpgraded"

	// LogicalReplicaReasonWaitingForDataVolume means the data volume of an
	// earlier incarnation of this replica is still being deleted.
	LogicalReplicaReasonWaitingForDataVolume = "WaitingForDataVolume"

	// LogicalReplicaReasonWaitingForDatabases means the databases this replica
	// would replicate do not exist on the primary yet. The set is frozen for the
	// replica's lifetime, so it waits rather than seeding from a partial list.
	LogicalReplicaReasonWaitingForDatabases = "WaitingForDatabases"

	// LogicalReplicaReasonAwaitingCleanup means the replica has been removed from
	// the spec but its objects on the primary could not be dropped yet. Its status
	// is kept until they are: forgetting it leaks a slot that pins WAL.
	LogicalReplicaReasonAwaitingCleanup = "AwaitingCleanup"
)
View Source
const (
	LabelOperatorVersion = labelPrefix + "version"
	LabelPMMSecret       = labelPrefix + "pmm-secret"
)
View Source
const (
	UserMonitoring = "monitor"

	// UserLogicalReplication is the reserved superuser that pg_createsubscriber
	// connects to the primary as, and that the replica streams as. It only exists
	// while the cluster has at least one logical replica.
	UserLogicalReplication = "logicalrepl"
)
View Source
const AnnotationAllowUpgrade = "pgv2.percona.com/allow-upgrade"
View Source
const (
	ConditionBackupLeaseAcquired = "BackupLeaseAcquired"
)
View Source
const ConditionPMMReady = "PMMReady"

ConditionPMMReady indicates whether the PMM sidecar is configured for the cluster. It is False when PMM is enabled but misconfigured (e.g. the secret is missing or doesn't contain PMM_SERVER_TOKEN).

View Source
const IndexFieldEnvFromSecrets = "pgCluster.envFromSecrets" //nolint:gosec
View Source
const IndexFieldLogRotateExtraConfig = "pgCluster.logRotateExtraConfig"
View Source
const IndexFieldPGBouncerUserSecrets = "pgCluster.pgBouncerUserSecrets" //nolint:gosec
View Source
const IndexFieldPGCluster = "spec.pgCluster"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "pgv2.percona.com", Version: "v2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} //nolint:staticcheck

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var EnvFromSecretsIndexerFunc client.IndexerFunc = func(obj client.Object) []string {
	cr, ok := obj.(*PerconaPGCluster)
	if !ok {
		return nil
	}
	return cr.EnvFromSecrets()
}
View Source
var LogRotateExtraConfigIndexerFunc client.IndexerFunc = func(obj client.Object) []string {
	cr, ok := obj.(*PerconaPGCluster)
	if !ok {
		return nil
	}
	return cr.LogRotateExtraConfigMaps()
}
View Source
var PGBouncerUserSecretsIndexerFunc client.IndexerFunc = func(obj client.Object) []string {
	cr, ok := obj.(*PerconaPGCluster)
	if !ok {
		return nil
	}
	return cr.PGBouncerUserSecrets()
}
View Source
var PGClusterIndexerFunc client.IndexerFunc = func(obj client.Object) []string {
	backup, ok := obj.(*PerconaPGBackup)
	if !ok {
		return nil
	}

	return []string{backup.Spec.PGCluster}
}

Functions

This section is empty.

Types

type AppState

type AppState string
const (
	AppStateInit     AppState = "initializing"
	AppStatePaused   AppState = "paused"
	AppStateStopping AppState = "stopping"
	AppStateReady    AppState = "ready"
)

type BackupMethod

type BackupMethod string
const (
	BackupMethodPGBackrest     BackupMethod = "pgbackrest"
	BackupMethodVolumeSnapshot BackupMethod = "volumeSnapshot"
)

type Backups

type Backups struct {
	// Enabled controls whether backups are enabled for the cluster.
	// Defaulted to true by the operator for crVersion >= 3.1.0.
	// +optional
	Enabled *bool `json:"enabled,omitempty"`

	// pgBackRest archive configuration
	// +optional
	PGBackRest PGBackRestArchive `json:"pgbackrest"`

	// Enable tracking latest restorable time
	TrackLatestRestorableTime *bool `json:"trackLatestRestorableTime,omitempty"`

	// VolumeSnapshots configuration
	// +optional
	VolumeSnapshots *VolumeSnapshots `json:"volumeSnapshots,omitempty"`
}

Backups struct. +kubebuilder:validation:XValidation:rule="(has(self.enabled) && self.enabled == false) || (has(self.pgbackrest.repos) && size(self.pgbackrest.repos) > 0)",message="At least one repository must be configured when backups are enabled"

func (*Backups) DeepCopy

func (in *Backups) DeepCopy() *Backups

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backups.

func (*Backups) DeepCopyInto

func (in *Backups) DeepCopyInto(out *Backups)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Backups) IsEnabled

func (b Backups) IsEnabled() bool

func (Backups) IsVolumeSnapshotsEnabled

func (b Backups) IsVolumeSnapshotsEnabled() bool

func (Backups) ToCrunchy

func (b Backups) ToCrunchy(version string) crunchyv1beta1.Backups

type BuiltInExtensionSpec

type BuiltInExtensionSpec struct {
	Enabled *bool `json:"enabled,omitempty"`
}

func (*BuiltInExtensionSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuiltInExtensionSpec.

func (*BuiltInExtensionSpec) DeepCopyInto

func (in *BuiltInExtensionSpec) DeepCopyInto(out *BuiltInExtensionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BuiltInExtensionsSpec

type BuiltInExtensionsSpec struct {
	PGStatMonitor    *bool `json:"pg_stat_monitor,omitempty"`
	PGStatStatements *bool `json:"pg_stat_statements,omitempty"`
	PGAudit          *bool `json:"pg_audit,omitempty"`
	PGVector         *bool `json:"pgvector,omitempty"`
	PGRepack         *bool `json:"pg_repack,omitempty"`
}

func (*BuiltInExtensionsSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuiltInExtensionsSpec.

func (*BuiltInExtensionsSpec) DeepCopyInto

func (in *BuiltInExtensionsSpec) DeepCopyInto(out *BuiltInExtensionsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CheckpointConfig

type CheckpointConfig struct {
	// If set, a checkpoint is requested.
	// +optional
	// +kubebuilder:default=true
	Enabled *bool `json:"enabled,omitempty"`

	// Timeout for the checkpoint operation.
	// Ignored if checkpoint is not enabled.
	// +optional
	// +kubebuilder:validation:Minimum=30
	// +kubebuilder:default=300
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
}

func (*CheckpointConfig) DeepCopy

func (in *CheckpointConfig) DeepCopy() *CheckpointConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointConfig.

func (*CheckpointConfig) DeepCopyInto

func (in *CheckpointConfig) DeepCopyInto(out *CheckpointConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ContainerOptions

type ContainerOptions struct {
	Env     []corev1.EnvVar        `json:"env,omitempty"`
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
}

func (*ContainerOptions) DeepCopy

func (in *ContainerOptions) DeepCopy() *ContainerOptions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerOptions.

func (*ContainerOptions) DeepCopyInto

func (in *ContainerOptions) DeepCopyInto(out *ContainerOptions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CustomExtensionSpec

type CustomExtensionSpec struct {
	Name     string `json:"name,omitempty"`
	Version  string `json:"version,omitempty"`
	Checksum string `json:"checksum,omitempty"`
}

func (*CustomExtensionSpec) DeepCopy

func (in *CustomExtensionSpec) DeepCopy() *CustomExtensionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomExtensionSpec.

func (*CustomExtensionSpec) DeepCopyInto

func (in *CustomExtensionSpec) DeepCopyInto(out *CustomExtensionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CustomExtensionsStorageSpec

type CustomExtensionsStorageSpec struct {
	// +kubebuilder:validation:Enum={s3,gcs,azure}
	Type           string                   `json:"type,omitempty"`
	Bucket         string                   `json:"bucket,omitempty"`
	Region         string                   `json:"region,omitempty"`
	Endpoint       string                   `json:"endpoint,omitempty"`
	ForcePathStyle bool                     `json:"forcePathStyle,omitempty"`
	DisableSSL     bool                     `json:"disableSSL,omitempty"`
	Secret         *corev1.SecretProjection `json:"secret,omitempty"`
}

func (*CustomExtensionsStorageSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomExtensionsStorageSpec.

func (*CustomExtensionsStorageSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtensionsSpec

type ExtensionsSpec struct {
	Image           string                      `json:"image,omitempty"`
	ImagePullPolicy corev1.PullPolicy           `json:"imagePullPolicy,omitempty"`
	Storage         CustomExtensionsStorageSpec `json:"storage,omitempty"`

	// Deprecated: Use extensions.<extension> instead. This field will be removed after 3.4.0.
	BuiltIn BuiltInExtensionsSpec `json:"builtin,omitempty"`

	PGStatMonitor    BuiltInExtensionSpec     `json:"pg_stat_monitor,omitempty"`
	PGStatStatements BuiltInExtensionSpec     `json:"pg_stat_statements,omitempty"`
	PGAudit          BuiltInExtensionSpec     `json:"pg_audit,omitempty"`
	PGVector         BuiltInExtensionSpec     `json:"pgvector,omitempty"`
	PGRepack         BuiltInExtensionSpec     `json:"pg_repack,omitempty"`
	PGCron           BuiltInExtensionSpec     `json:"pg_cron,omitempty"`
	SetUser          BuiltInExtensionSpec     `json:"set_user,omitempty"`
	PGTDE            crunchyv1beta1.PGTDESpec `json:"pg_tde,omitempty"`

	Custom []CustomExtensionSpec `json:"custom,omitempty"`
}

+kubebuilder:validation:XValidation:rule="!has(oldSelf.pg_tde) || !has(oldSelf.pg_tde.vault) || !has(oldSelf.pg_tde.enabled) || !oldSelf.pg_tde.enabled || has(self.pg_tde.vault)",message="to disable pg_tde first set enabled=false without removing vault and wait for pod restarts"

func (*ExtensionsSpec) DeepCopy

func (in *ExtensionsSpec) DeepCopy() *ExtensionsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionsSpec.

func (*ExtensionsSpec) DeepCopyInto

func (in *ExtensionsSpec) DeepCopyInto(out *ExtensionsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogCollectorSpec

type LogCollectorSpec struct {
	// Enabled turns the log collector on or off. When unset, it defaults to on
	// for new clusters and off for existing ones.
	// +optional
	Enabled *bool `json:"enabled,omitempty"`

	// +kubebuilder:validation:Required
	Image string `json:"image"`

	// +kubebuilder:validation:Enum={Always,Never,IfNotPresent}
	// +optional
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// Custom Fluent Bit configuration, merged into the log collector pipeline.
	// Must be in Fluent Bit's YAML configuration format (the classic ".conf"
	// format is not supported); this is what enables YAML-only features such as
	// pipeline processors (e.g. opentelemetry_envelope). Invalid configuration
	// is ignored by the collector at startup.
	// +optional
	Configuration string `json:"configuration,omitempty"`

	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// +optional
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// +optional
	ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`

	// LivenessProbe sets the liveness probe for the fluent-bit log collector
	// container. When not set, the container has no liveness probe.
	// +optional
	LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`

	// ReadinessProbe sets the readiness probe for the fluent-bit log collector
	// container. When not set, the container has no readiness probe.
	// +optional
	ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`

	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	// +optional
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// +optional
	LogRotate *LogRotateSpec `json:"logRotate,omitempty"`
}

func (*LogCollectorSpec) DeepCopy

func (in *LogCollectorSpec) DeepCopy() *LogCollectorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogCollectorSpec.

func (*LogCollectorSpec) DeepCopyInto

func (in *LogCollectorSpec) DeepCopyInto(out *LogCollectorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogRotateSpec

type LogRotateSpec struct {
	// Configuration allows overriding the default logrotate configuration.
	// +optional
	Configuration string `json:"configuration,omitempty"`

	// ExtraConfig allows specifying logrotate configuration files in addition to
	// the main configuration file. This should be a reference to a ConfigMap in
	// the same namespace. Keys must contain the .conf extension to be processed
	// correctly.
	// +optional
	ExtraConfig corev1.LocalObjectReference `json:"extraConfig,omitempty"`

	// Schedule is the cron schedule on which logrotate runs.
	// +kubebuilder:default="0 0 * * *"
	// +optional
	Schedule string `json:"schedule,omitempty"`

	// LivenessProbe sets the liveness probe for the logrotate container.
	// When not set, the container has no liveness probe.
	// +optional
	LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`

	// ReadinessProbe sets the readiness probe for the logrotate container.
	// When not set, the container has no readiness probe.
	// +optional
	ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
}

func (*LogRotateSpec) DeepCopy

func (in *LogRotateSpec) DeepCopy() *LogRotateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogRotateSpec.

func (*LogRotateSpec) DeepCopyInto

func (in *LogRotateSpec) DeepCopyInto(out *LogRotateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogicalReplicaBootstrapMethod

type LogicalReplicaBootstrapMethod string

LogicalReplicaBootstrapMethod selects how the data volume of a logical replica is seeded with a physical copy of the primary, before pg_createsubscriber converts it into a subscriber.

const (
	LogicalReplicaBootstrapMethodPGBackRest   LogicalReplicaBootstrapMethod = "pgbackrest"
	LogicalReplicaBootstrapMethodPGBaseBackup LogicalReplicaBootstrapMethod = "pg_basebackup"
)

type LogicalReplicaSpec

type LogicalReplicaSpec struct {
	// Name of the logical replica. It is used to name the StatefulSet, Service
	// and PersistentVolumeClaim of the replica, as well as the publications,
	// subscriptions and replication slots backing it.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=20
	// +kubebuilder:validation:Pattern=`^[a-z][a-z0-9-]*[a-z0-9]$`
	Name string `json:"name"`

	// Databases to replicate. When empty, every database in the cluster except
	// the templates and "postgres" is replicated.
	// +listType=set
	// +optional
	Databases []crunchyv1beta1.PostgresIdentifier `json:"databases,omitempty"`

	// BootstrapMethod selects how the data volume is seeded before
	// pg_createsubscriber converts it into a subscriber.
	//
	// "pgbackrest" restores the cluster's most recent backup and puts no load on
	// the primary. "pg_basebackup" streams a fresh copy straight from the
	// primary and needs no pgBackRest repository, which is the only option when
	// spec.backups.enabled is false.
	//
	// It is only read while the replica is being bootstrapped; changing it on a
	// replica that already exists has no effect.
	// +kubebuilder:validation:Enum={pgbackrest,pg_basebackup}
	// +kubebuilder:default=pgbackrest
	// +optional
	BootstrapMethod LogicalReplicaBootstrapMethod `json:"bootstrapMethod,omitempty"`

	// Defines the data volume of the logical replica.
	// +kubebuilder:validation:Required
	DataVolumeClaimSpec corev1.PersistentVolumeClaimSpec `json:"dataVolumeClaimSpec"`

	// +optional
	Metadata *crunchyv1beta1.Metadata `json:"metadata,omitempty"`

	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Specification of the service that exposes this logical replica.
	// +optional
	Expose *ServiceExpose `json:"expose,omitempty"`

	// StartupProbe sets the startup probe for the logical replica container.
	// +optional
	StartupProbe *corev1.Probe `json:"startupProbe,omitempty"`

	// LivenessProbe sets the liveness probe for the logical replica container.
	// +optional
	LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`

	// ReadinessProbe sets the readiness probe for the logical replica container.
	// +optional
	ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
}

func (*LogicalReplicaSpec) BootstrapMethodOrDefault

func (s *LogicalReplicaSpec) BootstrapMethodOrDefault() LogicalReplicaBootstrapMethod

BootstrapMethodOrDefault returns the method the data volume of the replica is seeded with. The field carries a CRD default, so this only matters for a spec the API server has not defaulted.

func (*LogicalReplicaSpec) DeepCopy

func (in *LogicalReplicaSpec) DeepCopy() *LogicalReplicaSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalReplicaSpec.

func (*LogicalReplicaSpec) DeepCopyInto

func (in *LogicalReplicaSpec) DeepCopyInto(out *LogicalReplicaSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogicalReplicaState

type LogicalReplicaState string
const (
	// LogicalReplicaStateBootstrapping means the replica is being seeded and
	// converted by the bootstrap Job, or has been and is not serving yet.
	LogicalReplicaStateBootstrapping LogicalReplicaState = "bootstrapping"

	LogicalReplicaStateReady LogicalReplicaState = "ready"

	// LogicalReplicaStateBroken means replication has stopped and the replica
	// needs to be recreated.
	LogicalReplicaStateBroken LogicalReplicaState = "broken"

	// LogicalReplicaStateSuspended means the replica was stopped on purpose,
	// because the cluster it replicates is being restored. Not an error.
	LogicalReplicaStateSuspended LogicalReplicaState = "suspended"
)

type LogicalReplicaStatus

type LogicalReplicaStatus struct {
	Name string `json:"name"`

	// +optional
	State LogicalReplicaState `json:"state,omitempty"`

	// +optional
	Reason string `json:"reason,omitempty"`

	// +optional
	Message string `json:"message,omitempty"`

	// Databases replicated by this replica. It is resolved once, when the
	// replica is bootstrapped, and does not change afterwards.
	// +optional
	Databases []string `json:"databases,omitempty"`

	// SeededAt is when the data this replica serves was copied from the
	// cluster.
	// +optional
	SeededAt *metav1.Time `json:"seededAt,omitempty"`

	// PostgresVersion is the major PostgreSQL version of the data directory this
	// replica holds, recorded when it was seeded. The data directory is scoped to
	// a major version and pg_upgrade never touches it, so once spec.postgresVersion
	// moves past this the replica cannot be started again.
	// +optional
	PostgresVersion int `json:"postgresVersion,omitempty"`

	// InvalidatedAt is when the operator established that the data on this
	// replica can no longer be reconciled with the cluster, because the cluster
	// was restored in place or upgraded to a new major version after the replica
	// was seeded from it. The replica stays stopped until it is removed from
	// spec.logicalReplicas and added back, which seeds it again from scratch.
	// +optional
	InvalidatedAt *metav1.Time `json:"invalidatedAt,omitempty"`
}

func (*LogicalReplicaStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalReplicaStatus.

func (*LogicalReplicaStatus) DeepCopyInto

func (in *LogicalReplicaStatus) DeepCopyInto(out *LogicalReplicaStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogicalReplicas

type LogicalReplicas []LogicalReplicaSpec

+listType=map +listMapKey=name

func (LogicalReplicas) DeepCopy

func (in LogicalReplicas) DeepCopy() LogicalReplicas

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalReplicas.

func (LogicalReplicas) DeepCopyInto

func (in LogicalReplicas) DeepCopyInto(out *LogicalReplicas)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (LogicalReplicas) ToCrunchy

ToCrunchy projects the logical replicas onto the Crunchy spec, which needs only their names.

type OfflineSnapshotConfig

type OfflineSnapshotConfig struct {
	// Checkpoint configuration for offline snapshot operations.
	// +optional
	Checkpoint *CheckpointConfig `json:"checkpoint,omitempty"`
}

func DefaultOfflineSnapshotConfig

func DefaultOfflineSnapshotConfig() *OfflineSnapshotConfig

func (*OfflineSnapshotConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OfflineSnapshotConfig.

func (*OfflineSnapshotConfig) DeepCopyInto

func (in *OfflineSnapshotConfig) DeepCopyInto(out *OfflineSnapshotConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PGBackRestArchive

type PGBackRestArchive struct {
	// +optional
	Metadata *crunchyv1beta1.Metadata `json:"metadata,omitempty"`

	// Projected volumes containing custom pgBackRest configuration.  These files are mounted
	// under "/etc/pgbackrest/conf.d" alongside any pgBackRest configuration generated by the
	// PostgreSQL Operator:
	// https://pgbackrest.org/configuration.html
	// +optional
	Configuration []corev1.VolumeProjection `json:"configuration,omitempty"`

	// Global pgBackRest configuration settings.  These settings are included in the "global"
	// section of the pgBackRest configuration generated by the PostgreSQL Operator, and then
	// mounted under "/etc/pgbackrest/conf.d":
	// https://pgbackrest.org/configuration.html
	// +optional
	Global map[string]string `json:"global,omitempty"`

	// The image name to use for pgBackRest containers.  Utilized to run
	// pgBackRest repository hosts and backups. The image may also be set using
	// the RELATED_IMAGE_PGBACKREST environment variable
	// +optional
	Image string `json:"image,omitempty"`

	// +optional
	InitContainer *crunchyv1beta1.InitContainerSpec `json:"initContainer,omitempty"` // K8SPG-613

	// Jobs field allows configuration for all backup jobs
	// +optional
	Jobs *crunchyv1beta1.BackupJobs `json:"jobs,omitempty"`

	// Defines a pgBackRest repository
	// +listType=map
	// +listMapKey=name
	// +optional
	Repos []crunchyv1beta1.PGBackRestRepo `json:"repos"`

	// Defines configuration for a pgBackRest dedicated repository host.  This section is only
	// applicable if at least one "volume" (i.e. PVC-based) repository is defined in the "repos"
	// section, therefore enabling a dedicated repository host Deployment.
	// +optional
	RepoHost *crunchyv1beta1.PGBackRestRepoHost `json:"repoHost,omitempty"`

	// Defines details for manual pgBackRest backup Jobs
	// +optional
	Manual *crunchyv1beta1.PGBackRestManualBackup `json:"manual,omitempty"`

	// Defines details for performing an in-place restore using pgBackRest
	// +optional
	Restore *crunchyv1beta1.PGBackRestRestore `json:"restore,omitempty"`

	// Deprecated: Use Containers instead
	// +optional
	Sidecars *crunchyv1beta1.PGBackRestSidecars `json:"sidecars,omitempty"`

	// Configuration for pgBackRest sidecar containers
	// +optional
	Containers *crunchyv1beta1.PGBackRestSidecars `json:"containers,omitempty"`

	// K8SPG-833
	Env []corev1.EnvVar `json:"env,omitempty"`
	// K8SPG-833
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
}

func (*PGBackRestArchive) DeepCopy

func (in *PGBackRestArchive) DeepCopy() *PGBackRestArchive

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGBackRestArchive.

func (*PGBackRestArchive) DeepCopyInto

func (in *PGBackRestArchive) DeepCopyInto(out *PGBackRestArchive)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PGBackupState

type PGBackupState string
const (
	BackupNew       PGBackupState = ""
	BackupStarting  PGBackupState = "Starting"
	BackupRunning   PGBackupState = "Running"
	BackupFailed    PGBackupState = "Failed"
	BackupSucceeded PGBackupState = "Succeeded"
)

func (PGBackupState) IsTerminal

func (s PGBackupState) IsTerminal() bool

type PGBackupStorageType

type PGBackupStorageType string
const (
	PGBackupStorageTypeFilesystem PGBackupStorageType = "filesystem"
	PGBackupStorageTypeAzure      PGBackupStorageType = "azure"
	PGBackupStorageTypeGCS        PGBackupStorageType = "gcs"
	PGBackupStorageTypeS3         PGBackupStorageType = "s3"
)

type PGBackupType

type PGBackupType string
const (
	PGBackupTypeFull         PGBackupType = "full"
	PGBackupTypeDifferential PGBackupType = "differential"
	PGBackupTypeIncremental  PGBackupType = "incremental"
	PGBackupTypeSnapshot     PGBackupType = "snapshot"
)

type PGBouncerSpec

type PGBouncerSpec struct {
	// +optional
	Metadata *crunchyv1beta1.Metadata `json:"metadata,omitempty"`

	// Scheduling constraints of a PgBouncer pod. Changing this value causes
	// PgBouncer to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Configuration settings for the PgBouncer process. Changes to any of these
	// values will be automatically reloaded without validation. Be careful, as
	// you may put PgBouncer into an unusable state.
	// More info: https://www.pgbouncer.org/usage.html#reload
	// +optional
	Config crunchyv1beta1.PGBouncerConfiguration `json:"config,omitempty"`

	// Custom sidecars for a PgBouncer pod. Changing this value causes
	// PgBouncer to restart.
	// +optional
	Sidecars []corev1.Container `json:"sidecars,omitempty"`

	SidecarVolumes []corev1.Volume             `json:"sidecarVolumes,omitempty"`
	SidecarPVCs    []crunchyv1beta1.SidecarPVC `json:"sidecarPVCs,omitempty"`

	// Configuration for pgBouncer default sidecar containers.
	// +optional
	Containers *crunchyv1beta1.PGBouncerSidecars `json:"containers,omitempty"`

	// A secret projection containing a certificate and key with which to encrypt
	// connections to PgBouncer. The "tls.crt", "tls.key", and "ca.crt" paths must
	// be PEM-encoded certificates and keys. Changing this value causes PgBouncer
	// to restart.
	// More info: https://kubernetes.io/docs/concepts/configuration/secret/#projection-of-secret-keys-to-specific-paths
	// +optional
	CustomTLSSecret *corev1.SecretProjection `json:"customTLSSecret,omitempty"`

	// K8SPG-952
	// Additional CA bundles that PgBouncer should trust when verifying client certificates.
	// Each item is a reference to a Secret that contains a PEM-encoded CA bundle in key `ca.crt`.
	AdditionalTrustedCAs []corev1.LocalObjectReference `json:"additionalTrustedCAs,omitempty"`

	// Allow SUPERUSERs to connect through PGBouncer.
	// +optional
	ExposeSuperusers bool `json:"exposeSuperusers,omitempty"`

	// Name of a container image that can run PgBouncer 1.15 or newer. Changing
	// this value causes PgBouncer to restart. The image may also be set using
	// the RELATED_IMAGE_PGBOUNCER environment variable.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	// +optional
	Image string `json:"image,omitempty"`

	// Port on which PgBouncer should listen for client connections. Changing
	// this value causes PgBouncer to restart.
	// +optional
	// +kubebuilder:default=5432
	// +kubebuilder:validation:Minimum=1024
	Port *int32 `json:"port,omitempty"`

	// Priority class name for the pgBouncer pod. Changing this value causes
	// PostgreSQL to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Number of desired PgBouncer pods.
	// +optional
	// +kubebuilder:default=1
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas,omitempty"`

	// Minimum number of pods that should be available at a time.
	// Defaults to one when the replicas field is greater than one.
	// +optional
	MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`

	// Compute resources of a PgBouncer container. Changing this value causes
	// PgBouncer to restart.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Specification of the service that exposes PgBouncer.
	// +optional
	ServiceExpose *ServiceExpose `json:"expose,omitempty"`

	// Tolerations of a PgBouncer pod. Changing this value causes PgBouncer to
	// restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Topology spread constraints of a PgBouncer pod. Changing this value causes
	// PgBouncer to restart.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
	// +optional
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// SecurityContext defines the security settings for PGBouncer pods.
	// +optional
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`

	// Secret with users to add to PgBouncer's authentication file. Each key is
	// a PgBouncer user name and its value is the password or verifier.
	// +optional
	UsersSecret *corev1.LocalObjectReference `json:"usersSecret,omitempty"`

	Env     []corev1.EnvVar        `json:"env,omitempty"`
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

	// If set, pauses pgbouncer connections.
	Paused *bool `json:"paused,omitempty"`
}

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) ToCrunchy

func (p *PGBouncerSpec) ToCrunchy(version string) *crunchyv1beta1.PGBouncerPodSpec

type PGBouncerStatus

type PGBouncerStatus struct {
	Size int32 `json:"size"`

	Ready int32 `json:"ready"`
}

func (*PGBouncerStatus) DeepCopy

func (in *PGBouncerStatus) DeepCopy() *PGBouncerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGBouncerStatus.

func (*PGBouncerStatus) DeepCopyInto

func (in *PGBouncerStatus) DeepCopyInto(out *PGBouncerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PGInstanceSetSpec

type PGInstanceSetSpec struct {
	// +optional
	Metadata *crunchyv1beta1.Metadata `json:"metadata,omitempty"`

	// Name that associates this set of PostgreSQL pods. This field is optional
	// when only one instance set is defined. Each instance set in a cluster
	// must have a unique name. The combined length of this and the cluster name
	// must be 46 characters or less.
	// +optional
	// +kubebuilder:default=""
	// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$`
	Name string `json:"name"`

	// Scheduling constraints of a PostgreSQL pod. Changing this value causes
	// PostgreSQL to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Custom sidecars for PostgreSQL instance pods. Changing this value causes
	// PostgreSQL to restart.
	// +optional
	Sidecars []corev1.Container `json:"sidecars,omitempty"`

	SidecarVolumes []corev1.Volume             `json:"sidecarVolumes,omitempty"`
	SidecarPVCs    []crunchyv1beta1.SidecarPVC `json:"sidecarPVCs,omitempty"`

	// K8SPG-440
	// Additional volumes to mount into the PostgreSQL instance container.
	// Changing this value causes PostgreSQL to restart.
	// +optional
	// +listType=map
	// +listMapKey=name
	ExtraVolumes []crunchyv1beta1.ExtraVolume `json:"extraVolumes,omitempty"`

	// Configuration for instance default sidecar containers.
	// +optional
	Containers *crunchyv1beta1.InstanceSidecars `json:"containers,omitempty"`

	// Additional init containers for PostgreSQL instance pods. Changing this value causes
	// PostgreSQL to restart.
	// +optional
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// Priority class name for the PostgreSQL pod. Changing this value causes
	// PostgreSQL to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Number of desired PostgreSQL pods.
	// +optional
	// +kubebuilder:default=1
	// +kubebuilder:validation:Minimum=1
	Replicas *int32 `json:"replicas,omitempty"`

	// Minimum number of pods that should be available at a time.
	// Defaults to one when the replicas field is greater than one.
	// +optional
	MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`

	// Compute resources of a PostgreSQL container.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Tolerations of a PostgreSQL pod. Changing this value causes PostgreSQL to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Topology spread constraints of a PostgreSQL pod. Changing this value causes
	// PostgreSQL to restart.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
	// +optional
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// Defines a separate PersistentVolumeClaim for PostgreSQL's write-ahead log.
	// More info: https://www.postgresql.org/docs/current/wal.html
	// +optional
	WALVolumeClaimSpec *corev1.PersistentVolumeClaimSpec `json:"walVolumeClaimSpec,omitempty"`

	// Defines a PersistentVolumeClaim for PostgreSQL data.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes
	// +kubebuilder:validation:Required
	DataVolumeClaimSpec corev1.PersistentVolumeClaimSpec `json:"dataVolumeClaimSpec"`

	// The list of tablespaces volumes to mount for this postgrescluster
	// This field requires enabling TablespaceVolumes feature gate
	// +listType=map
	// +listMapKey=name
	// +optional
	TablespaceVolumes []crunchyv1beta1.TablespaceVolume `json:"tablespaceVolumes,omitempty"`

	// The list of volume mounts to mount to PostgreSQL instance pods. Changing this value causes
	// PostgreSQL to restart.
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	// SecurityContext defines the security settings for a PostgreSQL pod.
	// +optional
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`

	// K8SPG-708
	// InitContainer defines the init container for the instance container of a PostgreSQL pod.
	// +optional
	InitContainer *crunchyv1beta1.InitContainerSpec `json:"initContainer,omitempty"`

	Env     []corev1.EnvVar        `json:"env,omitempty"`
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
}

func (*PGInstanceSetSpec) DeepCopy

func (in *PGInstanceSetSpec) DeepCopy() *PGInstanceSetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGInstanceSetSpec.

func (*PGInstanceSetSpec) DeepCopyInto

func (in *PGInstanceSetSpec) DeepCopyInto(out *PGInstanceSetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (PGInstanceSetSpec) ToCrunchy

type PGInstanceSets

type PGInstanceSets []PGInstanceSetSpec

+listType=map +listMapKey=name +kubebuilder:validation:MinItems=1

func (PGInstanceSets) DeepCopy

func (in PGInstanceSets) DeepCopy() PGInstanceSets

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGInstanceSets.

func (PGInstanceSets) DeepCopyInto

func (in PGInstanceSets) DeepCopyInto(out *PGInstanceSets)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (PGInstanceSets) ToCrunchy

type PGProxySpec

type PGProxySpec struct {
	// Defines a PgBouncer proxy and connection pooler.
	PGBouncer *PGBouncerSpec `json:"pgBouncer"`
}

func (*PGProxySpec) DeepCopy

func (in *PGProxySpec) DeepCopy() *PGProxySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGProxySpec.

func (*PGProxySpec) DeepCopyInto

func (in *PGProxySpec) DeepCopyInto(out *PGProxySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PGProxySpec) IsSet

func (p *PGProxySpec) IsSet() bool

func (*PGProxySpec) PGBouncerEnabled

func (p *PGProxySpec) PGBouncerEnabled() bool

func (*PGProxySpec) ToCrunchy

func (p *PGProxySpec) ToCrunchy(version string) *crunchyv1beta1.PostgresProxySpec

type PGRestoreState

type PGRestoreState string
const (
	RestoreNew       PGRestoreState = ""
	RestoreStarting  PGRestoreState = "Starting"
	RestoreRunning   PGRestoreState = "Running"
	RestoreFailed    PGRestoreState = "Failed"
	RestoreSucceeded PGRestoreState = "Succeeded"
)

type PITRestoreDateTime

type PITRestoreDateTime struct {
	*metav1.Time `json:",inline"`
}

+kubebuilder:validation:Type=string

func (*PITRestoreDateTime) DeepCopy

func (in *PITRestoreDateTime) DeepCopy() *PITRestoreDateTime

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PITRestoreDateTime.

func (*PITRestoreDateTime) DeepCopyInto

func (in *PITRestoreDateTime) DeepCopyInto(out *PITRestoreDateTime)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (PITRestoreDateTime) MarshalJSON

func (t PITRestoreDateTime) MarshalJSON() ([]byte, error)

func (PITRestoreDateTime) OpenAPISchemaFormat

func (PITRestoreDateTime) OpenAPISchemaFormat() string

func (PITRestoreDateTime) OpenAPISchemaType

func (PITRestoreDateTime) OpenAPISchemaType() []string

func (*PITRestoreDateTime) ToUnstructured

func (t *PITRestoreDateTime) ToUnstructured() any

func (*PITRestoreDateTime) UnmarshalJSON

func (t *PITRestoreDateTime) UnmarshalJSON(b []byte) (err error)

type PMMQuerySource

type PMMQuerySource string
const (
	PgStatStatements PMMQuerySource = "pgstatstatements"
	PgStatMonitor    PMMQuerySource = "pgstatmonitor"
)

type PMMSpec

type PMMSpec struct {
	// +kubebuilder:validation:Required
	Enabled bool `json:"enabled"`

	// +kubebuilder:validation:Required
	Image string `json:"image"`

	// ImagePullPolicy is used to determine when Kubernetes will attempt to
	// pull (download) container images.
	// More info: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
	// +kubebuilder:validation:Enum={Always,Never,IfNotPresent}
	// +optional
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// +kubebuilder:validation:Required
	ServerHost string `json:"serverHost,omitempty"`

	// +optional
	CustomClusterName string `json:"customClusterName,omitempty"`

	// +optional
	PostgresParams string `json:"postgresParams,omitempty"`

	// +kubebuilder:validation:Required
	Secret string `json:"secret,omitempty"`

	// +kubebuilder:validation:Enum={pgstatmonitor,pgstatstatements}
	// +kubebuilder:default=pgstatstatements
	// +kubebuilder:validation:Required
	QuerySource PMMQuerySource `json:"querySource,omitempty"`

	// Compute resources of a PMM container.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// +optional
	ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`

	// +optional
	RuntimeClassName *string `json:"runtimeClassName,omitempty"`
}

func (*PMMSpec) DeepCopy

func (in *PMMSpec) DeepCopy() *PMMSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PMMSpec.

func (*PMMSpec) DeepCopyInto

func (in *PMMSpec) DeepCopyInto(out *PMMSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Patroni

type Patroni struct {
	// +optional
	Status *crunchyv1beta1.PatroniStatus `json:"status,omitempty"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Version string `json:"version"`
}

func (*Patroni) DeepCopy

func (in *Patroni) DeepCopy() *Patroni

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Patroni.

func (*Patroni) DeepCopyInto

func (in *Patroni) DeepCopyInto(out *Patroni)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGBackup

type PerconaPGBackup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	// +kubebuilder:validation:XValidation:rule="self.method == \"volumeSnapshot\" || has(self.repoName)",message="repoName is required when method is 'pgbackrest'"
	Spec   PerconaPGBackupSpec   `json:"spec"`
	Status PerconaPGBackupStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=pg-backup +kubebuilder:printcolumn:name="Cluster",type=string,JSONPath=".spec.pgCluster",description="Cluster name" +kubebuilder:printcolumn:name="Repo",type=string,JSONPath=".spec.repoName",description="Repo name" +kubebuilder:printcolumn:name="Destination",type=string,JSONPath=".status.destination",description="Backup destination" +kubebuilder:printcolumn:name="Status",type=string,JSONPath=".status.state",description="Job status" +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".status.backupType",description="Backup type" +kubebuilder:printcolumn:name="Completed",type=date,JSONPath=".status.completed",description="Completed time" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=".metadata.creationTimestamp",description="Created time" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +operator-sdk:csv:customresourcedefinitions:order=2 +operator-sdk:csv:customresourcedefinitions:resources={{CronJob,v1beta1},{Job,v1}}

PerconaPGBackup is the CRD that defines a Percona PostgreSQL Backup

func (*PerconaPGBackup) CompareVersion

func (b *PerconaPGBackup) CompareVersion(ver string) int

func (*PerconaPGBackup) DeepCopy

func (in *PerconaPGBackup) DeepCopy() *PerconaPGBackup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGBackup.

func (*PerconaPGBackup) DeepCopyInto

func (in *PerconaPGBackup) DeepCopyInto(out *PerconaPGBackup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGBackup) DeepCopyObject

func (in *PerconaPGBackup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*PerconaPGBackup) Default

func (b *PerconaPGBackup) Default()

func (*PerconaPGBackup) UpdateStatus

func (pgBackup *PerconaPGBackup) UpdateStatus(ctx context.Context, cl client.Client, updateFunc func(bcp *PerconaPGBackup)) error

type PerconaPGBackupList

type PerconaPGBackupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PerconaPGBackup `json:"items"`
}

+kubebuilder:object:root=true PerconaPGBackupList contains a list of PerconaPGBackup

func (*PerconaPGBackupList) DeepCopy

func (in *PerconaPGBackupList) DeepCopy() *PerconaPGBackupList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGBackupList.

func (*PerconaPGBackupList) DeepCopyInto

func (in *PerconaPGBackupList) DeepCopyInto(out *PerconaPGBackupList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGBackupList) DeepCopyObject

func (in *PerconaPGBackupList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PerconaPGBackupSpec

type PerconaPGBackupSpec struct {
	PGCluster string `json:"pgCluster"`

	// +optional
	// The name of the pgBackRest repo to run the backup command against.
	// This is required when method is 'pgbackrest'.
	// +kubebuilder:validation:Pattern=^repo[1-4]$
	RepoName *string `json:"repoName,omitempty"`

	// Method with which to perform the backup
	// +kubebuilder:validation:Enum={pgbackrest,volumeSnapshot}
	// +kubebuilder:default=pgbackrest
	// +optional
	Method *BackupMethod `json:"method,omitempty"`

	// Command line options to include when running the pgBackRest backup command.
	// https://pgbackrest.org/command.html#command-backup
	// +optional
	Options []string `json:"options,omitempty"`

	// +optional
	ContainerOptions ContainerOptions `json:"containerOptions"`
}

func (*PerconaPGBackupSpec) DeepCopy

func (in *PerconaPGBackupSpec) DeepCopy() *PerconaPGBackupSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGBackupSpec.

func (*PerconaPGBackupSpec) DeepCopyInto

func (in *PerconaPGBackupSpec) DeepCopyInto(out *PerconaPGBackupSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGBackupStatus

type PerconaPGBackupStatus struct {
	JobName              string                         `json:"jobName,omitempty"`
	State                PGBackupState                  `json:"state,omitempty"`
	Error                string                         `json:"error,omitempty"`
	CompletedAt          *metav1.Time                   `json:"completed,omitempty"`
	Destination          string                         `json:"destination,omitempty"`
	BackupType           PGBackupType                   `json:"backupType,omitempty"`
	StorageType          PGBackupStorageType            `json:"storageType,omitempty"`
	Repo                 *crunchyv1beta1.PGBackRestRepo `json:"repo,omitempty"`
	Image                string                         `json:"image,omitempty"`
	BackupName           string                         `json:"backupName,omitempty"`
	Size                 int64                          `json:"size,omitempty"`
	CRVersion            string                         `json:"crVersion,omitempty"`
	LatestRestorableTime PITRestoreDateTime             `json:"latestRestorableTime,omitempty"`
	Snapshot             *SnapshotStatus                `json:"snapshot,omitempty"`
	Conditions           []metav1.Condition             `json:"conditions,omitempty"`
}

func (*PerconaPGBackupStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGBackupStatus.

func (*PerconaPGBackupStatus) DeepCopyInto

func (in *PerconaPGBackupStatus) DeepCopyInto(out *PerconaPGBackupStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGCluster

type PerconaPGCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	Spec   PerconaPGClusterSpec   `json:"spec"`
	Status PerconaPGClusterStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=pg +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=".status.host" +kubebuilder:printcolumn:name="Status",type=string,JSONPath=".status.state" +kubebuilder:printcolumn:name="Postgres",type=string,JSONPath=".status.postgres.ready" +kubebuilder:printcolumn:name="PGBouncer",type=string,JSONPath=".status.pgbouncer.ready" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +operator-sdk:csv:customresourcedefinitions:order=1 +operator-sdk:csv:customresourcedefinitions:resources={{ConfigMap,v1},{Secret,v1},{Service,v1},{CronJob,v1beta1},{Deployment,v1},{Job,v1},{StatefulSet,v1},{PersistentVolumeClaim,v1}}

PerconaPGCluster is the CRD that defines a Percona PG Cluster

func (*PerconaPGCluster) CompareVersion

func (cr *PerconaPGCluster) CompareVersion(ver string) int

func (*PerconaPGCluster) DeepCopy

func (in *PerconaPGCluster) DeepCopy() *PerconaPGCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGCluster.

func (*PerconaPGCluster) DeepCopyInto

func (in *PerconaPGCluster) DeepCopyInto(out *PerconaPGCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGCluster) DeepCopyObject

func (in *PerconaPGCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*PerconaPGCluster) Default

func (cr *PerconaPGCluster) Default()

func (*PerconaPGCluster) EnvFromSecrets

func (cr *PerconaPGCluster) EnvFromSecrets() []string

func (*PerconaPGCluster) IsPaused

func (cr *PerconaPGCluster) IsPaused() bool

func (*PerconaPGCluster) LogCollectorEnabled

func (cr *PerconaPGCluster) LogCollectorEnabled() bool

func (*PerconaPGCluster) LogRotateExtraConfigMaps

func (cr *PerconaPGCluster) LogRotateExtraConfigMaps() []string

LogRotateExtraConfigMaps returns the names of the ConfigMaps the log collector references through logRotate.extraConfig.

func (*PerconaPGCluster) LogicalReplicasEnabled

func (cr *PerconaPGCluster) LogicalReplicasEnabled() bool

LogicalReplicasEnabled returns whether the cluster has any logical replica configured.

func (*PerconaPGCluster) PGBouncerUserSecrets

func (cr *PerconaPGCluster) PGBouncerUserSecrets() []string

func (*PerconaPGCluster) PMMEnabled

func (cr *PerconaPGCluster) PMMEnabled() bool

func (*PerconaPGCluster) PostgresImage

func (cr *PerconaPGCluster) PostgresImage() string

func (*PerconaPGCluster) SetExtensionDefaults

func (cr *PerconaPGCluster) SetExtensionDefaults()

func (*PerconaPGCluster) ShouldCheckStandbyLag

func (cr *PerconaPGCluster) ShouldCheckStandbyLag() bool

func (*PerconaPGCluster) ToCrunchy

func (PerconaPGCluster) UserMonitoring

func (pgc PerconaPGCluster) UserMonitoring() string

UserMonitoring constructs the monitoring user.

func (*PerconaPGCluster) Validate

func (cr *PerconaPGCluster) Validate() error

func (*PerconaPGCluster) ValidateDynamicConfiguration

func (cr *PerconaPGCluster) ValidateDynamicConfiguration() error

func (*PerconaPGCluster) ValidateLogicalReplicas

func (cr *PerconaPGCluster) ValidateLogicalReplicas() error

ValidateLogicalReplicas checks the invariants of spec.logicalReplicas that cannot be expressed with kubebuilder markers.

func (*PerconaPGCluster) Version

func (cr *PerconaPGCluster) Version() *gover.Version

type PerconaPGClusterList

type PerconaPGClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PerconaPGCluster `json:"items"`
}

+kubebuilder:object:root=true PostgresClusterList contains a list of PostgresCluster

func (*PerconaPGClusterList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGClusterList.

func (*PerconaPGClusterList) DeepCopyInto

func (in *PerconaPGClusterList) DeepCopyInto(out *PerconaPGClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGClusterList) DeepCopyObject

func (in *PerconaPGClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PerconaPGClusterSpec

type PerconaPGClusterSpec struct {
	// +optional
	Metadata *crunchyv1beta1.Metadata `json:"metadata,omitempty"`

	// Version of the operator. Update this to new version after operator
	// upgrade to apply changes to Kubernetes objects. Default is the latest
	// version.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self == \"\" || self.matches('^[0-9]+\\\\.[0-9]+\\\\.[0-9]+([-+][a-zA-Z0-9.+-]+)?$')",message="CRVersion must be a valid semantic version"
	CRVersion string `json:"crVersion,omitempty"`

	InitContainer *crunchyv1beta1.InitContainerSpec `json:"initContainer,omitempty"`

	// The image name to use for PostgreSQL containers.
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
	Image string `json:"image,omitempty"`

	// ImagePullPolicy is used to determine when Kubernetes will attempt to
	// pull (download) container images.
	// More info: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
	// +kubebuilder:validation:Enum={Always,Never,IfNotPresent}
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// The image pull secrets used to pull from a private registry
	// Changing this value causes all running pods to restart.
	// https://k8s.io/docs/tasks/configure-pod-container/pull-image-private-registry/
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	TLSOnly bool `json:"tlsOnly,omitempty"`

	// +optional
	TLS *crunchyv1beta1.TLSSpec `json:"tls,omitempty"`

	// The port on which PostgreSQL should listen.
	// +optional
	// +kubebuilder:default=5432
	// +kubebuilder:validation:Minimum=1024
	Port *int32 `json:"port,omitempty"`

	// Specification of the service that exposes the PostgreSQL primary instance.
	// +optional
	Expose *ServiceExpose `json:"expose,omitempty"`

	// Specification of the service that exposes PostgreSQL replica instances
	// +optional
	ExposeReplicas *ServiceExpose `json:"exposeReplicas,omitempty"`

	// The major version of PostgreSQL installed in the PostgreSQL image
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum=12
	// +kubebuilder:validation:Maximum=19
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	PostgresVersion int `json:"postgresVersion"`

	Secrets SecretsSpec `json:"secrets,omitempty"`

	// Run this cluster as a read-only copy of an existing cluster or archive.
	// +optional
	Standby *StandbySpec `json:"standby,omitempty"`

	// Whether or not the PostgreSQL cluster is being deployed to an OpenShift
	// environment. If the field is unset, the operator will automatically
	// detect the environment.
	// +optional
	OpenShift *bool `json:"openshift,omitempty"`

	// +optional
	Patroni *crunchyv1beta1.PatroniSpec `json:"patroni,omitempty"`

	// Users to create inside PostgreSQL and the databases they should access.
	// The default creates one user that can access one database matching the
	// PostgresCluster name. An empty list creates no users. Removing a user
	// from this list does NOT drop the user nor revoke their access.
	// +listType=map
	// +listMapKey=name
	// +optional
	Users []crunchyv1beta1.PostgresUserSpec `json:"users,omitempty"`

	// DatabaseInitSQL defines a ConfigMap containing custom SQL that will
	// be run after the cluster is initialized. This ConfigMap must be in the same
	// namespace as the cluster.
	// +optional
	DatabaseInitSQL *crunchyv1beta1.DatabaseInitSQL `json:"databaseInitSQL,omitempty"`

	// Whether or not the PostgreSQL cluster should be stopped.
	// When this is true, workloads are scaled to zero and CronJobs
	// are suspended.
	// Other resources, such as Services and Volumes, remain in place.
	// +optional
	Pause *bool `json:"pause,omitempty"`

	// Suspends the rollout and reconciliation of changes made to the
	// PostgresCluster spec.
	// +optional
	Unmanaged *bool `json:"unmanaged,omitempty"`

	// Specifies a data source for bootstrapping the PostgreSQL cluster.
	// +optional
	DataSource *crunchyv1beta1.DataSource `json:"dataSource,omitempty"`

	// Specifies one or more sets of PostgreSQL pods that replicate data for
	// this cluster.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	InstanceSets PGInstanceSets `json:"instances"`

	// The specification of a proxy that connects to PostgreSQL.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Proxy *PGProxySpec `json:"proxy,omitempty"`

	// PostgreSQL backup configuration
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	Backups Backups `json:"backups"`

	// The specification of PMM sidecars.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	PMM *PMMSpec `json:"pmm,omitempty"`

	// The specification of the log collector sidecar.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	LogCollector *LogCollectorSpec `json:"logcollector,omitempty"`

	// The specification of extensions.
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// +optional
	Extensions ExtensionsSpec `json:"extensions,omitempty"`

	// Indicates whether schemas are automatically created for the user
	// specified in `spec.users` across all databases associated with that user.
	// +optional
	AutoCreateUserSchema *bool `json:"autoCreateUserSchema,omitempty"`

	ClusterServiceDNSSuffix string `json:"clusterServiceDNSSuffix,omitempty"`

	// Configuration for PostgreSQL config files and server parameters.
	// Use spec.config.files to mount files (e.g. LDAP CA certificate) under
	// /etc/postgres, and spec.config.parameters to set postgresql.conf values.
	// +optional
	Config *crunchyv1beta1.PostgresConfigSpec `json:"config,omitempty"`

	// Defines custom pg_hba.conf authentication rules. Rules are evaluated
	// after mandatory operator rules and before the default scram-sha-256
	// fallback. Use this together with spec.config.files to supply supporting
	// files such as an LDAP CA certificate.
	// +optional
	Authentication *crunchyv1beta1.PostgresClusterAuthentication `json:"authentication,omitempty"`

	// Logical replicas are read-write PostgreSQL instances in this cluster that
	// receive changes from the primary over logical replication. Each one is
	// seeded with a physical copy of the primary, taken the way its
	// bootstrapMethod says, and converted with pg_createsubscriber, which
	// requires spec.postgresVersion to be 17 or higher.
	// +optional
	LogicalReplicas LogicalReplicas `json:"logicalReplicas,omitempty"`
}

+kubebuilder:validation:XValidation:rule="!has(self.extensions) || !has(self.extensions.pg_tde) || !has(self.extensions.pg_tde.enabled) || !self.extensions.pg_tde.enabled || self.postgresVersion >= 16",message="pg_tde is only supported for PG16 and above" +kubebuilder:validation:XValidation:rule="!has(self.users) || self.postgresVersion >= 15 || self.users.all(u, !has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)",message="PostgresVersion must be >= 15 if grantPublicSchemaAccess exists and is true" +kubebuilder:validation:XValidation:rule="!has(self.logicalReplicas) || size(self.logicalReplicas) == 0 || self.postgresVersion >= 17",message="spec.logicalReplicas requires spec.postgresVersion >= 17" +kubebuilder:validation:XValidation:rule="!has(self.logicalReplicas) || size(self.logicalReplicas) == 0 || !has(self.backups) || !has(self.backups.enabled) || self.backups.enabled || self.logicalReplicas.all(r, has(r.bootstrapMethod) && r.bootstrapMethod == 'pg_basebackup')",message="spec.logicalReplicas[].bootstrapMethod must be 'pg_basebackup' when spec.backups.enabled is false"

func (*PerconaPGClusterSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGClusterSpec.

func (*PerconaPGClusterSpec) DeepCopyInto

func (in *PerconaPGClusterSpec) DeepCopyInto(out *PerconaPGClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGClusterStatus

type PerconaPGClusterStatus struct {
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Postgres PostgresStatus `json:"postgres"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	PGBouncer PGBouncerStatus `json:"pgbouncer"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	State AppState `json:"state"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	// Deprecated: Use Patroni instead. This field will be removed in a future release.
	PatroniVersion string `json:"patroniVersion"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Patroni Patroni `json:"patroni,omitempty"`

	// Status information for pgBackRest
	// +optional
	PGBackRest *crunchyv1beta1.PGBackRestStatus `json:"pgbackrest,omitempty"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Host string `json:"host"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	InstalledCustomExtensions []string `json:"installedCustomExtensions"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=status
	Standby *StandbyStatus `json:"standby,omitempty"`

	// +optional
	// +listType=map
	// +listMapKey=name
	// +operator-sdk:csv:customresourcedefinitions:type=status
	LogicalReplicas []LogicalReplicaStatus `json:"logicalReplicas,omitempty"`
}

func (*PerconaPGClusterStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGClusterStatus.

func (*PerconaPGClusterStatus) DeepCopyInto

func (in *PerconaPGClusterStatus) DeepCopyInto(out *PerconaPGClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGRestore

type PerconaPGRestore struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	// +kubebuilder:validation:XValidation:rule="((has(self.repoName) && self.repoName != \"\") || (has(self.volumeSnapshotBackupName) && self.volumeSnapshotBackupName != \"\"))",message="either repoName or volumeSnapshotBackupName must be set"
	Spec   PerconaPGRestoreSpec   `json:"spec"`
	Status PerconaPGRestoreStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=pg-restore +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +operator-sdk:csv:customresourcedefinitions:order=3 +operator-sdk:csv:customresourcedefinitions:resources={{CronJob,v1beta1},{Job,v1}} +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.pgCluster",description="Cluster name" +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.state",description="Job status" +kubebuilder:printcolumn:name="Completed",type="date",JSONPath=".status.completed",description="Completed time" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

PerconaPGRestore is the CRD that defines a Percona PostgreSQL Restore

func (*PerconaPGRestore) DeepCopy

func (in *PerconaPGRestore) DeepCopy() *PerconaPGRestore

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGRestore.

func (*PerconaPGRestore) DeepCopyInto

func (in *PerconaPGRestore) DeepCopyInto(out *PerconaPGRestore)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGRestore) DeepCopyObject

func (in *PerconaPGRestore) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*PerconaPGRestore) IsCompleted

func (r *PerconaPGRestore) IsCompleted() bool

func (*PerconaPGRestore) UpdateStatus

func (pgRestore *PerconaPGRestore) UpdateStatus(ctx context.Context, cl client.Client, updateFunc func(restore *PerconaPGRestore)) error

type PerconaPGRestoreList

type PerconaPGRestoreList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PerconaPGRestore `json:"items"`
}

+kubebuilder:object:root=true PerconaPGRestoreList contains a list of PerconaPGRestore

func (*PerconaPGRestoreList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGRestoreList.

func (*PerconaPGRestoreList) DeepCopyInto

func (in *PerconaPGRestoreList) DeepCopyInto(out *PerconaPGRestoreList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGRestoreList) DeepCopyObject

func (in *PerconaPGRestoreList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PerconaPGRestoreSpec

type PerconaPGRestoreSpec struct {
	// The name of the PerconaPGCluster to perform restore.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="pgCluster is an immutable field"
	PGCluster string `json:"pgCluster"`

	// The name of the pgBackRest repo within the source PostgresCluster that contains the backups
	// that should be utilized to perform a pgBackRest restore when initializing the data source
	// for the new PostgresCluster.
	// +kubebuilder:validation:Pattern=^repo[1-4]$
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="repoName is an immutable field"
	RepoName *string `json:"repoName,omitempty"`

	// The name of the backup to perform in-place volume snapshot restores from.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeSnapshotBackupName is an immutable field"
	VolumeSnapshotBackupName string `json:"volumeSnapshotBackupName,omitempty"`

	// Command line options to include when running the pgBackRest restore command.
	// https://pgbackrest.org/command.html#command-restore
	// +optional
	Options []string `json:"options,omitempty"`

	// +optional
	ContainerOptions ContainerOptions `json:"containerOptions"`
}

func (*PerconaPGRestoreSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGRestoreSpec.

func (*PerconaPGRestoreSpec) DeepCopyInto

func (in *PerconaPGRestoreSpec) DeepCopyInto(out *PerconaPGRestoreSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGRestoreStatus

type PerconaPGRestoreStatus struct {
	JobName     string         `json:"jobName,omitempty"`
	State       PGRestoreState `json:"state,omitempty"`
	CompletedAt *metav1.Time   `json:"completed,omitempty"`
}

func (*PerconaPGRestoreStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGRestoreStatus.

func (*PerconaPGRestoreStatus) DeepCopyInto

func (in *PerconaPGRestoreStatus) DeepCopyInto(out *PerconaPGRestoreStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGUpgrade

type PerconaPGUpgrade struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	Spec   PerconaPGUpgradeSpec   `json:"spec"`
	Status PerconaPGUpgradeStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status PerconaPGUpgrade is the Schema for the perconapgupgrades API

func (*PerconaPGUpgrade) DeepCopy

func (in *PerconaPGUpgrade) DeepCopy() *PerconaPGUpgrade

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGUpgrade.

func (*PerconaPGUpgrade) DeepCopyInto

func (in *PerconaPGUpgrade) DeepCopyInto(out *PerconaPGUpgrade)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGUpgrade) DeepCopyObject

func (in *PerconaPGUpgrade) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PerconaPGUpgradeList

type PerconaPGUpgradeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PerconaPGUpgrade `json:"items"`
}

+kubebuilder:object:root=true PerconaPGRestoreList contains a list of PerconaPGRestore

func (*PerconaPGUpgradeList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGUpgradeList.

func (*PerconaPGUpgradeList) DeepCopyInto

func (in *PerconaPGUpgradeList) DeepCopyInto(out *PerconaPGUpgradeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PerconaPGUpgradeList) DeepCopyObject

func (in *PerconaPGUpgradeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PerconaPGUpgradeSpec

type PerconaPGUpgradeSpec struct {
	// +optional
	Metadata *crunchyv1beta1.Metadata `json:"metadata,omitempty"`

	// The name of the cluster to be updated
	// +required
	// +kubebuilder:validation:MinLength=1
	PostgresClusterName string `json:"postgresClusterName"`

	// The image name to use for major PostgreSQL upgrades.
	// +required
	Image *string `json:"image"`

	// ImagePullPolicy is used to determine when Kubernetes will attempt to
	// pull (download) container images.
	// More info: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
	// +kubebuilder:validation:Enum={Always,Never,IfNotPresent}
	// +optional
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// The image pull secrets used to pull from a private registry.
	// Changing this value causes all running PGUpgrade pods to restart.
	// https://k8s.io/docs/tasks/configure-pod-container/pull-image-private-registry/
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// The major version of PostgreSQL before the upgrade.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum=12
	// +kubebuilder:validation:Maximum=18
	FromPostgresVersion int `json:"fromPostgresVersion"`

	// The major version of PostgreSQL to be upgraded to.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum=13
	// +kubebuilder:validation:Maximum=19
	ToPostgresVersion int `json:"toPostgresVersion"`

	// The image to use for PostgreSQL containers after upgrade.
	// +required
	ToPostgresImage string `json:"toPostgresImage"`

	// The image to use for PgBouncer containers after upgrade.
	// +required
	ToPgBouncerImage string `json:"toPgBouncerImage"`

	// The image to use for PgBackRest containers after upgrade.
	// +required
	ToPgBackRestImage string `json:"toPgBackRestImage"`

	// Resource requirements for the PGUpgrade container.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Scheduling constraints of the PGUpgrade pod.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Priority class name for the PGUpgrade pod. Changing this
	// value causes PGUpgrade pod to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Tolerations of the PGUpgrade pod.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Init container to run before the upgrade container.
	// +optional
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// The list of volume mounts to mount to upgrade pod.
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

func (*PerconaPGUpgradeSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGUpgradeSpec.

func (*PerconaPGUpgradeSpec) DeepCopyInto

func (in *PerconaPGUpgradeSpec) DeepCopyInto(out *PerconaPGUpgradeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PerconaPGUpgradeStatus

type PerconaPGUpgradeStatus struct {
	crunchyv1beta1.PGUpgradeStatus `json:",inline"`
}

func (*PerconaPGUpgradeStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaPGUpgradeStatus.

func (*PerconaPGUpgradeStatus) DeepCopyInto

func (in *PerconaPGUpgradeStatus) DeepCopyInto(out *PerconaPGUpgradeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostgresInstanceSetStatus

type PostgresInstanceSetStatus struct {
	Name string `json:"name"`

	Size int32 `json:"size"`

	Ready int32 `json:"ready"`
}

func (*PostgresInstanceSetStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresInstanceSetStatus.

func (*PostgresInstanceSetStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostgresStatus

type PostgresStatus struct {
	// +optional
	Size int32 `json:"size"`

	// +optional
	Ready int32 `json:"ready"`

	// +optional
	InstanceSets []PostgresInstanceSetStatus `json:"instances"`

	// +optional
	Version int `json:"version"`

	// +optional
	ImageID string `json:"imageID"`

	// +optional
	Distribution string `json:"distribution,omitempty"`
}

func (*PostgresStatus) DeepCopy

func (in *PostgresStatus) DeepCopy() *PostgresStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresStatus.

func (*PostgresStatus) DeepCopyInto

func (in *PostgresStatus) DeepCopyInto(out *PostgresStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretsSpec

type SecretsSpec struct {
	// The secret containing the Certificates and Keys to encrypt PostgreSQL
	// traffic will need to contain the server TLS certificate, TLS key and the
	// Certificate Authority certificate with the data keys set to tls.crt,
	// tls.key and ca.crt, respectively. It will then be mounted as a volume
	// projection to the '/pgconf/tls' directory. For more information on
	// Kubernetes secret projections, please see
	// https://k8s.io/docs/concepts/configuration/secret/#projection-of-secret-keys-to-specific-paths
	// NOTE: If CustomTLSSecret is provided, CustomReplicationClientTLSSecret
	// MUST be provided and the ca.crt provided must be the same.
	// +optional
	CustomTLSSecret *corev1.SecretProjection `json:"customTLSSecret,omitempty"`

	// The secret containing the replication client certificates and keys for
	// secure connections to the PostgreSQL server. It will need to contain the
	// client TLS certificate, TLS key and the Certificate Authority certificate
	// with the data keys set to tls.crt, tls.key and ca.crt, respectively.
	// NOTE: If CustomReplicationClientTLSSecret is provided, CustomTLSSecret
	// MUST be provided and the ca.crt provided must be the same.
	// +optional
	CustomReplicationClientTLSSecret *corev1.SecretProjection `json:"customReplicationTLSSecret,omitempty"`

	// The secret containing the root CA certificate and key for
	// secure connections to the PostgreSQL server. It will need to contain the
	// CA TLS certificate and CA TLS key with the data keys set to
	// root.crt and root.key, respectively.
	// +optional
	CustomRootCATLSSecret *corev1.SecretProjection `json:"customRootCATLSSecret,omitempty"`
}

func (*SecretsSpec) DeepCopy

func (in *SecretsSpec) DeepCopy() *SecretsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsSpec.

func (*SecretsSpec) DeepCopyInto

func (in *SecretsSpec) DeepCopyInto(out *SecretsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceExpose

type ServiceExpose struct {
	crunchyv1beta1.Metadata `json:",inline"`

	// The port on which this service is exposed when type is NodePort or
	// LoadBalancer. Value must be in-range and not in use or the operation will
	// fail. If unspecified, a port will be allocated if this Service requires one.
	// - https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
	// +optional
	NodePort *int32 `json:"nodePort,omitempty"`

	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
	//
	// +optional
	// +kubebuilder:default=ClusterIP
	// +kubebuilder:validation:Enum={ClusterIP,NodePort,LoadBalancer}
	Type string `json:"type,omitempty"`

	// LoadBalancerClass specifies the class of the load balancer implementation
	// to be used. This field is supported for Service Type LoadBalancer only.
	//
	// More info:
	// https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class
	// +optional
	LoadBalancerClass *string `json:"loadBalancerClass,omitempty"`

	// LoadBalancerSourceRanges is a list of IP CIDRs allowed access to load.
	// This field will be ignored if the cloud-provider does not support the feature.
	// +optional
	LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
}

func (*ServiceExpose) DeepCopy

func (in *ServiceExpose) DeepCopy() *ServiceExpose

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExpose.

func (*ServiceExpose) DeepCopyInto

func (in *ServiceExpose) DeepCopyInto(out *ServiceExpose)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceExpose) ToCrunchy

func (s *ServiceExpose) ToCrunchy(version string) *crunchyv1beta1.ServiceSpec

type SnapshotStatus

type SnapshotStatus struct {
	// Name of the VolumeSnapshot containing data volume contents.
	DataVolumeSnapshotRef *string `json:"dataVolumeSnapshotRef,omitempty"`
	// Name of the VolumeSnapshot containing WAL volume contents.
	WALVolumeSnapshotRef *string `json:"walVolumeSnapshotRef,omitempty"`
	// Names of the VolumeSnapshots containing tablespace volume contents.
	// Key is the name of the tablespace, value is the name of the VolumeSnapshot.
	TablespaceVolumeSnapshotRefs map[string]string `json:"tablespaceVolumeSnapshotRefs,omitempty"`
}

func (*SnapshotStatus) DeepCopy

func (in *SnapshotStatus) DeepCopy() *SnapshotStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotStatus.

func (*SnapshotStatus) DeepCopyInto

func (in *SnapshotStatus) DeepCopyInto(out *SnapshotStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StandbySpec

type StandbySpec struct {
	*crunchyv1beta1.PostgresStandbySpec `json:",inline"`

	// +optional
	// MaxAcceptableLag is the maximum WAL lag allowed for the standby cluster, measured in bytes of WAL data.
	// This represents the maximum amount of WAL data that the standby can be behind the primary.
	// If the lag exceeds this value, the standby cluster is marked as unready.
	// If unset, lag is not checked.
	MaxAcceptableLag *resource.Quantity `json:"maxAcceptableLag,omitempty"`
}

func (*StandbySpec) DeepCopy

func (in *StandbySpec) DeepCopy() *StandbySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StandbySpec.

func (*StandbySpec) DeepCopyInto

func (in *StandbySpec) DeepCopyInto(out *StandbySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StandbyStatus

type StandbyStatus struct {
	LagLastComputedAt *metav1.Time `json:"lagLastComputedAt,omitempty"`
	LagBytes          int64        `json:"lagBytes,omitempty"`
}

func (*StandbyStatus) DeepCopy

func (in *StandbyStatus) DeepCopy() *StandbyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StandbyStatus.

func (*StandbyStatus) DeepCopyInto

func (in *StandbyStatus) DeepCopyInto(out *StandbyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeSnapshotJobSpec

type VolumeSnapshotJobSpec struct {
	// Tolerations that will be applied on the VolumeSnapshot Job.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

func (*VolumeSnapshotJobSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotJobSpec.

func (*VolumeSnapshotJobSpec) DeepCopyInto

func (in *VolumeSnapshotJobSpec) DeepCopyInto(out *VolumeSnapshotJobSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolumeSnapshotMode

type VolumeSnapshotMode string
const (
	// VolumeSnapshotModeOffline is the mode for taking offline VolumeSnapshots.
	// With this mode, the operator will stop a replica and take a snapshot of the PVC.
	VolumeSnapshotModeOffline VolumeSnapshotMode = "offline"
)

type VolumeSnapshots

type VolumeSnapshots struct {
	// Mode of the VolumeSnapshot.
	// +kubebuilder:validation:Enum={offline}
	// +kubebuilder:default=offline
	// +optional
	Mode VolumeSnapshotMode `json:"mode,omitempty"`

	// Name of the VolumeSnapshotClass to use.
	// +kubebuilder:validation:Required
	ClassName string `json:"className"`

	// Defines the Cron schedule for a VolumeSnapshot.
	// Follows the standard Cron schedule syntax:
	// https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
	// +optional
	// +kubebuilder:validation:MinLength=6
	Schedule *string `json:"schedule,omitempty"`

	// Configuration for offline snapshot operations.
	// Ignored if mode is not offline.
	// +optional
	OfflineConfig *OfflineSnapshotConfig `json:"offlineConfig,omitempty"`

	// Jobs allows configuration for all VolumeSnapshot jobs.
	// +optional
	Jobs *VolumeSnapshotJobSpec `json:"jobs,omitempty"`
}

func (*VolumeSnapshots) DeepCopy

func (in *VolumeSnapshots) DeepCopy() *VolumeSnapshots

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshots.

func (*VolumeSnapshots) DeepCopyInto

func (in *VolumeSnapshots) DeepCopyInto(out *VolumeSnapshots)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL