v1

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 23 Imported by: 10

Documentation

Overview

Package v1 contains API Schema definitions for the postgresql v1 API group +kubebuilder:object:generate=true +groupName=postgresql.cnpg.io

Index

Constants

View Source
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"

	// 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"
)
View Source
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"

	// StreamingReplicationUser is the name of the user we'll use for
	// streaming replication purposes
	StreamingReplicationUser = "streaming_replica"

	// 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"
)
View Source
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"

	// 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"

	// PhaseUnrecoverable for an unrecoverable cluster
	PhaseUnrecoverable = "Cluster is in an unrecoverable state, needs manual intervention"

	// 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"
)
View Source
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"
)
View Source
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.
	// It is greater than one year in seconds, big enough to simulate an infinite timeout
	DefaultMaxSwitchoverDelay = 40000000
)
View Source
const (
	// CompressionTypeNone means no compression is performed
	CompressionTypeNone = CompressionType("")

	// CompressionTypeGzip means gzip compression is performed
	CompressionTypeGzip = CompressionType("gzip")

	// CompressionTypeBzip2 means bzip2 compression is performed
	CompressionTypeBzip2 = CompressionType("bzip2")

	// CompressionTypeSnappy means snappy compression is performed
	CompressionTypeSnappy = CompressionType("snappy")
)
View Source
const (
	// EncryptionTypeNone means just use the bucket configuration
	EncryptionTypeNone = EncryptionType("")

	// EncryptionTypeAES256 means to use AES256 encryption
	EncryptionTypeAES256 = EncryptionType("AES256")

	// EncryptionTypeNoneAWSKMS means to use aws:kms encryption
	EncryptionTypeNoneAWSKMS = EncryptionType("aws:kms")
)
View Source
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
)
View Source
const (
	// PoolerTypeRW means that the pooler involves only the primary server
	PoolerTypeRW = PoolerType("rw")

	// PoolerTypeRO means that the pooler involver every server
	PoolerTypeRO = PoolerType("ro")

	// DefaultPgBouncerPoolerAuthQuery is the default auth_query for PgBouncer
	DefaultPgBouncerPoolerAuthQuery = "SELECT usename, passwd FROM user_search($1)"
)
View Source
const (
	// PgBouncerPoolModeSession the "session" mode
	PgBouncerPoolModeSession = PgBouncerPoolMode("session")

	// PgBouncerPoolModeTransaction the "transaction" mode
	PgBouncerPoolModeTransaction = PgBouncerPoolMode("transaction")
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "postgresql.cnpg.io", Version: "v1"}

	// ClusterGVK is the triple to reach Cluster resources in k8s
	ClusterGVK = schema.GroupVersionResource{
		Group:    GroupVersion.Group,
		Version:  GroupVersion.Version,
		Resource: "clusters",
	}

	// PoolerGVK is the triple to reach Pooler resources in k8s
	PoolerGVK = schema.GroupVersionResource{
		Group:    GroupVersion.Group,
		Version:  GroupVersion.Version,
		Resource: "poolers",
	}

	// 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"

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

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (

	// AllowedPgbouncerGenericConfigurationParameters is the list of allowed parameters for PgBouncer
	AllowedPgbouncerGenericConfigurationParameters = stringset.From([]string{
		"application_name_add_host",
		"autodb_idle_timeout",
		"client_idle_timeout",
		"client_login_timeout",
		"default_pool_size",
		"disable_pqexec",
		"idle_transaction_timeout",
		"ignore_startup_parameters",
		"log_connections",
		"log_disconnections",
		"log_pooler_errors",
		"log_stats",
		"max_client_conn",
		"max_db_connections",
		"max_user_connections",
		"min_pool_size",
		"query_timeout",
		"query_wait_timeout",
		"reserve_pool_size",
		"reserve_pool_timeout",
		"server_check_delay",
		"server_check_query",
		"server_connect_timeout",
		"server_fast_close",
		"server_idle_timeout",
		"server_lifetime",
		"server_login_retry",
		"server_reset_query",
		"server_reset_query_always",
		"server_round_robin",
		"stats_period",
		"tcp_keepalive",
		"tcp_keepcnt",
		"tcp_keepidle",
		"tcp_keepintvl",
		"tcp_user_timeout",
		"verbose",
	})
)

Functions

func ConfigMapKeySelectorToCore

func ConfigMapKeySelectorToCore(selector *ConfigMapKeySelector) *corev1.ConfigMapKeySelector

ConfigMapKeySelectorToCore transforms a ConfigMapKeySelector structure to the analogue one in the corev1 namespace

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"`

	// 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"`

	// 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

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 AzureCredentials

type AzureCredentials struct {
	// The connection string to be used
	ConnectionString *SecretKeySelector `json:"connectionString,omitempty"`

	// The storage account where to upload data
	StorageAccount *SecretKeySelector `json:"storageAccount,omitempty"`

	// The storage account key to be used in conjunction
	// with the storage account name
	StorageKey *SecretKeySelector `json:"storageKey,omitempty"`

	// A shared-access-signature to be used in conjunction with
	// the storage account name
	StorageSasToken *SecretKeySelector `json:"storageSasToken,omitempty"`
}

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

func (*AzureCredentials) DeepCopy

func (in *AzureCredentials) DeepCopy() *AzureCredentials

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

func (*AzureCredentials) DeepCopyInto

func (in *AzureCredentials) DeepCopyInto(out *AzureCredentials)

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

type Backup

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

	// 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,omitempty"`
	// 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
	Status BackupStatus `json:"status,omitempty"`
}

Backup is the Schema for the backups API

func (*Backup) DeepCopy

func (in *Backup) DeepCopy() *Backup

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

func (*Backup) DeepCopyInto

func (in *Backup) DeepCopyInto(out *Backup)

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

