feat: support defining security contexts for pods and containers#6614
feat: support defining security contexts for pods and containers#6614gbartolini merged 15 commits intocloudnative-pg:mainfrom
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
91460eb to
cb3dd66
Compare
|
/test |
|
@sxd, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/12918936177 |
|
@sxd could you please review and merge this one? |
0d8270a to
d7bb773
Compare
|
Thank you so much for this PR! I need this feature to be allowed to deploy CloudNative-PG at my org. |
|
Very nice! Can we get this added? |
d7bb773 to
3963998
Compare
|
@x0ddf hi! I haven't had time to look into this with full time but the first things that comes to my eyes is, where is the documentation and explanation for the usage of this and also all the risks that can come from a bad configuration of a security context? Something like that should explain what kind of things we can expect if something is badly configured, for example, PostgreSQL not starting because the security context define a different user from the one on the image, or that was defined previously ergo you'll see permissions issue. Also, you're touching the pgbouncer one, that should be handled using the PodTemplate not using the options from the cluster. On the proposal we allow to change the Security Context even on running pods, should we allow that? Just to finish a quick review, please, this is lacking some test and E2E tests. Regards, |
3963998 to
e3611c7
Compare
|
@sxd hi!
I do agree with the statement that misconfigured SecurityContext(SC) is a risk. Still, the lack of opportunity to configure it is a risk also and could be a blocker to adopting it in some environments. For example, in the OpenShift/OKD environments, UID/GID could be randomized, and now you have to do tricks with AdmissionControllers/Kyverno and
If you look at my change around the pgbouncer, you'll see that I'm not doing anything new (the seccomp profile was consumed from the It's already working as you want it to: if SC is defined in the |
e3611c7 to
265070f
Compare
972300c to
5e5a98d
Compare
5e5a98d to
9579476
Compare
9579476 to
9f9daa8
Compare
9f9daa8 to
aa46fb0
Compare
aa46fb0 to
b3d585a
Compare
dc59ede to
f67344f
Compare
7eaccfe to
b055f89
Compare
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/19075418581 |
187ea26 to
8140f85
Compare
- improve SecurityContext for containers Signed-off-by: Sergey Yakovlev <noctus@proton.me>
Signed-off-by: Sergey Yakovlev <noctus@proton.me>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
8095645 to
6e32f36
Compare
This commit introduces the ability to configure
securityContextsettings at both the pod and container level, enhancing control over runtime security policies and permissions.Closes #2821