zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 980 forks source link

Feature: allow setting of security context for sidecar containers ( and more) #2800

Open seppelucas opened 3 weeks ago

seppelucas commented 3 weeks ago

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

We use the zalando postgres operator in production with Kyverno. we want to use as little excludes as possible. for the normal containers you can set the security-context trough the values.yaml of the helm chart. We are currently using a sidecar with an custom image for monitoring of the patroni and wal-g backup state. this image does not need any special privileges.

Not all settings for a sidecar are transferred into the statefulset ( such as setting a command, security-context or envFrom).

we would like to be able to set all these settings. we can work around the EnvFrom by specifying exactly which env variables to copy from a secret.( ugly but it works). for the command we had to bake it into the image we are using.

i see there already is a PR and issue for allowing a command. but there is not any action https://github.com/zalando/postgres-operator/issues/2448 https://github.com/zalando/postgres-operator/pull/2449

we would like to request to allow setting these settings for a sidecar. preferably in the postgresql resource to allow different images and settings per postgres cluster. (we have multiple in one kubernetes cluster)