Conversation
NeptuneHub
left a comment
There was a problem hiding this comment.
Hi @theninj4, thanks for this. A couple of things needed:
Conditional guard: Same as PR #2, please use {{- with }} instead of unconditional rendering to avoid securityContext: null when not set.
Apply to all deployments, not just postgres: Please add configurable securityContext to flask, worker, and redis as well, for consistency.
Defaults for flask and worker: The application till now was always run as root (in future I'll doublecheck if this is stricty required or can be changed), so values.yaml must include safe defaults for flask and worker:
flask:
securityContext:
runAsUser: 0
runAsGroup: 0
fsGroup: 0
worker:
securityContext:
runAsUser: 0
runAsGroup: 0
fsGroup: 0
This way the current behavior is preserved out of the box, but users can override it if their setup requires it (like your NFS case for postgres). For postgres and redis you can leave the defaults empty so they only apply when explicitly configured.
NeptuneHub
left a comment
There was a problem hiding this comment.
Please resolve the conflict with the main branch (I basically merged your other PR). Thanks.
👋 I've added securityContext to the
postgressection of values.yaml so I can get persistence working. The core issue is how postgres needs tochownits data directory on boot, however not all Kubernetes storage adapters allow the changing of permissions on mounted volumes - I'm using an NFS storage adapter with this limitation - the solution is to start the container with the userID matching the attached volume. This is quite a niche feature, so I've left it out of the default values, and I've tested both with and without any values present.Preview of the changes: