Documentation
¶
Overview ¶
package v1 contains API Schema definitions for the postgres-operator v1beta1 API group +kubebuilder:object:generate=true +groupName=postgres-operator.crunchydata.com
Index ¶
- Constants
- Variables
- type Backups
- type DataSource
- type DataSourceVolume
- type DataSourceVolumes
- type DatabaseInitSQL
- type InstanceSidecars
- type MonitoringSpec
- type MonitoringStatus
- type PGBackRestArchive
- type PGBouncerPodSpec
- type PostgresCluster
- type PostgresClusterDataSource
- type PostgresClusterList
- type PostgresClusterSpec
- type PostgresClusterStatus
- type PostgresConfigSpec
- type PostgresInstanceSetSpec
- type PostgresInstanceSetStatus
- type PostgresProxySpec
- type PostgresProxyStatus
- type PostgresStandbySpec
- type PostgresUserInterfaceStatus
- type RegistrationRequirementStatus
- type TablespaceVolume
- type UserInterfaceSpec
- type VolumeSnapshots
Constants ¶
const ( PersistentVolumeResizing = "PersistentVolumeResizing" PersistentVolumeResizeError = "PersistentVolumeResizeError" PostgresClusterProgressing = "Progressing" ProxyAvailable = "ProxyAvailable" Registered = "Registered" )
PostgresClusterStatus condition types.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "postgres-operator.crunchydata.com", Version: "v1"} // 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 )
Functions ¶
This section is empty.
Types ¶
type Backups ¶
type Backups struct {
// pgBackRest archive configuration
// +optional
PGBackRest PGBackRestArchive `json:"pgbackrest"`
// VolumeSnapshot configuration
// +optional
Snapshots *VolumeSnapshots `json:"snapshots,omitempty"`
}
Backups defines a PostgreSQL archive configuration
func (*Backups) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backups.
func (*Backups) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DataSource ¶
type DataSource struct {
// Defines a pgBackRest cloud-based data source that can be used to pre-populate the
// PostgreSQL data directory for a new PostgreSQL cluster using a pgBackRest restore.
// The PGBackRest field is incompatible with the PostgresCluster field: only one
// data source can be used for pre-populating a new PostgreSQL cluster
// +optional
// +kubebuilder:validation:XValidation:rule="!has(self.repo.volume)", message="Only S3, GCS or Azure repos can be used as a pgBackRest data source.", fieldPath=".repo"
PGBackRest *v1beta1.PGBackRestDataSource `json:"pgbackrest,omitempty"`
// Defines a pgBackRest data source that can be used to pre-populate the PostgreSQL data
// directory for a new PostgreSQL cluster using a pgBackRest restore.
// The PGBackRest field is incompatible with the PostgresCluster field: only one
// data source can be used for pre-populating a new PostgreSQL cluster
// +optional
PostgresCluster *PostgresClusterDataSource `json:"postgresCluster,omitempty"`
// Defines any existing volumes to reuse for this PostgresCluster.
// +optional
Volumes *DataSourceVolumes `json:"volumes,omitempty"`
}
DataSource defines data sources for a new PostgresCluster.
func (*DataSource) DeepCopy ¶
func (in *DataSource) DeepCopy() *DataSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataSource.
func (*DataSource) DeepCopyInto ¶
func (in *DataSource) DeepCopyInto(out *DataSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DataSourceVolume ¶
type DataSourceVolume struct {
// The existing PVC name.
PVCName string `json:"pvcName"`
// The existing directory. When not set, a move Job is not created for the
// associated volume.
// +optional
Directory string `json:"directory,omitempty"`
}
DataSourceVolume defines the PVC name and data directory path for an existing cluster volume.
func (*DataSourceVolume) DeepCopy ¶
func (in *DataSourceVolume) DeepCopy() *DataSourceVolume
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataSourceVolume.
func (*DataSourceVolume) DeepCopyInto ¶
func (in *DataSourceVolume) DeepCopyInto(out *DataSourceVolume)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DataSourceVolumes ¶
type DataSourceVolumes struct {
// Defines the existing pgData volume and directory to use in the current
// PostgresCluster.
// +optional
PGDataVolume *DataSourceVolume `json:"pgDataVolume,omitempty"`
// Defines the existing pg_wal volume and directory to use in the current
// PostgresCluster. Note that a defined pg_wal volume MUST be accompanied by
// a pgData volume.
// +optional
PGWALVolume *DataSourceVolume `json:"pgWALVolume,omitempty"`
// Defines the existing pgBackRest repo volume and directory to use in the
// current PostgresCluster.
// +optional
PGBackRestVolume *DataSourceVolume `json:"pgBackRestVolume,omitempty"`
}
DataSourceVolumes defines any existing volumes to reuse for this PostgresCluster.
func (*DataSourceVolumes) DeepCopy ¶
func (in *DataSourceVolumes) DeepCopy() *DataSourceVolumes
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataSourceVolumes.
func (*DataSourceVolumes) DeepCopyInto ¶
func (in *DataSourceVolumes) DeepCopyInto(out *DataSourceVolumes)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DatabaseInitSQL ¶
type DatabaseInitSQL struct {
// Name is the name of a ConfigMap
// +required
Name string `json:"name"`
// Key is the ConfigMap data key that points to a SQL string
// +required
Key string `json:"key"`
}
DatabaseInitSQL defines a ConfigMap containing custom SQL that will be run after the cluster is initialized. This ConfigMap must be in the same namespace as the cluster.
func (*DatabaseInitSQL) DeepCopy ¶
func (in *DatabaseInitSQL) DeepCopy() *DatabaseInitSQL
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseInitSQL.
func (*DatabaseInitSQL) DeepCopyInto ¶
func (in *DatabaseInitSQL) DeepCopyInto(out *DatabaseInitSQL)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstanceSidecars ¶
type InstanceSidecars struct {
// Defines the configuration for the replica cert copy sidecar container
// +optional
ReplicaCertCopy *v1beta1.Sidecar `json:"replicaCertCopy,omitempty"`
}
InstanceSidecars defines the configuration for instance sidecar containers
func (*InstanceSidecars) DeepCopy ¶
func (in *InstanceSidecars) DeepCopy() *InstanceSidecars
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSidecars.
func (*InstanceSidecars) DeepCopyInto ¶
func (in *InstanceSidecars) DeepCopyInto(out *InstanceSidecars)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MonitoringSpec ¶
type MonitoringSpec struct {
// +optional
PGMonitor *v1beta1.PGMonitorSpec `json:"pgmonitor,omitempty"`
}
MonitoringSpec is a union of the supported PostgreSQL Monitoring tools
func (*MonitoringSpec) DeepCopy ¶
func (in *MonitoringSpec) DeepCopy() *MonitoringSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringSpec.
func (*MonitoringSpec) DeepCopyInto ¶
func (in *MonitoringSpec) DeepCopyInto(out *MonitoringSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MonitoringStatus ¶
type MonitoringStatus struct {
// +optional
ExporterConfiguration string `json:"exporterConfiguration,omitempty"`
}
MonitoringStatus is the current state of PostgreSQL cluster monitoring tool configuration
func (*MonitoringStatus) DeepCopy ¶
func (in *MonitoringStatus) DeepCopy() *MonitoringStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringStatus.
func (*MonitoringStatus) DeepCopyInto ¶
func (in *MonitoringStatus) DeepCopyInto(out *MonitoringStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PGBackRestArchive ¶
type PGBackRestArchive struct {
v1beta1.PGBackRestArchive `json:",inline"`
}
PGBackRestArchive defines a pgBackRest archive configuration +kubebuilder:validation:XValidation:rule=`!self.?log.path.hasValue() || self.log.path.startsWith("/volumes/")`,message=`pgbackrest sidecar log path is restricted to an existing additional volume` +kubebuilder:validation:XValidation:rule=`!self.?repoHost.log.path.hasValue() || self.repoHost.volumes.additional.exists(x, self.repoHost.log.path.startsWith("/volumes/"+x.name))`,message=`repo host log path is restricted to an existing additional volume` +kubebuilder:validation:XValidation:rule=`!self.?jobs.log.path.hasValue() || self.jobs.volumes.additional.exists(x, self.jobs.log.path.startsWith("/volumes/"+x.name))`,message=`backup jobs log path is restricted to an existing additional volume` +kubebuilder:validation:XValidation:rule=`!self.?global["log-path"].hasValue()`,message=`pgbackrest log-path must be set via the various log.path fields in the spec`
func (*PGBackRestArchive) DeepCopy ¶
func (in *PGBackRestArchive) DeepCopy() *PGBackRestArchive
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGBackRestArchive.
func (*PGBackRestArchive) DeepCopyInto ¶
func (in *PGBackRestArchive) DeepCopyInto(out *PGBackRestArchive)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PGBouncerPodSpec ¶
type PGBouncerPodSpec struct {
v1beta1.PGBouncerPodSpec `json:",inline"`
}
PGBouncerPodSpec defines the desired state of a PgBouncer connection pooler. +kubebuilder:validation:XValidation:rule=`self.?config.global.logfile.optMap(f, f.startsWith("/tmp/logs/pgbouncer/") || (self.?volumes.additional.hasValue() && self.volumes.additional.exists(v, f.startsWith("/volumes/" + v.name)))).orValue(true)`,message=`config.global.logfile destination is restricted to '/tmp/logs/pgbouncer/' or an existing additional volume`
func (*PGBouncerPodSpec) DeepCopy ¶
func (in *PGBouncerPodSpec) DeepCopy() *PGBouncerPodSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PGBouncerPodSpec.
func (*PGBouncerPodSpec) DeepCopyInto ¶
func (in *PGBouncerPodSpec) DeepCopyInto(out *PGBouncerPodSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresCluster ¶
type PostgresCluster struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitzero"`
// +optional
Spec PostgresClusterSpec `json:"spec,omitzero"`
// +optional
Status PostgresClusterStatus `json:"status,omitzero"`
}
PostgresCluster is the Schema for the postgresclusters API
func NewPostgresCluster ¶
func NewPostgresCluster() *PostgresCluster
func (*PostgresCluster) DeepCopy ¶
func (in *PostgresCluster) DeepCopy() *PostgresCluster
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresCluster.
func (*PostgresCluster) DeepCopyInto ¶
func (in *PostgresCluster) DeepCopyInto(out *PostgresCluster)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostgresCluster) DeepCopyObject ¶
func (in *PostgresCluster) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*PostgresCluster) Default ¶
func (c *PostgresCluster) Default()
Default implements "sigs.k8s.io/controller-runtime/pkg/webhook.Defaulter" so a webhook can be registered for the type. - https://book.kubebuilder.io/reference/webhook-overview.html
type PostgresClusterDataSource ¶
type PostgresClusterDataSource struct {
// The name of an existing PostgresCluster to use as the data source for the new PostgresCluster.
// Defaults to the name of the PostgresCluster being created if not provided.
// +optional
ClusterName string `json:"clusterName,omitempty"`
// The namespace of the cluster specified as the data source using the clusterName field.
// Defaults to the namespace of the PostgresCluster being created if not provided.
// +optional
ClusterNamespace string `json:"clusterNamespace,omitempty"`
// The name of the pgBackRest repo within the source PostgresCluster that contains the backups
// that should be utilized to perform a pgBackRest restore when initializing the data source
// for the new PostgresCluster.
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=^repo[1-4]
RepoName string `json:"repoName"`
// Command line options to include when running the pgBackRest restore command.
// https://pgbackrest.org/command.html#command-restore
// +optional
Options []string `json:"options,omitempty"`
// Resource requirements for the pgBackRest restore Job.
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitzero"`
// Scheduling constraints of the pgBackRest restore Job.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node
// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// Priority class name for the pgBackRest restore Job pod. Changing this
// value causes PostgreSQL to restart.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
// +optional
PriorityClassName *string `json:"priorityClassName,omitempty"`
// Tolerations of the pgBackRest restore Job.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Volumes to add to Restore Job Pods
// +optional
Volumes *v1beta1.PGBackRestVolumesSpec `json:"volumes,omitempty"`
}
PostgresClusterDataSource defines a data source for bootstrapping PostgreSQL clusters using a an existing PostgresCluster.
func (*PostgresClusterDataSource) DeepCopy ¶
func (in *PostgresClusterDataSource) DeepCopy() *PostgresClusterDataSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresClusterDataSource.
func (*PostgresClusterDataSource) DeepCopyInto ¶
func (in *PostgresClusterDataSource) DeepCopyInto(out *PostgresClusterDataSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresClusterList ¶
type PostgresClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []PostgresCluster `json:"items"`
}
PostgresClusterList contains a list of PostgresCluster
func (*PostgresClusterList) DeepCopy ¶
func (in *PostgresClusterList) DeepCopy() *PostgresClusterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresClusterList.
func (*PostgresClusterList) DeepCopyInto ¶
func (in *PostgresClusterList) DeepCopyInto(out *PostgresClusterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostgresClusterList) DeepCopyObject ¶
func (in *PostgresClusterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PostgresClusterSpec ¶
type PostgresClusterSpec struct {
// +optional
Metadata *v1beta1.Metadata `json:"metadata,omitempty"`
// Specifies a data source for bootstrapping the PostgreSQL cluster.
// +optional
DataSource *DataSource `json:"dataSource,omitempty"`
// Authentication settings for the PostgreSQL server
// +optional
Authentication *v1beta1.PostgresAuthenticationSpec `json:"authentication,omitempty"`
// PostgreSQL backup configuration
// +optional
Backups Backups `json:"backups,omitzero"`
// General configuration of the PostgreSQL server
// +optional
Config *PostgresConfigSpec `json:"config,omitempty"`
// The secret containing the Certificates and Keys to encrypt PostgreSQL
// traffic will need to contain the server TLS certificate, TLS key and the
// Certificate Authority certificate with the data keys set to tls.crt,
// tls.key and ca.crt, respectively. It will then be mounted as a volume
// projection to the '/pgconf/tls' directory. For more information on
// Kubernetes secret projections, please see
// https://k8s.io/docs/concepts/configuration/secret/#projection-of-secret-keys-to-specific-paths
// NOTE: If CustomTLSSecret is provided, CustomReplicationClientTLSSecret
// MUST be provided and the ca.crt provided must be the same.
// +optional
CustomTLSSecret *corev1.SecretProjection `json:"customTLSSecret,omitempty"`
// The secret containing the replication client certificates and keys for
// secure connections to the PostgreSQL server. It will need to contain the
// client TLS certificate, TLS key and the Certificate Authority certificate
// with the data keys set to tls.crt, tls.key and ca.crt, respectively.
// NOTE: If CustomReplicationClientTLSSecret is provided, CustomTLSSecret
// MUST be provided and the ca.crt provided must be the same.
// +optional
CustomReplicationClientTLSSecret *corev1.SecretProjection `json:"customReplicationTLSSecret,omitempty"`
// DatabaseInitSQL defines a ConfigMap containing custom SQL that will
// be run after the cluster is initialized. This ConfigMap must be in the same
// namespace as the cluster.
// +optional
DatabaseInitSQL *DatabaseInitSQL `json:"databaseInitSQL,omitempty"`
// Whether or not the PostgreSQL cluster should use the defined default
// scheduling constraints. If the field is unset or false, the default
// scheduling constraints will be used in addition to any custom constraints
// provided.
// +optional
DisableDefaultPodScheduling *bool `json:"disableDefaultPodScheduling,omitempty"`
// The image name to use for PostgreSQL containers. When omitted, the value
// comes from an operator environment variable. For standard PostgreSQL images,
// the format is RELATED_IMAGE_POSTGRES_{postgresVersion},
// e.g. RELATED_IMAGE_POSTGRES_13. For PostGIS enabled PostgreSQL images,
// the format is RELATED_IMAGE_POSTGRES_{postgresVersion}_GIS_{postGISVersion},
// e.g. RELATED_IMAGE_POSTGRES_13_GIS_3.1.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
Image string `json:"image,omitempty"`
// ImagePullPolicy is used to determine when Kubernetes will attempt to
// pull (download) container images.
// More info: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
// ---
// +kubebuilder:validation:Enum={Always,Never,IfNotPresent}
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
// The image pull secrets used to pull from a private registry
// Changing this value causes all running pods to restart.
// https://k8s.io/docs/tasks/configure-pod-container/pull-image-private-registry/
// +optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// Specifies one or more sets of PostgreSQL pods that replicate data for
// this cluster.
// ---
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=16
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
InstanceSets []PostgresInstanceSetSpec `json:"instances"`
// Configuration for the OpenTelemetry collector container used to collect
// logs and metrics.
// +optional
Instrumentation *v1beta1.InstrumentationSpec `json:"instrumentation,omitempty"`
// Whether or not the PostgreSQL cluster is being deployed to an OpenShift
// environment. If the field is unset, the operator will automatically
// detect the environment.
// +optional
OpenShift *bool `json:"openshift,omitempty"`
// +optional
Patroni *v1beta1.PatroniSpec `json:"patroni,omitempty"`
// Suspends the rollout and reconciliation of changes made to the
// PostgresCluster spec.
// +optional
Paused *bool `json:"paused,omitempty"`
// The port on which PostgreSQL should listen.
// +optional
// +kubebuilder:default=5432
// +kubebuilder:validation:Minimum=1024
Port *int32 `json:"port,omitempty"`
// The major version of PostgreSQL installed in the PostgreSQL image
// +kubebuilder:validation:Required
// +kubebuilder:validation:Minimum=11
// +kubebuilder:validation:Maximum=17
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
PostgresVersion int32 `json:"postgresVersion"`
// The PostGIS extension version installed in the PostgreSQL image.
// When image is not set, indicates a PostGIS enabled image will be used.
// +optional
PostGISVersion string `json:"postGISVersion,omitempty"`
// The specification of a proxy that connects to PostgreSQL.
// +optional
Proxy *PostgresProxySpec `json:"proxy,omitempty"`
// The specification of a user interface that connects to PostgreSQL. -- DEPRECATED
// +optional
// +kubebuilder:validation:XValidation:rule="type(self) == null_type", message="userInterface not available in v1"
UserInterface *UserInterfaceSpec `json:"userInterface,omitempty"`
// The specification of monitoring tools that connect to PostgreSQL
// +optional
Monitoring *MonitoringSpec `json:"monitoring,omitempty"`
// Specification of the service that exposes the PostgreSQL primary instance.
// +optional
Service *v1beta1.ServiceSpec `json:"service,omitempty"`
// Specification of the service that exposes PostgreSQL replica instances
// +optional
ReplicaService *v1beta1.ServiceSpec `json:"replicaService,omitempty"`
// Whether or not the PostgreSQL cluster should be stopped.
// When this is true, workloads are scaled to zero and CronJobs
// are suspended.
// Other resources, such as Services and Volumes, remain in place.
// +optional
Shutdown *bool `json:"shutdown,omitempty"`
// Run this cluster as a read-only copy of an existing cluster or archive.
// +optional
Standby *PostgresStandbySpec `json:"standby,omitempty"`
// A list of group IDs applied to the process of a container. These can be
// useful when accessing shared file systems with constrained permissions.
// More info: https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context
// ---
// +kubebuilder:validation:Optional
//
// Containers should not run with a root GID.
// - https://kubernetes.io/docs/concepts/security/pod-security-standards/
// +kubebuilder:validation:items:Minimum=1
//
// Supplementary GIDs must fit within int32.
// - https://releases.k8s.io/v1.18.0/pkg/apis/core/validation/validation.go#L3659-L3663
// - https://releases.k8s.io/v1.22.0/pkg/apis/core/validation/validation.go#L3923-L3927
// +kubebuilder:validation:items:Maximum=2147483647
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
// Users to create inside PostgreSQL and the databases they should access.
// The default creates one user that can access one database matching the
// PostgresCluster name. An empty list creates no users. Removing a user
// from this list does NOT drop the user nor revoke their access.
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=64
// +optional
Users []v1beta1.PostgresUserSpec `json:"users,omitempty"`
}
PostgresClusterSpec defines the desired state of PostgresCluster ---
Postgres Logging ¶
+kubebuilder:validation:XValidation:fieldPath=`.config.parameters.log_directory`,message=`all instances need "volumes.temp" to log in "/pgtmp"`,rule=`self.?config.parameters.log_directory.optMap(v, type(v) != string || !v.startsWith("/pgtmp/logs/postgres") || self.instances.all(i, i.?volumes.temp.hasValue())).orValue(true)` +kubebuilder:validation:XValidation:fieldPath=`.config.parameters.log_directory`,message=`all instances need "walVolumeClaimSpec" to log in "/pgwal"`,rule=`self.?config.parameters.log_directory.optMap(v, type(v) != string || !v.startsWith("/pgwal/logs/postgres") || self.instances.all(i, i.?walVolumeClaimSpec.hasValue())).orValue(true)` +kubebuilder:validation:XValidation:fieldPath=`.config.parameters.log_directory`,message=`all instances need an additional volume to log in "/volumes"`,rule=`self.?config.parameters.log_directory.optMap(v, type(v) != string || !v.startsWith("/volumes") || self.instances.all(i, i.?volumes.additional.hasValue() && i.volumes.additional.exists(volume, v.startsWith("/volumes/" + volume.name)))).orValue(true)`
pgBackRest Logging ¶
+kubebuilder:validation:XValidation:fieldPath=`.backups.pgbackrest.log.path`,message=`all instances need an additional volume for pgbackrest sidecar to log in "/volumes"`,rule=`self.?backups.pgbackrest.log.path.optMap(v, !v.startsWith("/volumes") || self.instances.all(i, i.?volumes.additional.hasValue() && i.volumes.additional.exists(volume, v.startsWith("/volumes/" + volume.name)))).orValue(true)`
func (*PostgresClusterSpec) DeepCopy ¶
func (in *PostgresClusterSpec) DeepCopy() *PostgresClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresClusterSpec.
func (*PostgresClusterSpec) DeepCopyInto ¶
func (in *PostgresClusterSpec) DeepCopyInto(out *PostgresClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostgresClusterSpec) Default ¶
func (s *PostgresClusterSpec) Default()
Default defines several key default values for a Postgres cluster.
type PostgresClusterStatus ¶
type PostgresClusterStatus struct {
// Identifies the databases that have been installed into PostgreSQL.
DatabaseRevision string `json:"databaseRevision,omitempty"`
// Current state of PostgreSQL instances.
// +listType=map
// +listMapKey=name
// +optional
InstanceSets []PostgresInstanceSetStatus `json:"instances,omitempty"`
// +optional
Patroni v1beta1.PatroniStatus `json:"patroni,omitzero"`
// Status information for pgBackRest
// +optional
PGBackRest *v1beta1.PGBackRestStatus `json:"pgbackrest,omitempty"`
// +optional
RegistrationRequired *RegistrationRequirementStatus `json:"registrationRequired,omitempty"`
// +optional
TokenRequired string `json:"tokenRequired,omitempty"`
// Stores the current PostgreSQL major version following a successful
// major PostgreSQL upgrade.
// +optional
PostgresVersion int32 `json:"postgresVersion"`
// Current state of the PostgreSQL proxy.
// +optional
Proxy PostgresProxyStatus `json:"proxy,omitzero"`
// The instance that should be started first when bootstrapping and/or starting a
// PostgresCluster.
// +optional
StartupInstance string `json:"startupInstance,omitempty"`
// The instance set associated with the startupInstance
// +optional
StartupInstanceSet string `json:"startupInstanceSet,omitempty"`
// Current state of the PostgreSQL user interface.
// +optional
UserInterface *PostgresUserInterfaceStatus `json:"userInterface,omitempty"`
// Identifies the users that have been installed into PostgreSQL.
UsersRevision string `json:"usersRevision,omitempty"`
// Current state of PostgreSQL cluster monitoring tool configuration
// +optional
Monitoring MonitoringStatus `json:"monitoring,omitzero"`
// DatabaseInitSQL state of custom database initialization in the cluster
// +optional
DatabaseInitSQL *string `json:"databaseInitSQL,omitempty"`
// observedGeneration represents the .metadata.generation on which the status was based.
// +optional
// +kubebuilder:validation:Minimum=0
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// conditions represent the observations of postgrescluster's current state.
// Known .status.conditions.type are: "PersistentVolumeResizing",
// "Progressing", "ProxyAvailable"
// +optional
// +listType=map
// +listMapKey=type
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
PostgresClusterStatus defines the observed state of PostgresCluster
func (*PostgresClusterStatus) DeepCopy ¶
func (in *PostgresClusterStatus) DeepCopy() *PostgresClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresClusterStatus.
func (*PostgresClusterStatus) DeepCopyInto ¶
func (in *PostgresClusterStatus) DeepCopyInto(out *PostgresClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresConfigSpec ¶
type PostgresConfigSpec struct {
// Files to mount under "/etc/postgres".
// ---
// +optional
Files []corev1.VolumeProjection `json:"files,omitempty"`
// Configuration parameters for the PostgreSQL server. Some values will
// be reloaded without validation and some cause PostgreSQL to restart.
// Some values cannot be changed at all.
// More info: https://www.postgresql.org/docs/current/runtime-config.html
// ---
//
// Postgres 17 has something like 350+ built-in parameters, but typically
// an administrator will change only a handful of these.
// +kubebuilder:validation:MaxProperties=50
//
// # File Locations
// - https://www.postgresql.org/docs/current/runtime-config-file-locations.html
//
// +kubebuilder:validation:XValidation:rule=`!has(self.config_file) && !has(self.data_directory)`,message=`cannot change PGDATA path: config_file, data_directory`
// +kubebuilder:validation:XValidation:rule=`!has(self.external_pid_file)`,message=`cannot change external_pid_file`
// +kubebuilder:validation:XValidation:rule=`!has(self.hba_file) && !has(self.ident_file)`,message=`cannot change authentication path: hba_file, ident_file`
//
// # Connections
// - https://www.postgresql.org/docs/current/runtime-config-connection.html
//
// +kubebuilder:validation:XValidation:rule=`!has(self.listen_addresses)`,message=`network connectivity is always enabled: listen_addresses`
// +kubebuilder:validation:XValidation:rule=`!has(self.port)`,message=`change port using .spec.port instead`
// +kubebuilder:validation:XValidation:rule=`!has(self.ssl) && !self.exists(k, k.startsWith("ssl_"))`,message=`TLS is always enabled`
// +kubebuilder:validation:XValidation:rule=`!self.exists(k, k.startsWith("unix_socket_"))`,message=`domain socket paths cannot be changed`
//
// # Write Ahead Log
// - https://www.postgresql.org/docs/current/runtime-config-wal.html
//
// +kubebuilder:validation:XValidation:rule=`!has(self.wal_level) || self.wal_level in ["logical"]`,message=`wal_level must be "replica" or higher`
// +kubebuilder:validation:XValidation:rule=`!has(self.wal_log_hints)`,message=`wal_log_hints are always enabled`
// +kubebuilder:validation:XValidation:rule=`!has(self.archive_mode) && !has(self.archive_command) && !has(self.restore_command)`
// +kubebuilder:validation:XValidation:rule=`!has(self.recovery_target) && !self.exists(k, k.startsWith("recovery_target_"))`
//
// # Replication
// - https://www.postgresql.org/docs/current/runtime-config-replication.html
//
// +kubebuilder:validation:XValidation:rule=`!has(self.hot_standby)`,message=`hot_standby is always enabled`
// +kubebuilder:validation:XValidation:rule=`!has(self.synchronous_standby_names)`
// +kubebuilder:validation:XValidation:rule=`!has(self.primary_conninfo) && !has(self.primary_slot_name)`
// +kubebuilder:validation:XValidation:rule=`!has(self.recovery_min_apply_delay)`,message=`delayed replication is not supported at this time`
//
// # Logging
// - https://www.postgresql.org/docs/current/runtime-config-logging.html
//
// +kubebuilder:validation:XValidation:rule=`!has(self.cluster_name)`,message=`cluster_name is derived from the PostgresCluster name`
// +kubebuilder:validation:XValidation:rule=`!has(self.logging_collector)`,message=`disabling logging_collector is unsafe`
// +kubebuilder:validation:XValidation:rule=`!has(self.log_file_mode)`,message=`log_file_mode cannot be changed`
//
// +kubebuilder:validation:XValidation:fieldPath=`.log_directory`,message=`must start with "/pgdata/logs/postgres", "/pgtmp/logs/postgres", "/pgwal/logs/postgres", "/volumes", or be "log" to keep logs inside PGDATA`,rule=`self.?log_directory.optMap(v, type(v) == string && (v == "log" || v.startsWith("/volumes") || ["/pgdata","/pgtmp","/pgwal","/volumes"].exists(p, v == (p + "/logs/postgres") || v.startsWith(p + "/logs/postgres/")))).orValue(true)`
//
// +mapType=granular
// +optional
Parameters map[string]intstr.IntOrString `json:"parameters,omitempty"`
}
func (*PostgresConfigSpec) DeepCopy ¶
func (in *PostgresConfigSpec) DeepCopy() *PostgresConfigSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConfigSpec.
func (*PostgresConfigSpec) DeepCopyInto ¶
func (in *PostgresConfigSpec) DeepCopyInto(out *PostgresConfigSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresInstanceSetSpec ¶
type PostgresInstanceSetSpec struct {
// +optional
Metadata *v1beta1.Metadata `json:"metadata,omitempty"`
// Name that associates this set of PostgreSQL pods. This field is optional
// when only one instance set is defined. Each instance set in a cluster
// must have a unique name. The combined length of this and the cluster name
// must be 46 characters or less.
// +optional
// +kubebuilder:default=""
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$`
Name string `json:"name"`
// Scheduling constraints of a PostgreSQL pod. Changing this value causes
// PostgreSQL to restart.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node
// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// Custom sidecars for PostgreSQL instance pods. Changing this value causes
// PostgreSQL to restart.
// +optional
Containers []corev1.Container `json:"containers,omitempty"`
// Defines a PersistentVolumeClaim for PostgreSQL data.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes
// ---
// +required
DataVolumeClaimSpec v1beta1.VolumeClaimSpecWithAutoGrow `json:"dataVolumeClaimSpec"`
// Priority class name for the PostgreSQL pod. Changing this value causes
// PostgreSQL to restart.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
// +optional
PriorityClassName *string `json:"priorityClassName,omitempty"`
// Number of desired PostgreSQL pods.
// +optional
// +kubebuilder:default=1
// +kubebuilder:validation:Minimum=1
Replicas *int32 `json:"replicas,omitempty"`
// Minimum number of pods that should be available at a time.
// Defaults to one when the replicas field is greater than one.
// +optional
MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`
// Compute resources of a PostgreSQL container.
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitzero"`
// Configuration for instance sidecar containers
// +optional
Sidecars *InstanceSidecars `json:"sidecars,omitempty"`
// Tolerations of a PostgreSQL pod. Changing this value causes PostgreSQL to restart.
// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Topology spread constraints of a PostgreSQL pod. Changing this value causes
// PostgreSQL to restart.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
// +optional
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// Defines a separate PersistentVolumeClaim for PostgreSQL's write-ahead log.
// More info: https://www.postgresql.org/docs/current/wal.html
// ---
// +optional
WALVolumeClaimSpec *v1beta1.VolumeClaimSpecWithAutoGrow `json:"walVolumeClaimSpec,omitempty"`
// The list of tablespaces volumes to mount for this postgrescluster
// This field requires enabling TablespaceVolumes feature gate
// +listType=map
// +listMapKey=name
// +optional
TablespaceVolumes []TablespaceVolume `json:"tablespaceVolumes,omitempty"`
// Volumes to be added to the instance set.
// +optional
Volumes *v1beta1.PostgresVolumesSpec `json:"volumes,omitempty"`
}
func (*PostgresInstanceSetSpec) DeepCopy ¶
func (in *PostgresInstanceSetSpec) DeepCopy() *PostgresInstanceSetSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresInstanceSetSpec.
func (*PostgresInstanceSetSpec) DeepCopyInto ¶
func (in *PostgresInstanceSetSpec) DeepCopyInto(out *PostgresInstanceSetSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostgresInstanceSetSpec) Default ¶
func (s *PostgresInstanceSetSpec) Default(i int)
Default sets the default values for an instance set spec, including the name suffix and number of replicas.
type PostgresInstanceSetStatus ¶
type PostgresInstanceSetStatus struct {
Name string `json:"name"`
// Total number of ready pods.
// +optional
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
// Total number of pods.
// +optional
Replicas int32 `json:"replicas,omitempty"`
// Total number of pods that have the desired specification.
// +optional
UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
// Desired Size of the pgData volume
// +optional
DesiredPGDataVolume map[string]string `json:"desiredPGDataVolume,omitempty"`
// Desired Size of the pgWAL volume
// +optional
DesiredPGWALVolume map[string]string `json:"desiredPGWALVolume,omitempty"`
}
func (*PostgresInstanceSetStatus) DeepCopy ¶
func (in *PostgresInstanceSetStatus) DeepCopy() *PostgresInstanceSetStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresInstanceSetStatus.
func (*PostgresInstanceSetStatus) DeepCopyInto ¶
func (in *PostgresInstanceSetStatus) DeepCopyInto(out *PostgresInstanceSetStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresProxySpec ¶
type PostgresProxySpec struct {
// Defines a PgBouncer proxy and connection pooler.
PGBouncer *PGBouncerPodSpec `json:"pgBouncer"`
}
PostgresProxySpec is a union of the supported PostgreSQL proxies.
func (*PostgresProxySpec) DeepCopy ¶
func (in *PostgresProxySpec) DeepCopy() *PostgresProxySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresProxySpec.
func (*PostgresProxySpec) DeepCopyInto ¶
func (in *PostgresProxySpec) DeepCopyInto(out *PostgresProxySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostgresProxySpec) Default ¶
func (s *PostgresProxySpec) Default()
Default sets the defaults for any proxies that are set.
type PostgresProxyStatus ¶
type PostgresProxyStatus struct {
// +optional
PGBouncer v1beta1.PGBouncerPodStatus `json:"pgBouncer,omitzero"`
}
func (*PostgresProxyStatus) DeepCopy ¶
func (in *PostgresProxyStatus) DeepCopy() *PostgresProxyStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresProxyStatus.
func (*PostgresProxyStatus) DeepCopyInto ¶
func (in *PostgresProxyStatus) DeepCopyInto(out *PostgresProxyStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresStandbySpec ¶
type PostgresStandbySpec struct {
// Whether or not the PostgreSQL cluster should be read-only. When this is
// true, WAL files are applied from a pgBackRest repository or another
// PostgreSQL server.
// +optional
// +kubebuilder:default=true
Enabled bool `json:"enabled"`
// The name of the pgBackRest repository to follow for WAL files.
// +optional
// +kubebuilder:validation:Pattern=^repo[1-4]
RepoName string `json:"repoName,omitempty"`
// Network address of the PostgreSQL server to follow via streaming replication.
// +optional
Host string `json:"host,omitempty"`
// Network port of the PostgreSQL server to follow via streaming replication.
// +optional
// +kubebuilder:validation:Minimum=1024
Port *int32 `json:"port,omitempty"`
}
PostgresStandbySpec defines if/how the cluster should be a hot standby.
func (*PostgresStandbySpec) DeepCopy ¶
func (in *PostgresStandbySpec) DeepCopy() *PostgresStandbySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresStandbySpec.
func (*PostgresStandbySpec) DeepCopyInto ¶
func (in *PostgresStandbySpec) DeepCopyInto(out *PostgresStandbySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresUserInterfaceStatus ¶
type PostgresUserInterfaceStatus struct {
// The state of the pgAdmin user interface.
// +optional
PGAdmin v1beta1.PGAdminPodStatus `json:"pgAdmin,omitzero"`
}
PostgresUserInterfaceStatus is a union of the supported PostgreSQL user interface statuses.
func (*PostgresUserInterfaceStatus) DeepCopy ¶
func (in *PostgresUserInterfaceStatus) DeepCopy() *PostgresUserInterfaceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresUserInterfaceStatus.
func (*PostgresUserInterfaceStatus) DeepCopyInto ¶
func (in *PostgresUserInterfaceStatus) DeepCopyInto(out *PostgresUserInterfaceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RegistrationRequirementStatus ¶
type RegistrationRequirementStatus struct {
PGOVersion string `json:"pgoVersion,omitempty"`
}
func (*RegistrationRequirementStatus) DeepCopy ¶
func (in *RegistrationRequirementStatus) DeepCopy() *RegistrationRequirementStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrationRequirementStatus.
func (*RegistrationRequirementStatus) DeepCopyInto ¶
func (in *RegistrationRequirementStatus) DeepCopyInto(out *RegistrationRequirementStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TablespaceVolume ¶
type TablespaceVolume struct {
// The name for the tablespace, used as the path name for the volume.
// Must be unique in the instance set since they become the directory names.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[a-z][a-z0-9]*$`
// +kubebuilder:validation:Type=string
Name string `json:"name"`
// Defines a PersistentVolumeClaim for a tablespace.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes
// ---
// +required
DataVolumeClaimSpec v1beta1.VolumeClaimSpec `json:"dataVolumeClaimSpec"`
}
func (*TablespaceVolume) DeepCopy ¶
func (in *TablespaceVolume) DeepCopy() *TablespaceVolume
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TablespaceVolume.
func (*TablespaceVolume) DeepCopyInto ¶
func (in *TablespaceVolume) DeepCopyInto(out *TablespaceVolume)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UserInterfaceSpec ¶
type UserInterfaceSpec struct {
// Defines a pgAdmin user interface.
PGAdmin *v1beta1.PGAdminPodSpec `json:"pgAdmin"`
}
UserInterfaceSpec is a union of the supported PostgreSQL user interfaces.
func (*UserInterfaceSpec) DeepCopy ¶
func (in *UserInterfaceSpec) DeepCopy() *UserInterfaceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserInterfaceSpec.
func (*UserInterfaceSpec) DeepCopyInto ¶
func (in *UserInterfaceSpec) DeepCopyInto(out *UserInterfaceSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*UserInterfaceSpec) Default ¶
func (s *UserInterfaceSpec) Default()
Default sets the defaults for any user interfaces that are set.
type VolumeSnapshots ¶
type VolumeSnapshots struct {
// Name of the VolumeSnapshotClass that should be used by VolumeSnapshots
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
VolumeSnapshotClassName string `json:"volumeSnapshotClassName"`
}
VolumeSnapshots defines the configuration for VolumeSnapshots
func (*VolumeSnapshots) DeepCopy ¶
func (in *VolumeSnapshots) DeepCopy() *VolumeSnapshots
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshots.
func (*VolumeSnapshots) DeepCopyInto ¶
func (in *VolumeSnapshots) DeepCopyInto(out *VolumeSnapshots)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.