-
Notifications
You must be signed in to change notification settings - Fork 1.1k
build multi-arch pooler image #3077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FxKu
wants to merge
10
commits into
master
Choose a base branch
from
pooler-build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
943da73
build multi-arch pooler image
FxKu 34c20b4
ad pooler build step in delivery.yaml and bump pooler version
FxKu e2e84b8
pull from docker hub not zalando registry
FxKu 5e3bf53
small fix in deliver.yaml
FxKu 5b4e927
remove src from git clone command
FxKu 20f9ce4
switch to known branch
FxKu 88cfa12
remove mkdir pgbouncer command
FxKu b63732d
update pooler Dockerfile
FxKu a980608
remove symlink line for rst2man.py
FxKu 1c5a490
add pooler step to ghcr workflow
FxKu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| ARG BASE_IMAGE=alpine:3.19 | ||
| FROM ${BASE_IMAGE} AS build_stage | ||
|
|
||
| RUN apk --update add \ | ||
| autoconf automake build-base c-ares-dev git libevent-dev libtool m4 \ | ||
| openssl-dev py3-docutils py3-pip python3 | ||
|
|
||
| WORKDIR /src | ||
|
|
||
| RUN git clone \ | ||
| --single-branch \ | ||
| --branch=stable-1.23 \ | ||
| --depth 1 \ | ||
| https://github.com/pgbouncer/pgbouncer.git . | ||
|
|
||
| RUN git submodule init && git submodule update | ||
|
|
||
| RUN ./autogen.sh && \ | ||
| ./configure --prefix=/pgbouncer --with-libevent=/usr/lib && \ | ||
| sed -i '/dist_man_MANS/d' Makefile && \ | ||
| make && \ | ||
| make install | ||
|
|
||
| FROM ${BASE_IMAGE} | ||
|
|
||
| RUN apk -U upgrade --no-cache \ | ||
| && apk --no-cache add bash c-ares ca-certificates gettext libevent openssl postgresql-client | ||
|
|
||
| RUN addgroup -g 101 -S pgbouncer && \ | ||
| adduser -u 100 -S pgbouncer -G pgbouncer && \ | ||
| mkdir -p /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer /etc/ssl/certs | ||
|
|
||
| COPY --from=build_stage /pgbouncer/bin/pgbouncer /bin/pgbouncer | ||
| COPY pgbouncer.ini.tmpl auth_file.txt.tmpl /etc/pgbouncer/ | ||
| COPY entrypoint.sh /entrypoint.sh | ||
|
|
||
| RUN chown -R pgbouncer:pgbouncer \ | ||
| /var/log/pgbouncer \ | ||
| /var/run/pgbouncer \ | ||
| /etc/pgbouncer \ | ||
| /etc/ssl/certs \ | ||
| && chmod +x /entrypoint.sh | ||
|
|
||
| USER pgbouncer:pgbouncer | ||
| WORKDIR /etc/pgbouncer | ||
|
|
||
| ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| "$PGUSER" "$PGPASSWORD" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -ex | ||
|
|
||
| if [ -z "${CONNECTION_POOLER_CLIENT_TLS_CRT}" ]; then | ||
| openssl req -nodes -new -x509 -subj /CN=spilo.dummy.org \ | ||
| -keyout /etc/ssl/certs/pgbouncer.key \ | ||
| -out /etc/ssl/certs/pgbouncer.crt | ||
| else | ||
| ln -s ${CONNECTION_POOLER_CLIENT_TLS_CRT} /etc/ssl/certs/pgbouncer.crt | ||
| ln -s ${CONNECTION_POOLER_CLIENT_TLS_KEY} /etc/ssl/certs/pgbouncer.key | ||
| if [ ! -z "${CONNECTION_POOLER_CLIENT_CA_FILE}" ]; then | ||
| ln -s ${CONNECTION_POOLER_CLIENT_CA_FILE} /etc/ssl/certs/ca.crt | ||
| fi | ||
| fi | ||
|
|
||
| envsubst < /etc/pgbouncer/pgbouncer.ini.tmpl > /etc/pgbouncer/pgbouncer.ini | ||
| envsubst < /etc/pgbouncer/auth_file.txt.tmpl > /etc/pgbouncer/auth_file.txt | ||
|
|
||
| exec /bin/pgbouncer /etc/pgbouncer/pgbouncer.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # vim: set ft=dosini: | ||
|
|
||
| [databases] | ||
| * = host=$PGHOST port=$PGPORT auth_user=$PGUSER | ||
| postgres = host=$PGHOST port=$PGPORT auth_user=$PGUSER | ||
|
|
||
| [pgbouncer] | ||
| pool_mode = $CONNECTION_POOLER_MODE | ||
| listen_port = $CONNECTION_POOLER_PORT | ||
| listen_addr = * | ||
| auth_type = md5 | ||
| auth_file = /etc/pgbouncer/auth_file.txt | ||
| auth_dbname = postgres | ||
| admin_users = $PGUSER | ||
| stats_users_prefix = robot_ | ||
| auth_query = SELECT * FROM $PGSCHEMA.user_lookup($1) | ||
| logfile = /var/log/pgbouncer/pgbouncer.log | ||
| pidfile = /var/run/pgbouncer/pgbouncer.pid | ||
|
|
||
| server_tls_sslmode = require | ||
| server_tls_ca_file = /etc/ssl/certs/pgbouncer.crt | ||
| server_tls_protocols = secure | ||
| client_tls_sslmode = require | ||
| client_tls_key_file = /etc/ssl/certs/pgbouncer.key | ||
| client_tls_cert_file = /etc/ssl/certs/pgbouncer.crt | ||
|
|
||
| log_connections = 0 | ||
| log_disconnections = 0 | ||
|
|
||
| # Number of prepared statements to cache on a server connection (zero value | ||
| # disables support of prepared statements). | ||
| max_prepared_statements = 200 | ||
|
|
||
| # How many server connections to allow per user/database pair. | ||
| default_pool_size = $CONNECTION_POOLER_DEFAULT_SIZE | ||
|
|
||
| # Add more server connections to pool if below this number. Improves behavior | ||
| # when usual load comes suddenly back after period of total inactivity. | ||
| # | ||
| # NOTE: This value is per pool, i.e. a pair of (db, user), not a global one. | ||
| # Which means on the higher level it has to be calculated from the max allowed | ||
| # database connections and number of databases and users. If not taken into | ||
| # account, then for too many users or databases PgBouncer will go crazy | ||
| # opening/evicting connections. For now disable it. | ||
| # | ||
| # min_pool_size = $CONNECTION_POOLER_MIN_SIZE | ||
|
|
||
| # How many additional connections to allow to a pool | ||
| reserve_pool_size = $CONNECTION_POOLER_RESERVE_SIZE | ||
|
|
||
| # Maximum number of client connections allowed. | ||
| max_client_conn = $CONNECTION_POOLER_MAX_CLIENT_CONN | ||
|
|
||
| # Do not allow more than this many connections per database (regardless of | ||
| # pool, i.e. user) | ||
| max_db_connections = $CONNECTION_POOLER_MAX_DB_CONN | ||
|
|
||
| # If a client has been in "idle in transaction" state longer, it will be | ||
| # disconnected. [seconds] | ||
| idle_transaction_timeout = 600 | ||
|
|
||
| # If login failed, because of failure from connect() or authentication that | ||
| # pooler waits this much before retrying to connect. Default is 15. [seconds] | ||
| server_login_retry = 5 | ||
|
|
||
| # To ignore extra parameter in startup packet. By default only 'database' and | ||
| # 'user' are allowed, all others raise error. This is needed to tolerate | ||
| # overenthusiastic JDBC wanting to unconditionally set 'extra_float_digits=2' | ||
| # in startup packet. | ||
| ignore_startup_parameters = extra_float_digits,options |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use latest stable version 3.22?