func (*Backup) DeepCopyObject

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

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

func (*Backup) Default

func (r *Backup) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Backup) GetMetadata

func (backup *Backup) GetMetadata() *metav1.ObjectMeta

GetMetadata get the metadata

func (*Backup) GetName

func (backup *Backup) GetName() string

GetName get the backup name

func (*Backup) GetNamespace

func (backup *Backup) GetNamespace() string

GetNamespace get the backup namespace

func (*Backup) GetStatus

func (backup *Backup) GetStatus() *BackupStatus

GetStatus gets the backup status

func (*Backup) SetupWebhookWithManager

func (r *Backup) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager setup the webhook inside the controller manager

func (*Backup) ValidateCreate

func (r *Backup) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Backup) ValidateDelete

func (r *Backup) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Backup) ValidateUpdate

func (r *Backup) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type BackupConfiguration

type BackupConfiguration struct {
	// The configuration for the barman-cloud tool suite
	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.
	// +kubebuilder:validation:Pattern=^[1-9][0-9]*[dwm]$
	// +optional
	RetentionPolicy string `json:"retentionPolicy,omitempty"`
}

BackupConfiguration defines how the backup of the cluster are taken. Currently the only supported backup method is barmanObjectStore. 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
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of backups
	Items []Backup `json:"items"`
}

BackupList contains a list of Backup

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.

type BackupPhase

type BackupPhase string

BackupPhase is the phase of the backup

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.
	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,omitempty"`
}

BackupSpec defines the desired state of Backup

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 credentials to be used to upload data to S3
	S3Credentials *S3Credentials `json:"s3Credentials,omitempty"`

	// The credentials to be used to upload data to Azure Blob Storage
	AzureCredentials *AzureCredentials `json:"azureCredentials,omitempty"`

	// The credentials to use to upload data to Google Cloud Storage
	GoogleCredentials *GoogleCredentials `json:"googleCredentials,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.
	EndpointCA *SecretKeySelector `json:"endpointCA,omitempty"`

	// Endpoint to be used to upload data to the cloud,
	// overriding the automatic endpoint discovery
	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
	DestinationPath string `json:"destinationPath"`

	// The server name on S3, the cluster name is used if this
	// parameter is omitted
	ServerName string `json:"serverName,omitempty"`

	// Encryption method required to S3 API
	Encryption string `json:"encryption,omitempty"`

	// The ID of the Barman backup
	BackupID string `json:"backupId,omitempty"`

	// The last backup status
	Phase BackupPhase `json:"phase,omitempty"`

	// When the backup was started
	StartedAt *metav1.Time `json:"startedAt,omitempty"`

	// When the backup was terminated
	StoppedAt *metav1.Time `json:"stoppedAt,omitempty"`

	// The starting WAL
	BeginWal string `json:"beginWal,omitempty"`

	// The ending WAL
	EndWal string `json:"endWal,omitempty"`

	// The starting xlog
	BeginLSN string `json:"beginLSN,omitempty"`

	// The ending xlog
	EndLSN string `json:"endLSN,omitempty"`

	// The detected error
	Error string `json:"error,omitempty"`

	// Unused. Retained for compatibility with old versions.
	CommandOutput string `json:"commandOutput,omitempty"`

	// The backup command output in case of error
	CommandError string `json:"commandError,omitempty"`

	// Information to identify the instance where the backup has been taken from
	InstanceID *InstanceID `json:"instanceID,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) 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

type BarmanObjectStoreConfiguration

type BarmanObjectStoreConfiguration struct {
	// The credentials to use to upload data to S3
	S3Credentials *S3Credentials `json:"s3Credentials,omitempty"`

	// The credentials to use to upload data to Azure Blob Storage
	AzureCredentials *AzureCredentials `json:"azureCredentials,omitempty"`

	// The credentials to use to upload data to Google Cloud Storage
	GoogleCredentials *GoogleCredentials `json:"googleCredentials,omitempty"`

	// Endpoint to be used to upload data to the cloud,
	// overriding the automatic endpoint discovery
	EndpointURL string `json:"endpointURL,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
	EndpointCA *SecretKeySelector `json:"endpointCA,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
	// +kubebuilder:validation:MinLength=1
	DestinationPath string `json:"destinationPath"`

	// The server name on S3, the cluster name is used if this
	// parameter is omitted
	ServerName string `json:"serverName,omitempty"`

	// The configuration for the backup of the WAL stream.
	// When not defined, WAL files will be stored uncompressed and may be
	// unencrypted in the object store, according to the bucket default policy.
	Wal *WalBackupConfiguration `json:"wal,omitempty"`

	// The configuration to be used to backup the data files
	// When not defined, base backups files will be stored uncompressed and may
	// be unencrypted in the object store, according to the bucket default
	// policy.
	Data *DataBackupConfiguration `json:"data,omitempty"`

	// Tags is a list of key value pairs that will be passed to the
	// Barman --tags option.
	Tags map[string]string `json:"tags,omitempty"`

	// HistoryTags is a list of key value pairs that will be passed to the
	// Barman --history-tags option.
	HistoryTags map[string]string `json:"historyTags,omitempty"`
}

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

func (*BarmanObjectStoreConfiguration) DeepCopy

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

func (*BarmanObjectStoreConfiguration) DeepCopyInto

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

type BootstrapConfiguration

