zalando / zalando/postgres-operator

Feature-Request: Templating Secrets

Open
#1,746 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? e.g. registry.opensource.zalan.do/acid/postgres-operator:v1.7.1
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K3s
  • Are you running Postgres Operator in production? not yet
  • Type of issue? feature request

Templating Secrets

I'm currently facing the issue to get the Postgres-Operator work in combination with the AWX-Operator. The AWX-Operator requires a postgres-configuration-secret like this:

stringData:
  host: <external ip or url resolvable by the cluster>
  port: <external port, this usually defaults to 5432>
  database: <desired database name>
  username: <username to connect as>
  password: <password to connect with>
  sslmode: prefer
  type: unmanaged

But the Secret generated by the postgres-operator only contains the username & password. So either I have to copy or modify the secret. Both things i would like avoid.

Since I guess that there are more cases of software requiring e.g. different secret keys, templating the secret just like secret_name_template would be awsome. This way I could easily define something like this:

secret_template:
  host:  {{ service-name }}
  port: 5432
  database: {{ database }}
  username:  {{ username }}
  password: {{ password }}
  sslmode: prefer
  type: unmanaged

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by tracing how the operator generates its PostgreSQL Secret and compare that path with the existing secret_name_template setting. Define the template inputs and verify that a configured template produces all requested AWX-compatible keys without manual copying.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
databases, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.