readOnlyRootFilesystem option for psmdb-db on kubernetes managed by operator doesnt works

Description:

Operator workload-deployment runs on Kubernetes cluster without problem.
Afterwards StatefulSet is created for mongodb-cluster to manage 3 pods.
Pods crash with crashloopbackoff error.

value.yaml under psmdb-db folder looks like this:
replsets:
rs0:
podSecurityContext:
fsGroup: 9001
supplementalGroups:
- 1001
containerSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsGroup: 9001
runAsNonRoot: true
runAsUser: 9001

Steps to Reproduce:

  • cd charts/psmdb-operator

  • helm upgrade
    –install mongodb-operator-1
    –debug
    –wait
    –timeout=20m .

  • cd charts/psmdb-db

  • helm upgrade
    –install mongodb-cluster-1
    –debug
    –set serviceAccount.name=percona-server-mongodb-operator
    –wait
    –timeout=20m .

Version:

1.20.0

Logs:

Logs from Pod.
path":“/tmp/mongodb-27017.sock”,“error”:"Read-only file system

@m.benik Hi, we have a task Jira about this problem. We will improve it in 1.22.0.