# Packages
No description provided by the author
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
AddBackRestConfigVolumeAndMounts modifies podSpec to include pgBackRest configuration.
AddWALVolumeAndMountsToBackRest modifies a pgBackRest podSpec to include walVolume.
AddWALVolumeAndMountsToPostgreSQL modifies a PostgreSQL podSpec to include walVolume.
CreatePGHAConfigMap creates a configMap that will be utilized to store configuration settings for a PostgreSQL cluster.
Failover performs a failover to a PostgreSQL cluster, which is effectively a "forced switchover." In other words, failover will force ensure that there is a primary available.
GetAnnotations returns the annotations in a JSON format can be used by the template.
GetBackrestDeployment finds the pgBackRest repository Deployments for a PostgreQL cluster.
GetBadgerAddon is a legacy method that generates a JSONish string to be used to add a pgBadger sidecar to a PostgreSQL instance.
GetBootstrapNamespace returns the proper namespace to use when looking up and/or creating any resources required to bootstrap a PostgreSQL cluster.
consolidate with cluster.GetConfVolume.
GetExporterAddon returns the template used to create an exporter container for metrics.
GetInstanceDeployments finds the Deployments that represent PostgreSQL instances.
needs to be consolidated with cluster.GetLabelsFromMap GetLabelsFromMap ...
GetNodeAffinity returns any node affinity rules for the Operator in a JSON string.
GetPasswordType returns the specific password type to use as part of Postgres user management.
GetPgbackrestBootstrapEnvVars returns a string containing the pgBackRest environment variables for a bootstrap job.
GetPgbackrestBootstrapGCSEnvVars retrieves the values for the various configuration settings required to configure pgBackRest for GCS, specifically for a bootstrap job.
GetPgbackrestBootstrapS3EnvVars retrieves the values for the various configuration settings required to configure pgBackRest for AWS S3, specifically for a bootstrap job (includes a bucket, endpoint, region, key and key secret.
consolidate with cluster.GetPgbackrestEnvVars.
GetPgbackrestGCSEnvVars retrieves the values for the various configuration settings required to configure pgBackRest for GCS.
GetPGBackRestRepoPath is responsible for determining the repo path setting (i.e.
GetPgbackrestS3EnvVars retrieves the values for the various configuration settings require to configure pgBackRest for AWS S3, including a bucket, endpoint, region, key and key secret.
GetPgmonitorEnvVars populates the pgmonitor env var template, which contains any pgmonitor env vars that need to be included in the Deployment spec for a PG cluster.
GetPodAntiAffinity returns the populated pod anti-affinity json that should be attached to the various pods comprising the pg cluster.
GetPodAntiAffinityType returns the type of pod anti-affinity to use.
GetPodSecurityContext will generate the security context required for a Deployment by incorporating the standard fsGroup for the user that runs the container (typically the "postgres" user), and adds any supplemental groups that may need to be added, e.g.
GetRepoType returns the proper repo type to set in container based on the backrest storage type provided
If there are multiple types, the default returned is "posix".
GetResourcesJSON is a pseudo-legacy method that creates JSON that applies the CPU and Memory settings.
GetS3VerifyTLSSetting parses the configured value as a boolean to ensure a valid option is used, then returns the pgBackRest S3 configuration value to either enable or disable TLS verification as the expected string value.
GetSyncReplication returns true if synchronous replication has been enabled using either the pgcluster CR specification or the pgo.yaml configuration file.
GetTablespaceNamePVCMap returns a map of the tablespace name to the PVC name.
GetTablespaceNames generates a comma-separated list of the format "tablespaceName1,tablespceName2" so that the PVC containing a tablespace can be properly mounted in the container, and the tablespace can be referenced by the specified human readable name.
GetTablespacePVCName returns the formatted name that is used for a PVC for a tablespace.
GetTablespaceStorageTypeMap returns a map of "tablespaceName => storageType".
GetTablespaceVolumeMountsJSON Creates an appendable list for the volumeMounts that are used to mount table spacs and returns them in a JSON-ish string.
GetTableSpaceVolumeName returns the name that is used to identify the volume that is used to mount the tablespace.
GetTablespaceVolumes Creates an appendable list for the volumes section of a Kubernetes pod.
No description provided by the author
IsLocalAndGCSStorage a boolean indicating whether or not local and gcs storage should be enabled for pgBackRest based on the backrestStorageType string provided.
IsLocalAndS3Storage a boolean indicating whether or not local and s3 storage should be enabled for pgBackRest based on the backrestStorageType string provided.
NamespaceOperatingMode returns the namespace operating mode for the current Operator installation, which is stored in the "namespaceOperatingMode" variable.
OverrideClusterContainerImages is a helper function that provides the appropriate hooks to override any of the container images that might be deployed with a PostgreSQL cluster.
RemovePrimaryOnRoleChangeTag sets the 'primary_on_role_change' tag to null in the Patroni DCS, effectively removing the tag.
ScaleDeployment scales a deployment to a specified number of replicas.
SetContainerImageOverride determines if there is an override available for a container image, and sets said value on the Kubernetes Container image definition.
SetupNamespaces is responsible for the initial namespace configuration for the Operator install.
Switchover performs a controlled switchover within a PostgreSQL cluster, i.e.
UpdatePGHAConfigInitFlag sets the value for the "init" setting in the PGHA configMap for the PG cluster to the value specified via the "initVal" parameter.
# Constants
PGHAConfigInitSetting determines whether or not initialization logic should be run in the crunchy-postgres-ha (or GIS equivilaent) container.
PGHAConfigMapSuffix defines the suffix for the name of the PGHA configMap created for each PG cluster.
PGHAConfigReplicaBootstrapRepoType defines an override for the type of repo (local, S3, etc.) that should be utilized when bootstrapping a replica (i.e.
# Variables
ContainerImageOverrides contains a list of container images that are overridden by the RELATED_IMAGE_* environmental variables that can be set by people deploying the Operator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
BootstrapJobTemplateFields defines the fields needed to populate the cluster bootstrap job template.
DeploymentTemplateFields ...
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StorageResult is a resolved PgStorageSpec.