type BootstrapConfiguration struct {
	// Bootstrap the cluster via initdb
	InitDB *BootstrapInitDB `json:"initdb,omitempty"`

	// Bootstrap the cluster from a backup
	Recovery *BootstrapRecovery `json:"recovery,omitempty"`

	// Bootstrap the cluster taking a physical backup of another compatible
	// PostgreSQL instance
	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

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"`

	// 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"`

	// 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.
	Options []string `json:"options,omitempty"`

	// Whether the `-k` option should be passed to initdb,
	// enabling checksums on data pages (default: `false`)
	DataChecksums *bool `json:"dataChecksums,omitempty"`

	// The value to be passed as option `--encoding` for initdb (default:`UTF8`)
	Encoding string `json:"encoding,omitempty"`

	// The value to be passed as option `--lc-collate` for initdb (default:`C`)
	LocaleCollate string `json:"localeCollate,omitempty"`

	// The value to be passed as option `--lc-ctype` for initdb (default:`C`)
	LocaleCType string `json:"localeCType,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
	WalSegmentSize int `json:"walSegmentSize,omitempty"`

	// List of SQL queries to be executed as a superuser immediately
	// after the cluster has been created - to be used with extreme care
	// (by default empty)
	PostInitSQL []string `json:"postInitSQL,omitempty"`

	// List of SQL queries to be executed as a superuser in the application
	// database right after is created - to be used with extreme care
	// (by default empty)
	PostInitApplicationSQL []string `json:"postInitApplicationSQL,omitempty"`

	// List of SQL queries to be executed as a superuser in the `template1`
	// after the cluster has been created - to be used with extreme care
	// (by default empty)
	PostInitTemplateSQL []string `json:"postInitTemplateSQL,omitempty"`
}

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

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"`
}

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

func (*BootstrapPgBaseBackup) DeepCopy

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 we need to restore
	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
	Source string `json:"source,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
	RecoveryTarget *RecoveryTarget `json:"recoveryTarget,omitempty"`
}

BootstrapRecovery contains the configuration required to restore the backup with the specified name and, after having changed the password with the one chosen for the superuser, will use it to bootstrap a full cluster cloning all the instances from the restored primary. 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 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 />
	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.
	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.
	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 />
	ClientCASecret string `json:"clientCASecret,omitempty"`

	// The list of the server alternative DNS names to be added to the generated server TLS certificates, when required.
	ServerAltDNSNames []string `json:"serverAltDNSNames,omitempty"`
}

CertificatesConfiguration contains the needed configurations to handle server certificates.

func (*CertificatesConfiguration) DeepCopy

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

func (*CertificatesConfiguration) DeepCopyInto

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.
	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,omitempty"`

	// 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,omitempty"`
	// 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
	Status ClusterStatus `json:"status,omitempty"`
}

Cluster is the Schema for the PostgreSQL API

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

func (*Cluster) DeepCopyObject

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

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

func (*Cluster) Default

func (r *Cluster) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

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

func (cluster *Cluster) GetApplicationSecretName() string

GetApplicationSecretName get the name of the secret of the application

func (Cluster) GetBarmanEndpointCAForReplicaCluster

func (cluster Cluster) GetBarmanEndpointCAForReplicaCluster() *SecretKeySelector

GetBarmanEndpointCAForReplicaCluster checks if this is a replica cluster which needs barman endpoint CA

func (*Cluster) GetClientCASecretName

func (cluster *Cluster) GetClientCASecretName() string

GetClientCASecretName get the name of the secret containing the CA of the cluster

func (*Cluster) GetClusterAltDNSNames

func (cluster *Cluster) GetClusterAltDNSNames() []string

GetClusterAltDNSNames returns all the names needed to build a valid Server Certificate

func (*Cluster) GetEnableLDAPAuth

func (cluster *Cluster) GetEnableLDAPAuth() bool

GetEnableLDAPAuth return true if bind or bind+search method are configured in the cluster configuration

func (*Cluster) GetEnableSuperuserAccess

func (cluster *Cluster) GetEnableSuperuserAccess() bool

GetEnableSuperuserAccess returns if the superuser access is enabled or not

func (*Cluster) GetFixedInheritedAnnotations

func (cluster *Cluster) GetFixedInheritedAnnotations() map[string]string

GetFixedInheritedAnnotations gets the annotations that should be inherited by all resources according the cluster spec

func (*Cluster) GetFixedInheritedLabels

func (cluster *Cluster) GetFixedInheritedLabels() map[string]string

GetFixedInheritedLabels gets the labels that should be inherited by all resources according the cluster spec

func (*Cluster) GetImageName

func (cluster *Cluster) GetImageName() string

GetImageName get the name of the image that should be used to create the pods

func (*Cluster) GetImagePullSecret

func (cluster *Cluster) GetImagePullSecret() string

GetImagePullSecret get the name of the pull secret to use to download the PostgreSQL image

func (*Cluster) GetLDAPSecretName

func (cluster *Cluster) GetLDAPSecretName() string

GetLDAPSecretName gets the secret name containing the LDAP password

func (*Cluster) GetMaxStartDelay

func (cluster *Cluster) GetMaxStartDelay() int32

GetMaxStartDelay get the amount of time of startDelay config option

func (*Cluster) GetMaxStopDelay

func (cluster *Cluster) GetMaxStopDelay() int32

GetMaxStopDelay get the amount of time PostgreSQL has to stop

func (*Cluster) GetMaxSwitchoverDelay

func (cluster *Cluster) GetMaxSwitchoverDelay() int32

GetMaxSwitchoverDelay get the amount of time PostgreSQL has to stop before switchover

func (*Cluster) GetPgCtlTimeoutForPromotion

func (cluster *Cluster) GetPgCtlTimeoutForPromotion() int32

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

func (cluster Cluster) GetPostgresGID() int64

GetPostgresGID returns the GID that is being used for the "postgres" user

func (Cluster) GetPostgresUID

func (cluster Cluster) GetPostgresUID() int64

GetPostgresUID returns the UID that is being used for the "postgres" user

func (*Cluster) GetPostgresqlVersion

func (cluster *Cluster) GetPostgresqlVersion() (int, error)

GetPostgresqlVersion gets the PostgreSQL image version detecting it from the image name. Example:

