Feature Request: Add Helm values for PgBouncer directory permissions customization

オープン
#3,066 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go, helm, kubernetes, postgresql

調査の方向性

この issue にはファイルもテストも記載されていないため、まず Helm chart の connectionPooler の values と、PgBouncer Pod を render する templates から始めます。設定可能なディレクトリ権限と汎用的な init-container メカニズムのどちらを選ぶか決める前に、既存の Spilo 環境カスタマイズと init-container のサポートを追跡してください。完了の条件は、既存の pooler の動作を壊さずに、3 つの PgBouncer ディレクトリをカスタムイメージ用に準備できることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
5.3k
フォーク
1.1k
平均マージ
3日 17時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zalando/postgres-operator のほかの issue

zalando/postgres-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。