pgbouncer

package
v3.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CertFrontendAuthoritySecretKey  = "pgbouncer-frontend.ca-roots"
	CertFrontendPrivateKeySecretKey = "pgbouncer-frontend.key"
	CertFrontendSecretKey           = "pgbouncer-frontend.crt"
)
View Source
const (
	AdminPasswordSecretKey = "pgbouncer-admin-password" // #nosec G101 this is a name, not a credential

	// These are shared with the pgbouncer-startup binary, which cannot import
	// this package: it must build without cgo. See internal/pgbouncer/startup.
	AdminUser           = startup.AdminUser
	AdminPasswordEnvVar = startup.AdminPasswordEnvVar
	PausedValue         = startup.PausedValue
	PGBouncerPortEnvVar = startup.PortEnvVar
)

Variables

This section is empty.

Functions

func ConfigMap

func ConfigMap(
	inCluster *v1beta1.PostgresCluster,
	outConfigMap *corev1.ConfigMap,
)

ConfigMap populates the PgBouncer ConfigMap.

func CustomTLSAuthorityKey

func CustomTLSAuthorityKey(projection *corev1.SecretProjection) string

CustomTLSAuthorityKey returns the key within the custom PgBouncer TLS Secret that holds its certificate authority, honoring any remapping in the projection items.

func DisableInPostgreSQL

func DisableInPostgreSQL(ctx context.Context, exec postgres.Executor) error

DisableInPostgreSQL removes any objects created by EnableInPostgreSQL.

func EnableInPostgreSQL

func EnableInPostgreSQL(
	ctx context.Context, exec postgres.Executor, clusterSecret *corev1.Secret, exposeSuperusers bool,
) error

EnableInPostgreSQL creates the PgBouncer user, schema, and SECURITY DEFINER function that allows it to authenticate clients using their password stored in PostgreSQL.

func Pod

func Pod(
	ctx context.Context,
	inCluster *v1beta1.PostgresCluster,
	inConfigMap *corev1.ConfigMap,
	inPostgreSQLCertificate *corev1.SecretProjection,
	inSecret *corev1.Secret,
	outPod *corev1.PodSpec,
	initImage string,
)

Pod populates a PodSpec with the container and volumes needed to run PgBouncer.

func PostgreSQL

func PostgreSQL(
	inCluster *v1beta1.PostgresCluster,
	outHBAs *postgres.HBAs,
)

PostgreSQL populates outHBAs with any records needed to run PgBouncer.

func Secret

func Secret(ctx context.Context,
	inCluster *v1beta1.PostgresCluster,
	inRoot *pki.RootCertificateAuthority,
	inSecret *corev1.Secret,
	inUserSecret *corev1.Secret,
	inService *corev1.Service,
	outSecret *corev1.Secret,

	frontendCertManagerSecret *corev1.Secret,
	additionalCAs [][]byte,
) error

Secret populates the PgBouncer Secret.

Types

This section is empty.

Directories

Path Synopsis
Package startup holds the contract between the operator and the pgbouncer-startup binary that runs as the PgBouncer container's startup probe: the paths it reads, the environment it expects, and the admin credentials it connects with.
Package startup holds the contract between the operator and the pgbouncer-startup binary that runs as the PgBouncer container's startup probe: the paths it reads, the environment it expects, and the admin credentials it connects with.

Jump to

Keyboard shortcuts

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