ghcr.io/cloudnative-pg/postgresql:14.0 corresponds to version 140000 ghcr.io/cloudnative-pg/postgresql:13.2 corresponds to version 130002 ghcr.io/cloudnative-pg/postgresql:9.6.3 corresponds to version 90603

func (*Cluster) GetPrimaryUpdateMethod

func (cluster *Cluster) GetPrimaryUpdateMethod() PrimaryUpdateMethod

GetPrimaryUpdateMethod get the cluster primary update method, defaulting to switchover

func (*Cluster) GetPrimaryUpdateStrategy

func (cluster *Cluster) GetPrimaryUpdateStrategy() PrimaryUpdateStrategy

GetPrimaryUpdateStrategy get the cluster primary update strategy, defaulting to unsupervised

func (*Cluster) GetReplicationSecretName

func (cluster *Cluster) GetReplicationSecretName() string

GetReplicationSecretName get the name of the secret for the replication user

func (*Cluster) GetServerCASecretName

func (cluster *Cluster) GetServerCASecretName() string

GetServerCASecretName get the name of the secret containing the CA of the cluster

func (*Cluster) GetServerTLSSecretName

func (cluster *Cluster) GetServerTLSSecretName() string

GetServerTLSSecretName get the name of the secret containing the certificate that is used for the PostgreSQL servers

func (*Cluster) GetServiceAnyName

func (cluster *Cluster) GetServiceAnyName() string

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

func (cluster *Cluster) GetServiceReadName() string

GetServiceReadName return the name of the service that is used for read transactions (including the primary)

func (*Cluster) GetServiceReadOnlyName

func (cluster *Cluster) GetServiceReadOnlyName() string

GetServiceReadOnlyName return the name of the service that is used for read-only transactions (excluding the primary)

func (*Cluster) GetServiceReadWriteName

func (cluster *Cluster) GetServiceReadWriteName() string

GetServiceReadWriteName return the name of the service that is used for read-write transactions

func (*Cluster) GetSuperuserSecretName

func (cluster *Cluster) GetSuperuserSecretName() string

GetSuperuserSecretName get the secret name of the PostgreSQL superuser

func (*Cluster) GetSyncReplicasNumber

func (cluster *Cluster) GetSyncReplicasNumber() (syncReplicas int)

GetSyncReplicasNumber computes the actual number of required synchronous replicas given the requested min, max and the number of ready replicas in the cluster

func (*Cluster) IsInstanceFenced

func (cluster *Cluster) IsInstanceFenced(instance string) bool

IsInstanceFenced check if in a given instance should be fenced

func (*Cluster) IsNodeMaintenanceWindowInProgress

func (cluster *Cluster) IsNodeMaintenanceWindowInProgress() bool

IsNodeMaintenanceWindowInProgress check if the upgrade mode is active or not

func (*Cluster) IsPodMonitorEnabled

func (cluster *Cluster) IsPodMonitorEnabled() bool

IsPodMonitorEnabled checks if the PodMonitor object needs to be created

func (Cluster) IsReplica

func (cluster Cluster) IsReplica() bool

IsReplica checks if this is a replica cluster or not

func (*Cluster) IsReusePVCEnabled

func (cluster *Cluster) IsReusePVCEnabled() bool

IsReusePVCEnabled check if in a maintenance window we should reuse PVCs

func (*Cluster) LogTimestampsWithMessage added in v1.15.3

func (cluster *Cluster) LogTimestampsWithMessage(ctx context.Context, logMessage string)

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

func (r *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager setup the webhook inside the controller manager

func (Cluster) ShouldCreateApplicationDatabase

func (cluster Cluster) ShouldCreateApplicationDatabase() bool

ShouldCreateApplicationDatabase returns true if for this cluster, during the bootstrap phase, we need to create an application database

func (*Cluster) ShouldResizeInUseVolumes

func (cluster *Cluster) ShouldResizeInUseVolumes() bool

ShouldResizeInUseVolumes is true when we should resize PVC we already created

func (*Cluster) UsesConfigMap

func (cluster *Cluster) UsesConfigMap(config string) (ok bool)

UsesConfigMap checks whether a given secret is used by a Cluster

func (*Cluster) UsesSecret

func (cluster *Cluster) UsesSecret(secret string) bool

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

func (r *Cluster) Validate() (allErrs field.ErrorList)

Validate groups the validation logic for clusters returning a list of all encountered errors

func (*Cluster) ValidateChanges

func (r *Cluster) ValidateChanges(old *Cluster) (allErrs field.ErrorList)

ValidateChanges groups the validation logic for cluster changes checking the differences between the previous version and the new one of the cluster, returning a list of all encountered errors

func (*Cluster) ValidateCreate

func (r *Cluster) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Cluster) ValidateDelete

func (r *Cluster) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Cluster) ValidateUpdate

func (r *Cluster) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type ClusterCondition

