Init container error

operator version is 1.8.0
cfg-0 init container error log :

[root@test-k8s mongo]# kubectl logs my-cluster-name-cfg-0 mongo-init
++ id -u
++ id -g
+ install -o 99 -g 99 -m 0755 -D /ps-entry.sh /data/db/ps-entry.sh
install: cannot create regular file '/data/db/ps-entry.sh': Permission denied

my cr.yaml changed part:

apiVersion: psmdb.percona.com/v1-8-0
kind: PerconaServerMongoDB
metadata:
  name: my-cluster-name
#  finalizers:
#    - delete-psmdb-pvc
spec:
#  platform: kubernetes
#  clusterServiceDNSSuffix: svc.cluster.local
#  pause: true
  crVersion: 1.8.0
  image: percona/percona-server-mongodb:4.2.8-8
  imagePullPolicy: IfNotPresent
#  imagePullSecrets:
#    - name: private-registry-credentials
#  runUid: 1001
  allowUnsafeConfigurations: true
  updateStrategy: SmartUpdate
  upgradeOptions:
    versionServiceEndpoint: https://check.percona.com
    apply: Never
    schedule: "0 2 * * *"
    setFCV: false
  secrets:
    users: my-cluster-name-secrets
  pmm:
    enabled: false
    image: percona/pmm-client:2.12.0
    serverHost: monitoring-service
#    mongodParams: --environment=ENVIRONMENT
#    mongosParams: --environment=ENVIRONMENT
  replsets:
  - name: rs0
    size: 1

and volume part :

    volumeSpec:
#      emptyDir: {}
#      hostPath:
#        path: /data
#        type: Directory
      persistentVolumeClaim:
        storageClassName: openebs-lvmpv
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 0.1Gi

The rest are not modified, they are all default .
How can i solve this problem ?

1 Like

Hello @liusp70 ,

thank you for submitting the question.

As long as you use custom storageClass based on openEBS I would suggest checking the permissions there.
We had similar reports before and it is always insufficient permissions on the storage/file system.
See similar case for MySQL Operator: Update status error - #13 by mckalo

1 Like