percona-server-mongodb-operator icon indicating copy to clipboard operation
percona-server-mongodb-operator copied to clipboard

replsets.podSecurityContext doesn't work

Open drblack666 opened this issue 5 months ago • 3 comments

Report

Sysctls values in the option replsets.podSecurityContext causes the pod to get stuck in CrashLoopBackOff state.

More about the problem

I need to change sysctls params, so I added podSecurityContext to the replsets section:

replsets:
...
  podSecurityContext:
      sysctls:
      - name: net.ipv4.tcp_fin_timeout
        value: "30"

After these changes pod got stuck in the CrashLoopBackOff state. I also tried adding some other options to podSecurityContext with the same result (in pod I can see this user root:x:0:0:root:/root:/bin/bash):

      runAsUser: 0
      runAsGroup: 0

I use perconalab/percona-server-mongodb-operator:1.16.0 and crVersion is 1.16.0

Steps to reproduce

  1. Add sysctls parameter in replsets.podSecurityContext section
  2. Watch pod with mongodb restart in a loop with CrashLoopBackOff status

Versions

Operator (perconalab/percona-server-mongodb-operator:1.16.0 and crVersion is 1.16.0)

Anything else?

Kubernetes version v1.29.7

drblack666 avatar Sep 10 '24 16:09 drblack666