type ClusterCondition struct {
	// Type of the condition.
	Type ClusterConditionType `json:"type,omitempty"`
	// Status of the condition, one of True, False, Unknown.
	Status ConditionStatus `json:"status,omitempty"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
}

ClusterCondition describes the state of a cluster object at a certain point

func (*ClusterCondition) DeepCopy

func (in *ClusterCondition) DeepCopy() *ClusterCondition

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

func (*ClusterCondition) DeepCopyInto

func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)

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

type ClusterConditionType

type ClusterConditionType string

ClusterConditionType is of string type

const (
	// ConditionContinuousArchiving this condition archiving :owned by InstanceManager.
	ConditionContinuousArchiving ClusterConditionType = "ContinuousArchiving"
	// ConditionBackup this condition looking backup status :owned by InstanceManager.
	ConditionBackup ClusterConditionType = "LastBackupSucceeded"
)

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 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
	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 ClusterSpec

type ClusterSpec struct {
	// Description of this PostgreSQL cluster
	Description string `json:"description,omitempty"`

	// Metadata that will be inherited by all objects related to the Cluster
	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>`)
	ImageName string `json:"imageName,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"`

	// The UID of the `postgres` user inside the image, defaults to `26`
	// +kubebuilder:default:=26
	PostgresUID int64 `json:"postgresUID,omitempty"`

	// The GID of the `postgres` user inside the image, defaults to `26`
	// +kubebuilder:default:=26
	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
	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
	MaxSyncReplicas int `json:"maxSyncReplicas,omitempty"`

	// Configuration of the PostgreSQL server
	// +optional
	PostgresConfiguration PostgresConfiguration `json:"postgresql,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`. Enabled by default.
	// +kubebuilder:default:=true
	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
	ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// Configuration of the storage of the instances
	// +optional
	StorageConfiguration StorageConfiguration `json:"storage,omitempty"`

	// The time in seconds that is allowed for a PostgreSQL instance to
	// successfully start up (default 30)
	// +kubebuilder:default:=30
	MaxStartDelay int32 `json:"startDelay,omitempty"`

	// The time in seconds that is allowed for a PostgreSQL instance to
	// gracefully shutdown (default 30)
	// +kubebuilder:default:=30
	MaxStopDelay int32 `json:"stopDelay,omitempty"`

	// The time in seconds that is allowed for a primary PostgreSQL instance
	// to gracefully shutdown during a switchover.
	// Default value is 40000000, greater than one year in seconds,
	// big enough to simulate an infinite delay
	// +kubebuilder:default:=40000000
	MaxSwitchoverDelay int32 `json:"switchoverDelay,omitempty"`

	// Affinity/Anti-affinity rules for Pods
	// +optional
	Affinity AffinityConfiguration `json:"affinity,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"`

	// 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
	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` - default) or in-place (`restart`)
	// +kubebuilder:default:=switchover
	// +kubebuilder:validation:Enum:=switchover;restart
	PrimaryUpdateMethod PrimaryUpdateMethod `json:"primaryUpdateMethod,omitempty"`

	// The configuration to be used for backups
	Backup *BackupConfiguration `json:"backup,omitempty"`

	// Define a maintenance window for the Kubernetes nodes
	NodeMaintenanceWindow *NodeMaintenanceWindow `json:"nodeMaintenanceWindow,omitempty"`

	// The configuration of the monitoring infrastructure of this cluster
	Monitoring *MonitoringConfiguration `json:"monitoring,omitempty"`

	// The list of external clusters which are used in the configuration
	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
	LogLevel string `json:"logLevel,omitempty"`
}

ClusterSpec defines the desired state of Cluster

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 {
	// Total number of instances in the cluster
	Instances int `json:"instances,omitempty"`

	// Total number of ready instances in the cluster
	ReadyInstances int `json:"readyInstances,omitempty"`

	// Instances status
	InstancesStatus map[utils.PodStatus][]string `json:"instancesStatus,omitempty"`

	// ID of the latest generated node (used to avoid node name clashing)
	LatestGeneratedNode int `json:"latestGeneratedNode,omitempty"`

	// Current primary instance
	CurrentPrimary string `json:"currentPrimary,omitempty"`

	// Target primary instance, this is different from the previous one
	// during a switchover or a failover
	TargetPrimary string `json:"targetPrimary,omitempty"`

	// How many PVCs have been created by this cluster
	PVCCount int32 `json:"pvcCount,omitempty"`

	// How many Jobs have been created by this cluster
	JobCount int32 `json:"jobCount,omitempty"`

	// List of all the PVCs created by this cluster and still available
	// which are not attached to a Pod
	DanglingPVC []string `json:"danglingPVC,omitempty"`

	// List of all the PVCs that have ResizingPVC condition.
	ResizingPVC []string `json:"resizingPVC,omitempty"`

	// List of all the PVCs that are being initialized by this cluster
	InitializingPVC []string `json:"initializingPVC,omitempty"`

	// List of all the PVCs not dangling nor initializing
	HealthyPVC []string `json:"healthyPVC,omitempty"`

	// Current write pod
	WriteService string `json:"writeService,omitempty"`

	// Current list of read pods
	ReadService string `json:"readService,omitempty"`

	// Current phase of the cluster
	Phase string `json:"phase,omitempty"`

	// Reason for the current phase
	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
	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
	ConfigMapResourceVersion ConfigMapResourceVersion `json:"configMapResourceVersion,omitempty"`

	// The configuration for the CA and related certificates, initialized with defaults.
	Certificates CertificatesStatus `json:"certificates,omitempty"`

	// The first recoverability point, stored as a date in RFC3339 format
	FirstRecoverabilityPoint string `json:"firstRecoverabilityPoint,omitempty"`

	// The commit hash number of which this operator running
	CommitHash string `json:"cloudNativePGCommitHash,omitempty"`

	// The timestamp when the last actual promotion to primary has occurred
	CurrentPrimaryTimestamp string `json:"currentPrimaryTimestamp,omitempty"`

	// The timestamp when the last request for a new primary has occurred
	TargetPrimaryTimestamp string `json:"targetPrimaryTimestamp,omitempty"`

	// The integration needed by poolers referencing the cluster
	PoolerIntegrations *PoolerIntegrations `json:"poolerIntegrations,omitempty"`

	// The hash of the binary of the operator
	OperatorHash string `json:"cloudNativePGOperatorHash,omitempty"`

	// OnlineUpdateEnabled shows if the online upgrade is enabled inside the cluster
	OnlineUpdateEnabled bool `json:"onlineUpdateEnabled,omitempty"`

	// AzurePVCUpdateEnabled shows if the PVC online upgrade is enabled for this cluster
	AzurePVCUpdateEnabled bool `json:"azurePVCUpdateEnabled,omitempty"`

	// Conditions for cluster object
	Conditions []ClusterCondition `json:"conditions,omitempty"`
}

ClusterStatus defines the observed state of Cluster

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.

type CompressionType

type CompressionType string

CompressionType encapsulates the available types of compression

type ConditionReason added in v1.15.5

type ConditionReason string

ConditionReason defines the reason why a certain condition changed

const (
	// 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"
)

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 struct {
	// The name of the secret in the pod's namespace to select from.
	LocalObjectReference `json:",inline"`
	// The key to select
	Key string `json:"key"`
}

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

func (*ConfigMapKeySelector) DeepCopy

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

func (*ConfigMapKeySelector) DeepCopyInto

func (in *ConfigMapKeySelector) DeepCopyInto(out *ConfigMapKeySelector)

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

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
	Metrics map[string]string `json:"metrics,omitempty"`
}

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

func (*ConfigMapResourceVersion) DeepCopy

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 struct {
	// Compress a backup file (a tar file per tablespace) while streaming it
	// to the object store. Available options are empty string (no
	// compression, default), `gzip`, `bzip2` or `snappy`.
	// +kubebuilder:validation:Enum=gzip;bzip2;snappy
	Compression CompressionType `json:"compression,omitempty"`

	// Whenever to force the encryption of files (if the bucket is
	// not already configured for that).
	// Allowed options are empty string (use the bucket policy, default),
	// `AES256` and `aws:kms`
	// +kubebuilder:validation:Enum=AES256;"aws:kms"
	Encryption EncryptionType `json:"encryption,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.
	ImmediateCheckpoint bool `json:"immediateCheckpoint,omitempty"`

	// The number of parallel jobs to be used to upload the backup, defaults
	// to 2
	// +kubebuilder:validation:Minimum=1
	Jobs *int32 `json:"jobs,omitempty"`
}

