pgbouncer
Helm chartv0.20.0App 16.16Verified publisher
Postgres connection poller
About this chart
pgbouncer
Postgres connection poller
PgBouncer is a lightweight connection pooler for PostgreSQL. It is designed to manage and optimize database connections by limiting the number of active connections to a PostgreSQL database, which helps improve performance and resource usage, especially in high-traffic environments.
Homepage: https://github.com/sergelogvinov/helm-charts
Maintainers
| Name | Url | |
|---|---|---|
| sergelogvinov | https://github.com/sergelogvinov |
Source Code
# helm values
userlist:
# "username" "password"
# "md5" + "md5(password + username)" // echo -n '1234admin' | md5 -> md545f2603610af569b6155c45067268c6b
pgbouncer: password
betmaster: md5$HASH
databases:
betmaster:
host: pg-0.pg-headless
port: 5432
user: username
dbname: database
poolmode: session
users:
username2:
poolmode: transaction
pgHbaConfiguration: |-
hostssl all all 0.0.0.0/0 md5
serverSslMode: require
clientSslMode: require
updateStrategy:
type: OnDelete
metrics:
enabled: true
Values
| Key | Type | Default | Description |
|---|---|---|---|
| replicaCount | int | 1 | |
| image.repository | string | "ghcr.io/sergelogvinov/pgbouncer" | |
| image.pullPolicy | string | "IfNotPresent" | |
| image.tag | string | "" | |
| kubeVersion | string | "" | |
| imagePullSecrets | list | [] | |
| nameOverride | string | "" | |
| fullnameOverride | string | "" | |
| databases | object | {} | |
| users | object | {} | |
| userlist.pgbouncer | string | "pgbouncer" | |
| pgHbaConfiguration | string | "# host database user address auth-method\nhost all all 10.0.0.0/8 md5\nhostssl all all 0.0.0.0/0 md5" | |
| customSettings | object | {} | |
| serverSslMode | string | "allow" | Server TLS configuration. ref: https://www.pgbouncer.org/config.html#server_tls_sslmode |
| serverSslSecret | string | "" | Server TLS secret name (cert-manager). |
| serverSsl | object | {} | Server TLS secrets. ref: https://www.pgbouncer.org/config.html#server_tls_ca_file ca, cert, key: If you want to use your own certificates, you can provide them here. |
| clientSslMode | string | "allow" | Client TLS configuration. ref: https://www.pgbouncer.org/config.html#client_tls_sslmode |
| clientSslSecret | string | "" | |
| podLabels | object | {} | Extra labels for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ |
| podAnnotations | object | {} | Annotations for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ |
| podSecurityContext | object | {"fsGroup":999,"fsGroupChangePolicy":"OnRootMismatch","runAsGroup":999,"runAsNonRoot":true,"runAsUser":999} | Pod Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod |
| securityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"seccompProfile":{"type":"RuntimeDefault"}} | Container Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod |
| service | object | {"annotations":{},"ipFamilies":["IPv4"],"port":5432,"trafficDistribution":"","type":"ClusterIP"} | Service parameters ref: https://kubernetes.io/docs/user-guide/services/ |
| service.type | string | "ClusterIP" | Service type ref: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types |
| service.port | int | 5432 | Service port |
| service.annotations | object | {} | Annotations for service |
| service.ipFamilies | list | ["IPv4"] | IP families for service possible values: IPv4, IPv6 ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ |
| service.trafficDistribution | string | "" | The traffic distribution for the service. possible values: PreferClose ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution |
| resources | object | {"limits":{"memory":"128Mi"},"requests":{"cpu":"100m","memory":"64Mi"}} | Resource requests and limits ref: https://kubernetes.io/docs/user-guide/compute-resources/ |
| autoscaling | object | {"controlledResources":["cpu","memory"],"controlledValues":"RequestsOnly","enabled":false,"maxAllowed":{},"minAllowed":{},"updatePolicy":{"updateMode":"InPlaceOrRecreate"}} | Vertical pod autoscaler ref: https://kubernetes.io/docs/concepts/workloads/autoscaling/vertical-pod-autoscale/ |
| autoscaling.controlledResources | list | ["cpu","memory"] | Resource to control Possible values are "cpu" and "memory" |
| autoscaling.controlledValues | string | "RequestsOnly" | Controls which resource value should be autoscaled Possible values are "RequestsAndLimits" and "RequestsOnly" |
| autoscaling.maxAllowed | object | {} | Max allowed resources for the pod default is resources.limits |
| autoscaling.minAllowed | object | {} | Min allowed resources for the pod default is resources.requests |
| autoscaling.updatePolicy | object | {"updateMode":"InPlaceOrRecreate"} | Update policy Possible values are "Off", "Initial", "Recreate", "InPlaceOrRecreate" and "Auto" |
| useDaemonSet | bool | false | Use a daemonset instead of a deployment |
| terminationGracePeriodSeconds | int | 240 | |
| updateStrategy | object | {"rollingUpdate":{"maxUnavailable":1},"type":"RollingUpdate"} | pod deployment update strategy type. ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment |
| priorityClassName | string | nil | Priority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass |
| nodeSelector | object | {} | Node labels for pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/ |
| tolerations | list | [] | Tolerations for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ |
| podAntiAffinityPreset | string | "soft" | Pod Anti Affinity soft/hard |
| affinity | object | {} | Affinity for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity |
| metrics.enabled | bool | false | |
| metrics.image.repository | string | "jbub/pgbouncer_exporter" | |
| metrics.image.tag | string | "v0.22.0" | |
| metrics.image.pullPolicy | string | "IfNotPresent" | |
| metrics.resources.limits.cpu | string | "100m" | |
| metrics.resources.limits.memory | string | "32Mi" | |
| metrics.resources.requests.cpu | string | "10m" | |
| metrics.resources.requests.memory | string | "16Mi" |
Deploy pgbouncer with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pgbouncer on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpgbouncer is pinned at v0.20.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply