Feature Request: Add Helm values for PgBouncer directory permissions customization

Aperta
#3,066 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go, helm, kubernetes, postgresql

Direzione di ricerca

La issue non indica file né test; inizia dai valori connectionPooler del chart Helm e dai template che eseguono il rendering del pod PgBouncer. Traccia la personalizzazione esistente dell'ambiente Spilo e il supporto per init-container prima di scegliere tra permessi di directory configurabili e un meccanismo generale di init-container. Il lavoro è completato quando le tre directory di PgBouncer possono essere preparate per immagini personalizzate senza compromettere il comportamento esistente del pooler.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Feature Request: Add Helm values for PgBouncer directory permissions customization

Problem Statement

When using the Zalando Postgres Operator with Iron Bank hardened container images (or other custom base images), PgBouncer pods can fail due to permission issues on /etc/pgbouncer, /var/log/pgbouncer, and /var/run/pgbouncer directories.

The operator's pooler-connection-sidecar container runs as the same UID as the PgBouncer container (UID 100) and writes TLS certificates to /etc/pgbouncer at runtime. If the base image has these directories configured as read-only or with incompatible permissions, PgBouncer fails with CrashLoopBackOff.

Current Workaround

Users must build custom PgBouncer images with modified permissions:

FROM registry1.dso.mil/ironbank/opensource/pgbouncer/pgbouncer:1.24.0

# Make directories writable by pgbouncer user (UID 100, GID 101)
RUN chown -R 100:101 /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer \
    && chmod 0750 /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer

USER 100:101

Proposed Solution

Add Helm values similar to Spilo's pod environment variable support to allow customizing PgBouncer directory permissions without requiring custom images.

For example:

connectionPooler:
  podEnvironmentConfigMap: pgbouncer-config
  podEnvironmentSecret: pgbouncer-secrets
  initContainers:
    - name: fix-permissions
      image: busybox:latest
      command: ['sh', '-c', 'chown -R 100:101 /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer && chmod 0750 /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer']
      volumeMounts:
        - name: pgbouncer-config
          mountPath: /etc/pgbouncer
        - name: pgbouncer-logs
          mountPath: /var/log/pgbouncer
        - name: pgbouncer-run
          mountPath: /var/run/pgbouncer

Or add specific Helm values:

connectionPooler:
  directoryPermissions:
    enabled: true
    uid: 100
    gid: 101
    mode: "0750"
    paths:
      - /etc/pgbouncer
      - /var/log/pgbouncer
      - /var/run/pgbouncer

Benefits

  1. Iron Bank Compliance: Supports hardened container images without custom builds
  2. Flexibility: Users can adapt to different base image security policies
  3. Consistency: Matches existing Spilo customization patterns in the operator
  4. Maintainability: Eliminates need for maintaining custom image builds

Environment

  • Zalando Postgres Operator: v1.15.0
  • Base Image: Iron Bank PgBouncer 1.24.0
  • Kubernetes: 1.31

Related Issues

This is similar to how Spilo supports podEnvironmentConfigMap and podEnvironmentSecret for customization without requiring custom images.

Lingua principale
Go
Stelle
5.3k
Fork
1.1k
Merge medio
3g 17h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di zalando/postgres-operator

Tutte le issue di zalando/postgres-operator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.