DataBackupConfiguration is the configuration of the backup of the data directory

func (*DataBackupConfiguration) DeepCopy

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

func (*DataBackupConfiguration) DeepCopyInto

func (in *DataBackupConfiguration) DeepCopyInto(out *DataBackupConfiguration)

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

type EmbeddedObjectMetadata

type EmbeddedObjectMetadata struct {
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

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

func (*EmbeddedObjectMetadata) DeepCopy

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 EncryptionType

type EncryptionType string

EncryptionType encapsulated the available types of encryption

type ExternalCluster

type ExternalCluster struct {
	// The server name, required
	Name string `json:"name"`

	// The list of connection parameters, such as dbname, host, username, etc
	ConnectionParameters map[string]string `json:"connectionParameters,omitempty"`

	// The reference to an SSL certificate to be used to connect to this
	// instance
	SSLCert *corev1.SecretKeySelector `json:"sslCert,omitempty"`

	// The reference to an SSL private key to be used to connect to this
	// instance
	SSLKey *corev1.SecretKeySelector `json:"sslKey,omitempty"`

	// The reference to an SSL CA public key to be used to connect to this
	// instance
	SSLRootCert *corev1.SecretKeySelector `json:"sslRootCert,omitempty"`

	// The reference to the password to be used to connect to the server
	Password *corev1.SecretKeySelector `json:"password,omitempty"`

	// The configuration for the barman-cloud tool suite
	BarmanObjectStore *BarmanObjectStoreConfiguration `json:"barmanObjectStore,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 GoogleCredentials

type GoogleCredentials struct {
	// If set to true, will presume that it's running inside a GKE environment,
	// default to false.
	// +optional
	GKEEnvironment bool `json:"gkeEnvironment"`

	// The secret containing the Google Cloud Storage JSON file with the credentials
	ApplicationCredentials *SecretKeySelector `json:"applicationCredentials,omitempty"`
}

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

func (*GoogleCredentials) DeepCopy

func (in *GoogleCredentials) DeepCopy() *GoogleCredentials

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

func (*GoogleCredentials) DeepCopyInto

func (in *GoogleCredentials) DeepCopyInto(out *GoogleCredentials)

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
	PodName string `json:"podName,omitempty"`
	// The container ID
	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 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
	Prefix string `json:"prefix,omitempty"`
	// Suffix for the bind authentication option
	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
	BaseDN string `json:"baseDN,omitempty"`
	// DN of the user to bind to the directory
	BindDN string `json:"bindDN,omitempty"`
	// Secret with the password for the user to bind to the directory
	BindPassword *corev1.SecretKeySelector `json:"bindPassword,omitempty"`

	// Attribute to match against the username
	SearchAttribute string `json:"searchAttribute,omitempty"`
	// Search filter to use when doing the search+bind authentication
	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
	Server string `json:"server,omitempty"`
	// LDAP server port
	Port int `json:"port,omitempty"`

	// LDAP schema to be used, possible options are `ldap` and `ldaps`
	// +kubebuilder:validation:Enum=ldap;ldaps
	Scheme LDAPScheme `json:"scheme,omitempty"`

	// Set to 'true' to enable LDAP over TLS. 'false' is default
	TLS bool `json:"tls,omitempty"`

	// Bind as authentication configuration
	BindAsAuth *LDAPBindAsAuth `json:"bindAsAuth,omitempty"`

	// Bind+Search authentication configuration
	BindSearchAuth *LDAPBindSearchAuth `json:"bindSearchAuth,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 LocalObjectReference

type LocalObjectReference struct {
	// Name of the referent.
	Name string `json:"name"`
}

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

func (*LocalObjectReference) DeepCopy

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

func (*LocalObjectReference) DeepCopyInto

func (in *LocalObjectReference) DeepCopyInto(out *LocalObjectReference)

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
	DisableDefaultQueries *bool `json:"disableDefaultQueries,omitempty"`

	// The list of config maps containing the custom queries
	CustomQueriesConfigMap []ConfigMapKeySelector `json:"customQueriesConfigMap,omitempty"`

	// The list of secrets containing the custom queries
	CustomQueriesSecret []SecretKeySelector `json:"customQueriesSecret,omitempty"`

	// Enable or disable the `PodMonitor`
	// +kubebuilder:default:=false
	EnablePodMonitor bool `json:"enablePodMonitor,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

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 {
	// Is there a node maintenance activity in progress?
	// +kubebuilder:default:=false
	InProgress bool `json:"inProgress"`

	// 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"`
}

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

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 PgBouncerIntegrationStatus

type PgBouncerIntegrationStatus struct {
	Secrets []string `json:"secrets,omitempty"`
}

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

func (*PgBouncerIntegrationStatus) DeepCopy

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

func (*PgBouncerIntegrationStatus) DeepCopyInto

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
	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
	// +kubebuilder:default:=session
	PoolMode PgBouncerPoolMode `json:"poolMode"`

	// The credentials of the user that need to be used for the authentication
	// query. In case it is specified, also an AuthQuery
	// (e.g. "SELECT usename, passwd FROM pg_shadow WHERE usename=$1")
	// has to be specified and no automatic CNPG Cluster integration will be triggered.
	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 user_search($1)".
	// In case it is specified, also an AuthQuerySecret has to be specified and
	// no automatic CNPG Cluster integration will be triggered.
	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
	Parameters map[string]string `json:"parameters,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
	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 PodMeta

type PodMeta struct {
	// 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"`
}

