naming

package
v5.1.2-bit Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package naming provides functions and constants for the postgres-operator naming and labeling scheme.

Index

Constants

View Source
const (

	// Finalizer marks an object to be garbage collected by this module.
	Finalizer = annotationPrefix + "finalizer"

	// PatroniSwitchover is the annotation added to a PostgresCluster to initiate a manual
	// Patroni Switchover (or Failover).
	PatroniSwitchover = annotationPrefix + "trigger-switchover"

	// PGBackRestBackup is the annotation that is added to a PostgresCluster to initiate a manual
	// backup.  The value of the annotation will be a unique identifier for a backup Job (e.g. a
	// timestamp), which will be stored in the PostgresCluster status to properly track completion
	// of the Job.  Also used to annotate the backup Job itself as needed to identify the backup
	// ID associated with a specific manual backup Job.
	PGBackRestBackup = annotationPrefix + "pgbackrest-backup"

	// PGBackRestConfigHash is an annotation used to specify the hash value associated with a
	// repo configuration as needed to detect configuration changes that invalidate running Jobs
	// (and therefore must be recreated)
	PGBackRestConfigHash = annotationPrefix + "pgbackrest-hash"

	// PGBackRestCurrentConfig is an annotation used to indicate the name of the pgBackRest
	// configuration associated with a specific Job as determined by either the current primary
	// (if no dedicated repository host is enabled), or the dedicated repository host.  This helps
	// in detecting pgBackRest backup Jobs that no longer mount the proper pgBackRest
	// configuration, e.g. because a failover has occurred, or because dedicated repo host has been
	// enabled or disabled.
	PGBackRestCurrentConfig = annotationPrefix + "pgbackrest-config"

	// PGBackRestRestore is the annotation that is added to a PostgresCluster to initiate an in-place
	// restore.  The value of the annotation will be a unique identfier for a restore Job (e.g. a
	// timestamp), which will be stored in the PostgresCluster status to properly track completion
	// of the Job.
	PGBackRestRestore = annotationPrefix + "pgbackrest-restore"
)
View Source
const (

	// LabelCluster et al. provides the fundamental labels for Postgres instances
	LabelCluster     = labelPrefix + "cluster"
	LabelInstance    = labelPrefix + "instance"
	LabelInstanceSet = labelPrefix + "instance-set"

	// LabelRepoName is used to specify the name of a pgBackRest repository
	LabelRepoName = labelPrefix + "name"

	LabelPatroni = labelPrefix + "patroni"
	LabelRole    = labelPrefix + "role"

	// LabelClusterCertificate is used to identify a secret containing a cluster certificate
	LabelClusterCertificate = labelPrefix + "cluster-certificate"

	// LabelData is used to identify Pods and Volumes store Postgres data.
	LabelData = labelPrefix + "data"

	// LabelMoveJob is used to identify a directory move Job.
	LabelMoveJob = labelPrefix + "move-job"

	// LabelMovePGBackRestRepoDir is used to identify the Job that moves an existing pgBackRest repo directory.
	LabelMovePGBackRestRepoDir = labelPrefix + "move-pgbackrest-repo-dir"

	// LabelMovePGDataDir is used to identify the Job that moves an existing pgData directory.
	LabelMovePGDataDir = labelPrefix + "move-pgdata-dir"

	// LabelMovePGWalDir is used to identify the Job that moves an existing pg_wal directory.
	LabelMovePGWalDir = labelPrefix + "move-pgwal-dir"

	// LabelPGBackRest is used to indicate that a resource is for pgBackRest
	LabelPGBackRest = labelPrefix + "pgbackrest"

	// LabelPGBackRestBackup is used to indicate that a resource is for a pgBackRest backup
	LabelPGBackRestBackup = labelPrefix + "pgbackrest-backup"

	// LabelPGBackRestConfig is used to indicate that a ConfigMap or Secret is for pgBackRest
	LabelPGBackRestConfig = labelPrefix + "pgbackrest-config"

	// LabelPGBackRestDedicated is used to indicate that a ConfigMap is for a pgBackRest dedicated
	// repository host
	LabelPGBackRestDedicated = labelPrefix + "pgbackrest-dedicated"

	// LabelPGBackRestRepo is used to indicate that a Deployment or Pod is for a pgBackRest
	// repository
	LabelPGBackRestRepo = labelPrefix + "pgbackrest-repo"

	// LabelPGBackRestRepoVolume is used to indicate that a resource for a pgBackRest
	// repository
	LabelPGBackRestRepoVolume = labelPrefix + "pgbackrest-volume"

	LabelPGBackRestCronJob = labelPrefix + "pgbackrest-cronjob"

	// LabelPGBackRestRestore is used to indicate that a Job or Pod is for a pgBackRest restore
	LabelPGBackRestRestore = labelPrefix + "pgbackrest-restore"

	// LabelPGBackRestRestoreConfig is used to indicate that a configuration
	// resource (e.g. a ConfigMap or Secret) is for a pgBackRest restore
	LabelPGBackRestRestoreConfig = labelPrefix + "pgbackrest-restore-config"

	// LabelPGMonitorDiscovery is the label added to Pods running the "exporter" container to
	// support discovery by Prometheus according to pgMonitor configuration
	LabelPGMonitorDiscovery = labelPrefix + "crunchy-postgres-exporter"

	// LabelPostgresUser identifies the PostgreSQL user an object is for or about.
	LabelPostgresUser = labelPrefix + "pguser"

	// LabelStartupInstance is used to indicate the startup instance associated with a resource
	LabelStartupInstance = labelPrefix + "startup-instance"

	RolePrimary = "primary"
	RoleReplica = "replica"

	// RolePatroniLeader is the LabelRole that Patroni sets on the Pod that is
	// currently the leader.
	RolePatroniLeader = "master"

	// RolePatroniReplica is a LabelRole value that Patroni sets on Pods that are
	// following the leader.
	RolePatroniReplica = "replica"

	// RolePGBouncer is the LabelRole applied to PgBouncer objects.
	RolePGBouncer = "pgbouncer"

	// RolePGAdmin is the LabelRole applied to pgAdmin objects.
	RolePGAdmin = "pgadmin"

	// RolePostgresData is the LabelRole applied to PostgreSQL data volumes.
	RolePostgresData = "pgdata"

	// RolePostgresUser is the LabelRole applied to PostgreSQL user secrets.
	RolePostgresUser = "pguser"

	// RolePostgresWAL is the LabelRole applied to PostgreSQL WAL volumes.
	RolePostgresWAL = "pgwal"

	// RoleMonitoring is the LabelRole applied to Monitoring resources
	RoleMonitoring = "monitoring"
)
View Source
const (
	// DataPGAdmin is a LabelData value that indicates the object has pgAdmin data.
	DataPGAdmin = "pgadmin"

	// DataPGBackRest is a LabelData value that indicates the object has pgBackRest data.
	DataPGBackRest = "pgbackrest"

	// DataPostgres is a LabelData value that indicates the object has PostgreSQL data.
	DataPostgres = "postgres"
)
View Source
const (
	// ContainerDatabase is the name of the container running PostgreSQL and
	// supporting tools: Patroni, pgBackRest, etc.
	ContainerDatabase = "database"

	// ContainerPGAdmin is the name of a container running pgAdmin.
	ContainerPGAdmin = "pgadmin"

	// ContainerPGAdminStartup is the name of the initialization container
	// that prepares the filesystem for pgAdmin.
	ContainerPGAdminStartup = "pgadmin-startup"

	// ContainerPGBackRestConfig is the name of a container supporting pgBackRest.
	ContainerPGBackRestConfig = "pgbackrest-config"

	// ContainerPGBouncer is the name of a container running PgBouncer.
	ContainerPGBouncer = "pgbouncer"
	// ContainerPGBouncerConfig is the name of a container supporting PgBouncer.
	ContainerPGBouncerConfig = "pgbouncer-config"

	// ContainerPostgresStartup is the name of the initialization container
	// that prepares the filesystem for PostgreSQL.
	ContainerPostgresStartup = "postgres-startup"

	// ContainerClientCertCopy is the name of the container that is responsible for copying and
	// setting proper permissions on the client certificate and key after initialization whenever
	// there is a change in the certificates or key
	ContainerClientCertCopy = "replication-cert-copy"
	// ContainerNSSWrapperInit is the name of the init container utilized to configure support
	// for the nss_wrapper
	ContainerNSSWrapperInit = "nss-wrapper-init"

	// ContainerPGBackRestLogDirInit is the name of the init container utilized to make
	// a pgBackRest log directory when using a dedicated repo host.
	ContainerPGBackRestLogDirInit = "pgbackrest-log-dir"

	// ContainerPGMonitorExporter is the name of a container running postgres_exporter
	ContainerPGMonitorExporter = "exporter"

	// ContainerJobMovePGDataDir is the name of the job container utilized to copy v4 Operator
	// pgData directories to the v5 default location
	ContainerJobMovePGDataDir = "pgdata-move-job"
	// ContainerJobMovePGWALDir is the name of the job container utilized to copy v4 Operator
	// pg_wal directories to the v5 default location
	ContainerJobMovePGWALDir = "pgwal-move-job"
	// ContainerJobMovePGBackRestRepoDir is the name of the job container utilized to copy v4
	// Operator pgBackRest repo directories to the v5 default location
	ContainerJobMovePGBackRestRepoDir = "repo-move-job"
)
View Source
const (
	// PortExporter is the named port for the "exporter" container
	PortExporter = "exporter"
	// PortPGAdmin is the name of a port that connects to pgAdmin.
	PortPGAdmin = "pgadmin"
	// PortPGBouncer is the name of a port that connects to PgBouncer.
	PortPGBouncer = "pgbouncer"
	// PortPostgreSQL is the name of a port that connects to PostgreSQL.
	PortPostgreSQL = "postgres"
)
View Source
const (
	// RootCertSecret is the default root certificate secret name
	RootCertSecret = "pgo-root-cacert" /* #nosec */
	// ClusterCertSecret is the default cluster leaf certificate secret name
	ClusterCertSecret = "%s-cluster-cert" /* #nosec */
)
View Source
const (
	// CertVolume is the name of the Certificate volume and volume mount in a
	// PostgreSQL instance Pod
	CertVolume = "cert-volume"

	// CertMountPath is the path for mounting the postgrescluster certificates
	// and key
	CertMountPath = "/pgconf/tls"

	// ReplicationDirectory is the directory at CertMountPath where the replication
	// certificates and key are mounted
	ReplicationDirectory = "/replication"

	// ReplicationTmp is the directory where the replication certificates and key can
	// have the proper permissions set due to:
	// https://github.com/kubernetes/kubernetes/issues/57923
	ReplicationTmp = "/tmp/replication"

	// ReplicationCert is the secret key to the postgrescluster's
	// replication/rewind user's client certificate
	ReplicationCert = "tls.crt"

	// ReplicationCertPath is the path to the postgrescluster's replication/rewind
	// user's client certificate
	ReplicationCertPath = "replication/tls.crt"

	// ReplicationPrivateKey is the secret key to the postgrescluster's
	// replication/rewind user's client private key
	ReplicationPrivateKey = "tls.key"

	// ReplicationPrivateKeyPath is the path to the postgrescluster's
	// replication/rewind user's client private key
	ReplicationPrivateKeyPath = "replication/tls.key"

	// ReplicationCACert is the key name of the postgrescluster's replication/rewind
	// user's client CA certificate
	// Note: when using auto-generated certificates, this will be identical to the
	// server CA cert
	ReplicationCACert = "ca.crt"

	// ReplicationCACertPath is the path to the postgrescluster's replication/rewind
	// user's client CA certificate
	ReplicationCACertPath = "replication/ca.crt"
)
View Source
const (
	// PGBackRestRepoContainerName is the name assigned to the container used to run pgBackRest
	PGBackRestRepoContainerName = "pgbackrest"

	// PGBackRestRestoreContainerName is the name assigned to the container used to run pgBackRest
	// restores
	PGBackRestRestoreContainerName = "pgbackrest-restore"

	// PGBackRestRepoName is the name used for a pgbackrest repository
	PGBackRestRepoName = "%s-pgbackrest-repo-%s"

	// PGBackRestPGDataLogPath is the pgBackRest default log path configuration used by the
	// PostgreSQL instance.
	PGBackRestPGDataLogPath = "/pgdata/pgbackrest/log"

	// PGBackRestRepoLogPath is the pgBackRest default log path configuration used by the
	// dedicated repo host, if configured.
	PGBackRestRepoLogPath = "/pgbackrest/%s/log"

	// RestoreConfigCopySuffix is the suffix used for ConfigMap or Secret configuration
	// resources needed when restoring from a PostgresCluster data source. If, for
	// example, a Secret is named 'mysecret' and is the first item in the configuration
	// slice, the copied Secret will be named 'mysecret-restorecopy-0'
	RestoreConfigCopySuffix = "%s-restorecopy-%d"
)

