Remove support for pgcat

This commit is contained in:
Daniel Berteaud 2024-04-04 16:33:16 +02:00
parent 86a494b278
commit 3f4ca9acad
4 changed files with 0 additions and 133 deletions

View File

@ -1,34 +0,0 @@
FROM rust:alpine AS builder
ARG PGCAT_VERSION=1.1.1
RUN set -euxo pipefail &&\
apk --no-cache upgrade &&\
apk --no-cache add \
git \
musl-dev \
build-base \
&&\
cd /tmp &&\
git clone --branch=v${PGCAT_VERSION} --depth=1 https://github.com/postgresml/pgcat.git &&\
cd pgcat &&\
cargo build --release
FROM [[ .docker.repo ]][[ .docker.base_images.alpine.image ]]
MAINTAINER [[ .docker.maintainer ]]
ENV PGCAT_CONF_DIR=/etc/pgcat \
LANG=[[ .locale.lang ]] \
TZ=[[ .locale.tz ]] \
RUST_LOG=info
RUN set -euxo pipefail &&\
addgroup -g 6432 pgcat &&\
adduser --system --ingroup pgcat --disabled-password --uid 6432 --home /tmp --shell /sbin/nologin pgcat
COPY --from=builder /tmp/pgcat/target/release/pgcat /usr/local/bin/pgcat
COPY --from=builder /tmp/pgcat/pgcat.toml /etc/pgcat/pgcat.toml
USER pgcat
WORKDIR ${PGCAT_CONF_DIR}
CMD ["pgcat"]

View File

@ -1,89 +0,0 @@
[[- /* vim: syntax=hcl
This is a pgcat instance, designed to run as a sidecar with every application
needing postgres access. */]]
[[- if eq .postgres.pooler.engine "pgcat" ]]
task "pgcat" {
driver = "[[ .nomad.driver ]]"
lifecycle {
hook = "prestart"
sidecar = true
}
config {
image = "[[ .docker.repo ]][[ .docker.base_images.pgcat.image ]]"
pids_limit = 100
readonly_rootfs = true
workdir = "/secrets"
}
[[ template "common/vault.policies" . ]]
template {
data =<<_EOT
[general]
host = "127.0.0.1"
port = [[ .postgres.pooler.port ]]
enable_prometheus_exporter = false
healthcheck_delay = 10000
log_client_connections = true
log_client_disconnections = true
autoreload = 5000
[[- if and (not (has .postgres "service_name")) (regexp.Match "^(127\\.0\\.0\\.1|localhost)$" .postgres.host) ]]
server_tls = false
[[- else ]]
server_tls = false
verify_server_certificate = true
[[- end ]]
admin_username = "admin"
admin_password = "password"
[pools.[[ .instance ]]]
pool_mode = "session"
[[- if .postgres.pooler.read_on_replicas ]]
query_parser_enabled = true
[[- end ]]
[pools.[[ .instance ]].users.0]
username = "[[ .instance ]]"
password = "{{ env "NOMAD_ALLOC_ID" }}"
server_username = "[[ .postgres.user ]]"
server_password = "[[ .postgres.password ]]"
pool_size = 9
[pools.[[ .instance ]].shards.0]
[[- if has .postgres "service_name" ]]
servers = [
{{- range $_, $instance := service "[[ .postgres.primary_tag ]].[[ .postgres.service_name ]]" }}
[ "{{ .Address }}", {{ .Port }}, "primary" ],
{{- end }}
{{- range $_, $instance := service "[[ .postgres.replica_tag ]].[[ .postgres.service_name ]]" }}
[ "{{ .Address }}", {{ .Port }}, "replica" ],
{{- end }}
]
[[- else ]]
servers = [
[ "[[ .postgres.host ]]", [[ .postgres.port ]], "primary" ]
]
[[- end ]]
database = "[[ if has .postgres "database" ]][[ .postgres.database ]][[ else ]][[ .instance ]][[ end ]]"
_EOT
destination = "secrets/pgcat.toml"
uid = 106432
gid = 100000
perms = 400
change_mode = "noop"
}
[[ template "common/resources" .postgres.pooler.resources ]]
}
[[- end ]]

View File

@ -1,5 +1,3 @@
[[- if eq .postgres.pooler.engine "pgbouncer" ]]
[[ template "common/task.pgbouncer" . ]]
[[- else if eq .postgres.pooler.engine "pgcat" ]]
[[ template "common/task.pgcat" . ]]
[[- end ]]

View File

@ -344,14 +344,6 @@ docker:
depends_on:
- alpine
# pgcat
pgcat:
image: pgcat:1.1.1-1
tags:
- pgcat:latest
depends_on:
- alpine
# PHP
php82:
image: php:82.24.4-1