PodMeta 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 (*PodMeta) DeepCopy

func (in *PodMeta) DeepCopy() *PodMeta

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

func (*PodMeta) DeepCopyInto

func (in *PodMeta) DeepCopyInto(out *PodMeta)

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

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 PodMeta `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 Pooler

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

	Spec   PoolerSpec   `json:"spec,omitempty"`
	Status PoolerStatus `json:"status,omitempty"`
}

Pooler is the Schema for the poolers API

func (*Pooler) DeepCopy

func (in *Pooler) DeepCopy() *Pooler

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

func (*Pooler) DeepCopyInto

func (in *Pooler) DeepCopyInto(out *Pooler)

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

func (*Pooler) DeepCopyObject

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

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

func (*Pooler) GetAuthQuery

func (in *Pooler) GetAuthQuery() string

GetAuthQuery returns the specified AuthQuery name for PgBouncer if provided or the default name otherwise.

func (*Pooler) GetAuthQuerySecretName

func (in *Pooler) GetAuthQuerySecretName() string

GetAuthQuerySecretName returns the specified AuthQuerySecret name for PgBouncer if provided or the default name otherwise.

func (*Pooler) SetupWebhookWithManager

func (r *Pooler) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager setup the webhook inside the controller manager

func (*Pooler) Validate

func (r *Pooler) Validate() (allErrs field.ErrorList)

Validate validates the configuration of a Pooler, returning a list of errors

func (*Pooler) ValidateCreate

func (r *Pooler) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Pooler) ValidateDelete

func (r *Pooler) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Pooler) ValidateUpdate

func (r *Pooler) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type PoolerIntegrations

type PoolerIntegrations struct {
	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"`
	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 PoolerSecrets

type PoolerSecrets struct {
	// The server TLS secret version
	ServerTLS SecretVersion `json:"serverTLS,omitempty"`

	// The server CA secret version
	ServerCA SecretVersion `json:"serverCA,omitempty"`

	// The client CA secret version
	ClientCA SecretVersion `json:"clientCA,omitempty"`

	// The version of the secrets used by PgBouncer
	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"`

	// Which instances we must forward traffic to?
	// +kubebuilder:default:=rw
	Type PoolerType `json:"type"`

	// The number of replicas we want
	// +kubebuilder:default:=1
	Instances int32 `json:"instances"`

	// The template of the Pod to be created
	Template *PodTemplateSpec `json:"template,omitempty"`

	// The PgBouncer configuration
	PgBouncer *PgBouncerSpec `json:"pgbouncer"`
}

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
	Secrets *PoolerSecrets `json:"secrets,omitempty"`
	// The number of pods trying to be scheduled
	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 +kubebuilder:validation:Enum=rw;ro

type PostgresConfiguration

type PostgresConfiguration struct {
	// PostgreSQL configuration options (postgresql.conf)
	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"`

	// 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"`

	// 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"`
}

PostgresConfiguration defines the PostgreSQL configuration

func (*PostgresConfiguration) DeepCopy

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 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.
	BackupID string `json:"backupID,omitempty"`

	// The target timeline ("latest" or a positive integer)
	TargetTLI string `json:"targetTLI,omitempty"`

	// The target transaction ID
	TargetXID string `json:"targetXID,omitempty"`

	// The target name (to be previously created
	// with `pg_create_restore_point`)
	TargetName string `json:"targetName,omitempty"`

	// The target LSN (Log Sequence Number)
	TargetLSN string `json:"targetLSN,omitempty"`

	// The target time as a timestamp in the RFC3339 standard
	TargetTime string `json:"targetTime,omitempty"`

	// End recovery as soon as a consistent state is reached
	TargetImmediate *bool `json:"targetImmediate,omitempty"`

	// Set the target to be exclusive (defaults to true)
	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.

type ReplicaClusterConfiguration

type ReplicaClusterConfiguration struct {
	// 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 Replication page of the documentation for more information.
	// +optional
	Enabled bool `json:"enabled"`

	// The name of the external cluster which is the replication origin
	// +kubebuilder:validation:MinLength=1
	Source string `json:"source"`
}

ReplicaClusterConfiguration encapsulates the configuration of a replica cluster

func (*ReplicaClusterConfiguration) DeepCopy

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

func (*ReplicaClusterConfiguration) DeepCopyInto

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

