postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Missing pod capabilities: ./run: 21: ulimit: error setting limit (Operation not permitted) #895

Open Richard87 opened this issue 3 years ago • 2 comments

Missing pod capabilities

  • Which image of the operator are you using? ghcr.io/zalando/spilo-15:3.0-p1
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? [TrueNas Scale]
  • Are you running Postgres Operator in production? [no]
  • Type of issue? [Bug report]

The pod is trying to execute set ulimit, but is not allowed to, is this a bug?

Should ulimit be called, and if so, should the pod be configured to have the capability?

Clone of this closed issue: https://github.com/zalando/spilo/issues/881

I added this to the helm chart, but it had no effect:

securityContext:
  capabilities:
    add:
    - CAP_SYS_RESOURCE

To fix it I had to manually edit the statefulset and delete the db-pod...

But, Will this be reset when the operator reconcile the statefulset in the future?

Richard87 avatar Jul 30 '23 11:07 Richard87

I stumbled across your issue as I was having the same problem and as you said manual edits of the sts are undone by the operator at some point.

I just found out that you can add additional capabilities here. They will be added to the postgres-operator cm and used when creating the postgres containers.

For some reason I wasn't able to list the additional capabilities as an array, but this worked:

configKubernetes:
  additional_pod_capabilities: "SYS_RESOURCE"

I am using an older chart version though.

Hope this helps!

ntm97 avatar Aug 08 '23 13:08 ntm97

Thanks, there are a few hacks :) I have jumped ships to cnpg, so Zalando, feel free to close this ´now or when fixed I will probably not be available for testing since I'm not using the operator at the moment...

Richard87 avatar Aug 08 '23 14:08 Richard87