Variables

This section is empty.

Functions

func AnyCluster

func AnyCluster() metav1.LabelSelector

AnyCluster selects things for any PostgreSQL cluster.

func AsObjectKey

func AsObjectKey(m metav1.ObjectMeta) client.ObjectKey

AsObjectKey converts the ObjectMeta API type to a client.ObjectKey. When you have a client.Object, use client.ObjectKeyFromObject() instead.

func AsSelector

func AsSelector(s metav1.LabelSelector) (labels.Selector, error)

AsSelector is a wrapper around metav1.LabelSelectorAsSelector() which converts the LabelSelector API type into something that implements labels.Selector.

func Cluster

func Cluster(cluster string) metav1.LabelSelector

Cluster selects things for cluster.

func ClusterConfigMap

func ClusterConfigMap(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterConfigMap returns the ObjectMeta necessary to lookup cluster's shared ConfigMap.

func ClusterDataForPostgresAndPGBackRest

func ClusterDataForPostgresAndPGBackRest(cluster string) metav1.LabelSelector

ClusterDataForPostgresAndPGBackRest selects things for PostgreSQL data and things for pgBackRest data.

func ClusterInstance

func ClusterInstance(cluster, instance string) metav1.LabelSelector

ClusterInstance selects things for a single instance in a cluster.

func ClusterInstanceRBAC

func ClusterInstanceRBAC(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterInstanceRBAC returns the ObjectMeta necessary to lookup the ServiceAccount, Role, and RoleBinding for cluster's PostgreSQL instances.

func ClusterInstanceSet

func ClusterInstanceSet(cluster, set string) metav1.LabelSelector

ClusterInstanceSet selects things for set in cluster.

func ClusterInstanceSets

func ClusterInstanceSets(cluster string) metav1.LabelSelector

ClusterInstanceSets selects things for sets in a cluster.

func ClusterInstances

func ClusterInstances(cluster string) metav1.LabelSelector

ClusterInstances selects things for PostgreSQL instances in cluster.

func ClusterPGAdmin

func ClusterPGAdmin(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterPGAdmin returns the ObjectMeta necessary to lookup the ConfigMap, Service, StatefulSet, or Volume for the cluster's pgAdmin user interface.

func ClusterPGBouncer

func ClusterPGBouncer(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterPGBouncer returns the ObjectMeta necessary to lookup the ConfigMap, Deployment, Secret, PodDisruptionBudget or Service that is cluster's PgBouncer proxy.

func ClusterPGBouncerSelector

func ClusterPGBouncerSelector(cluster *v1beta1.PostgresCluster) metav1.LabelSelector

ClusterPGBouncerSelector selects things labeled for PGBouncer in cluster.

func ClusterPatronis

func ClusterPatronis(cluster *v1beta1.PostgresCluster) metav1.LabelSelector

ClusterPatronis selects things labeled for Patroni in cluster.

func ClusterPodService

func ClusterPodService(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterPodService returns the ObjectMeta necessary to lookup the Service that is responsible for the network identity of Pods.

func ClusterPostgresUsers

func ClusterPostgresUsers(cluster string) metav1.LabelSelector

ClusterPostgresUsers selects things labeled for PostgreSQL users in cluster.

func ClusterPrimary

func ClusterPrimary(cluster string) metav1.LabelSelector

ClusterPrimary selects things for the Primary PostgreSQL instance.

func ClusterPrimaryService

func ClusterPrimaryService(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterPrimaryService returns the ObjectMeta necessary to lookup the Service that exposes the PostgreSQL primary instance.

func ClusterReplicaService

func ClusterReplicaService(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ClusterReplicaService returns the ObjectMeta necessary to lookup the Service that exposes PostgreSQL replica instances.

func DeprecatedPostgresUserSecret

func DeprecatedPostgresUserSecret(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

DeprecatedPostgresUserSecret returns the ObjectMeta necessary to lookup the old Secret containing the default Postgres user and connection information. Use PostgresUserSecret instead.

func DirectoryMoveJobLabels

func DirectoryMoveJobLabels(clusterName string) labels.Set

DirectoryMoveJobLabels provides labels for PVC move Jobs.

func GenerateInstance

func GenerateInstance(
	cluster *v1beta1.PostgresCluster, set *v1beta1.PostgresInstanceSetSpec,
) metav1.ObjectMeta

GenerateInstance returns a random name for a member of cluster and set.

func GenerateStartupInstance

func GenerateStartupInstance(
	cluster *v1beta1.PostgresCluster, set *v1beta1.PostgresInstanceSetSpec,
) metav1.ObjectMeta

GenerateStartupInstance returns a stable name that's shaped like GenerateInstance above. The stable name is based on a four character hash of the cluster name and instance set name

func InstanceCertificates

func InstanceCertificates(instance metav1.Object) metav1.ObjectMeta

InstanceCertificates returns the ObjectMeta necessary to lookup the Secret containing instance's certificates.

func InstanceConfigMap

func InstanceConfigMap(instance metav1.Object) metav1.ObjectMeta

InstanceConfigMap returns the ObjectMeta necessary to lookup instance's shared ConfigMap.

func InstancePodDNSNames

func InstancePodDNSNames(ctx context.Context, instance *appsv1.StatefulSet) []string

InstancePodDNSNames returns the possible DNS names for instance. The first name is the fully qualified domain name (FQDN).

func InstancePostgresDataVolume

func InstancePostgresDataVolume(instance *appsv1.StatefulSet) metav1.ObjectMeta

InstancePostgresDataVolume returns the ObjectMeta for the PostgreSQL data volume for instance.

func InstancePostgresWALVolume

func InstancePostgresWALVolume(instance *appsv1.StatefulSet) metav1.ObjectMeta

InstancePostgresWALVolume returns the ObjectMeta for the PostgreSQL WAL volume for instance.

func InstanceSet

InstanceSet returns the ObjectMeta necessary to lookup the objects associated with a single instance set. Includes PodDisruptionBudgets

func KubernetesClusterDomain

func KubernetesClusterDomain(ctx context.Context) string

KubernetesClusterDomain looks up the Kubernetes cluster domain name.

func Merge

func Merge(sets ...map[string]string) labels.Set

Merge takes sets of labels and merges them. The last set provided will win in case of conflicts.

func MonitoringUserSecret

func MonitoringUserSecret(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

MonitoringUserSecret returns ObjectMeta necessary to lookup the Secret containing authentication credentials for monitoring tools.

func MovePGBackRestRepoDirJob

func MovePGBackRestRepoDirJob(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

MovePGBackRestRepoDirJob returns the ObjectMeta for a pgBackRest repo directory move Job

func MovePGDataDirJob

func MovePGDataDirJob(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

MovePGDataDirJob returns the ObjectMeta for a pgData directory move Job

func MovePGWALDirJob

func MovePGWALDirJob(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

MovePGWALDirJob returns the ObjectMeta for a pg_wal directory move Job

func PGBackRestBackupJob

func PGBackRestBackupJob(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestBackupJob returns the ObjectMeta for the pgBackRest backup Job utilized to create replicas using pgBackRest

func PGBackRestBackupJobLabels

func PGBackRestBackupJobLabels(clusterName, repoName string,
	backupType BackupJobType) labels.Set

PGBackRestBackupJobLabels provides labels for pgBackRest backup Jobs.

func PGBackRestBackupJobSelector

func PGBackRestBackupJobSelector(clusterName, repoName string,
	backupType BackupJobType) labels.Selector

PGBackRestBackupJobSelector provides a selector for querying all pgBackRest resources

func PGBackRestConfig

func PGBackRestConfig(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestConfig returns the ObjectMeta for a pgBackRest ConfigMap

func PGBackRestConfigLabels

func PGBackRestConfigLabels(clusterName string) labels.Set

PGBackRestConfigLabels provides labels for the pgBackRest configuration created and used by the PostgreSQL Operator

func PGBackRestCronJob

func PGBackRestCronJob(cluster *v1beta1.PostgresCluster, backuptype, repoName string) metav1.ObjectMeta

PGBackRestCronJob returns the ObjectMeta for a pgBackRest CronJob

func PGBackRestCronJobLabels

func PGBackRestCronJobLabels(clusterName, repoName, backupType string) labels.Set

PGBackRestCronJobLabels provides common labels for pgBackRest CronJobs

func PGBackRestDedicatedLabels

func PGBackRestDedicatedLabels(clusterName string) labels.Set

PGBackRestDedicatedLabels provides labels for a pgBackRest dedicated repository host

func PGBackRestDedicatedSelector

func PGBackRestDedicatedSelector(clusterName string) labels.Selector

PGBackRestDedicatedSelector provides a selector for querying pgBackRest dedicated repository host resources

func PGBackRestLabels

func PGBackRestLabels(clusterName string) labels.Set

PGBackRestLabels provides common labels for pgBackRest resources.

func PGBackRestRBAC

func PGBackRestRBAC(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestRBAC returns the ObjectMeta necessary to lookup the ServiceAccount, Role, and RoleBinding for pgBackRest Jobs

func PGBackRestRepoLabels

func PGBackRestRepoLabels(clusterName, repoName string) labels.Set

PGBackRestRepoLabels provides common labels for pgBackRest repository resources.

func PGBackRestRepoVolume

func PGBackRestRepoVolume(cluster *v1beta1.PostgresCluster,
	repoName string) metav1.ObjectMeta

PGBackRestRepoVolume returns the ObjectMeta for a pgBackRest repository volume

func PGBackRestRepoVolumeLabels

func PGBackRestRepoVolumeLabels(clusterName, repoName string) labels.Set

PGBackRestRepoVolumeLabels the labels for a pgBackRest repository volume.

func PGBackRestRestoreConfigLabels deprecated

func PGBackRestRestoreConfigLabels(clusterName string) labels.Set

PGBackRestRestoreConfigLabels provides labels for configuration (e.g. ConfigMaps and Secrets) generated to perform a pgBackRest restore.

Deprecated: Store restore data in the pgBackRest ConfigMap and Secret, PGBackRestConfig and PGBackRestSecret.

func PGBackRestRestoreConfigSelector

func PGBackRestRestoreConfigSelector(clusterName string) labels.Selector

PGBackRestRestoreConfigSelector provides selector for querying pgBackRest restore config resources.

func PGBackRestRestoreJob

func PGBackRestRestoreJob(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestRestoreJob returns the ObjectMeta for a pgBackRest restore Job

func PGBackRestRestoreJobLabels

func PGBackRestRestoreJobLabels(clusterName string) labels.Set

PGBackRestRestoreJobLabels provides labels for pgBackRest restore Jobs and associated configuration ConfigMaps and Secrets.

func PGBackRestRestoreJobSelector

func PGBackRestRestoreJobSelector(clusterName string) labels.Selector

PGBackRestRestoreJobSelector provides selector for querying pgBackRest restore Jobs.

func PGBackRestSSHConfig

func PGBackRestSSHConfig(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestSSHConfig returns the ObjectMeta for a pgBackRest SSHD ConfigMap Deprecated: Repository hosts use mTLS for encryption, authentication, and authorization. TODO(tjmoore4): Once we no longer need this for cleanup purposes, this should be removed.

func PGBackRestSSHSecret

func PGBackRestSSHSecret(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestSSHSecret returns the ObjectMeta for a pgBackRest SSHD Secret Deprecated: Repository hosts use mTLS for encryption, authentication, and authorization. TODO(tjmoore4): Once we no longer need this for cleanup purposes, this should be removed.

func PGBackRestSecret

func PGBackRestSecret(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PGBackRestSecret returns the ObjectMeta for a pgBackRest Secret

func PGBackRestSelector

func PGBackRestSelector(clusterName string) labels.Selector

PGBackRestSelector provides a selector for querying all pgBackRest resources

func PatroniDistributedConfiguration

func PatroniDistributedConfiguration(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PatroniDistributedConfiguration returns the ObjectMeta necessary to lookup the DCS created by Patroni for cluster. This same name is used for both ConfigMap and Endpoints. See Patroni DCS "config_path".

func PatroniLeaderConfigMap

func PatroniLeaderConfigMap(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PatroniLeaderConfigMap returns the ObjectMeta necessary to lookup the ConfigMap created by Patroni for the leader election of cluster. See Patroni DCS "leader_path".

func PatroniLeaderEndpoints

func PatroniLeaderEndpoints(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PatroniLeaderEndpoints returns the ObjectMeta necessary to lookup the Endpoints created by Patroni for the leader election of cluster. See Patroni DCS "leader_path".

func PatroniScope

func PatroniScope(cluster *v1beta1.PostgresCluster) string

PatroniScope returns the "scope" Patroni uses for cluster.

func PatroniTrigger

func PatroniTrigger(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PatroniTrigger returns the ObjectMeta necessary to lookup the ConfigMap or Endpoints Patroni creates for cluster to initiate a controlled change of the leader. See Patroni DCS "failover_path".

func PostgresTLSSecret

func PostgresTLSSecret(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

PostgresTLSSecret returns the ObjectMeta necessary to lookup the Secret containing the default Postgres TLS certificates and key

func PostgresUserSecret

func PostgresUserSecret(cluster *v1beta1.PostgresCluster, username string) metav1.ObjectMeta

PostgresUserSecret returns the ObjectMeta necessary to lookup a Secret containing a PostgreSQL user and its connection information.

func ReplicationClientCertSecret

func ReplicationClientCertSecret(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta

ReplicationClientCertSecret returns ObjectMeta necessary to lookup the Secret containing the Patroni client authentication certificate information.

func RepoHostPodDNSNames

func RepoHostPodDNSNames(ctx context.Context, repoHost *appsv1.StatefulSet) []string

RepoHostPodDNSNames returns the possible DNS names for a pgBackRest repository host Pod. The first name is the fully qualified domain name (FQDN).

func ServiceDNSNames

func ServiceDNSNames(ctx context.Context, service *corev1.Service) []string

ServiceDNSNames returns the possible DNS names for service. The first name is the fully qualified domain name (FQDN).

func UpgradeCheckConfigMap

func UpgradeCheckConfigMap() metav1.ObjectMeta

UpgradeCheckConfigMap returns the ObjectMeta for the PGO ConfigMap

Types

type BackupJobType

type BackupJobType string

BackupJobType represents different types of backups (e.g. ad-hoc backups, scheduled backups, the backup for pgBackRest replica creation, etc.)

const (
	// BackupManual is the backup type utilized for manual backups
	BackupManual BackupJobType = "manual"

	// BackupReplicaCreate is the backup type for the backup taken to enable pgBackRest replica
	// creation
	BackupReplicaCreate BackupJobType = "replica-create"
)

Jump to

Keyboard shortcuts

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