type RollingUpdateStatus

type RollingUpdateStatus struct {
	// The image which we put into the Pod
	ImageName string `json:"imageName"`

	// When the update has been started
	StartedAt metav1.Time `json:"startedAt,omitempty"`
}

RollingUpdateStatus contains the information about an instance which is being updated

func (*RollingUpdateStatus) DeepCopy

func (in *RollingUpdateStatus) DeepCopy() *RollingUpdateStatus

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

func (*RollingUpdateStatus) DeepCopyInto

func (in *RollingUpdateStatus) DeepCopyInto(out *RollingUpdateStatus)

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

type S3Credentials

type S3Credentials struct {
	// The reference to the access key id
	AccessKeyIDReference *SecretKeySelector `json:"accessKeyId,omitempty"`

	// The reference to the secret access key
	SecretAccessKeyReference *SecretKeySelector `json:"secretAccessKey,omitempty"`

	// The references to the session key
	SessionToken *SecretKeySelector `json:"sessionToken,omitempty"`

	// Use the role based authentication without providing explicitly the keys.
	// +optional
	InheritFromIAMRole bool `json:"inheritFromIAMRole"`
}

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

func (*S3Credentials) DeepCopy

func (in *S3Credentials) DeepCopy() *S3Credentials

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

func (*S3Credentials) DeepCopyInto

func (in *S3Credentials) DeepCopyInto(out *S3Credentials)

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

type ScheduledBackup

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

	// 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,omitempty"`
	// 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
	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) Default

func (r *ScheduledBackup) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

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

func (*ScheduledBackup) SetupWebhookWithManager

func (r *ScheduledBackup) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager setup the webhook inside the controller manager

func (*ScheduledBackup) ValidateCreate

func (r *ScheduledBackup) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*ScheduledBackup) ValidateDelete

func (r *ScheduledBackup) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*ScheduledBackup) ValidateUpdate

func (r *ScheduledBackup) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

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
	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
	Suspend *bool `json:"suspend,omitempty"`

	// If the first backup has to be immediately start after creation or not
	Immediate *bool `json:"immediate,omitempty"`

	// The schedule follows the same format used in Kubernetes CronJobs,
	// 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,omitempty"`

	// 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
	BackupOwnerReference string `json:"backupOwnerReference,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
	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

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 SecretKeySelector

type SecretKeySelector struct {
	// The name of the secret in the pod's namespace to select from.
	LocalObjectReference `json:",inline"`
	// The key to select
	Key string `json:"key"`
}

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

func (*SecretKeySelector) DeepCopy

func (in *SecretKeySelector) DeepCopy() *SecretKeySelector

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

func (*SecretKeySelector) DeepCopyInto

func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector)

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

type SecretVersion

type SecretVersion struct {
	// The name of the secret
	Name string `json:"name,omitempty"`

	// The ResourceVersion of the secret
	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
	SuperuserSecretVersion string `json:"superuserSecretVersion,omitempty"`

	// The resource version of the "streaming_replica" user secret
	ReplicationSecretVersion string `json:"replicationSecretVersion,omitempty"`

	// The resource version of the "app" user secret
	ApplicationSecretVersion string `json:"applicationSecretVersion,omitempty"`

	// Unused. Retained for compatibility with old versions.
	CASecretVersion string `json:"caSecretVersion,omitempty"`

	// The resource version of the PostgreSQL client-side CA secret version
	ClientCASecretVersion string `json:"clientCaSecretVersion,omitempty"`

	// The resource version of the PostgreSQL server-side CA secret version
	ServerCASecretVersion string `json:"serverCaSecretVersion,omitempty"`

	// The resource version of the PostgreSQL server-side secret version
	ServerSecretVersion string `json:"serverSecretVersion,omitempty"`

	// The resource version of the Barman Endpoint CA if provided
	BarmanEndpointCA string `json:"barmanEndpointCA,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
	Metrics map[string]string `json:"metrics,omitempty"`
}

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

func (*SecretsResourceVersion) DeepCopy

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.

type StorageConfiguration

type StorageConfiguration struct {
	// StorageClass to use for database data (`PGDATA`). Applied after
	// evaluating the PVC template, if available.
	// If not specified, generated PVCs will be satisfied by the
	// default storage class
	// +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.
	Size string `json:"size"`

	// 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 of the storage of the PostgreSQL instances

func (*StorageConfiguration) DeepCopy

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.

type WalBackupConfiguration

type WalBackupConfiguration struct {
	// Compress a WAL file before sending it to the object store. Available
	// options are empty string (no compression, default), `gzip`, `bzip2` or `snappy`.
	// +kubebuilder:validation:Enum=gzip;bzip2;snappy
	Compression CompressionType `json:"compression,omitempty"`

	// Whenever to force the encryption of files (if the bucket is
	// not already configured for that).
	// Allowed options are empty string (use the bucket policy, default),
	// `AES256` and `aws:kms`
	// +kubebuilder:validation:Enum=AES256;"aws:kms"
	Encryption EncryptionType `json:"encryption,omitempty"`

	// Number of WAL files to be either archived in parallel (when the
	// PostgreSQL instance is archiving to a backup object store) or
	// restored in parallel (when a PostgreSQL standby is fetching WAL
	// files from a recovery object store). If not specified, WAL files
	// will be processed one at a time. It accepts a positive integer as a
	// value - with 1 being the minimum accepted value.
	// +kubebuilder:validation:Minimum=1
	MaxParallel int `json:"maxParallel,omitempty"`
}

WalBackupConfiguration is the configuration of the backup of the WAL stream

func (*WalBackupConfiguration) DeepCopy

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

func (*WalBackupConfiguration) DeepCopyInto

func (in *WalBackupConfiguration) DeepCopyInto(out *WalBackupConfiguration)

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