reactive-tech / kubegres

Kubegres is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql instances and manage databases replication, failover and backup.
https://www.kubegres.io
Apache License 2.0
1.31k stars 74 forks source link

kubegres not starting replica pods #149

Closed fupelaqu closed 1 year ago

fupelaqu commented 1 year ago

Hi, I am testing kubegres v1.16 with k3s v 1.26 with 3 replicas

The first replica pod is not starting with the following error : Defaulted container "mypostgres-2" out of: mypostgres-2, setup-replica-data-directory (init) Error from server (BadRequest): container "mypostgres-2" in pod "mypostgres-2-0" is waiting to start: PodInitializing

The corresponding pvc has been created and bounded to the pod

Here is my configuration :

apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
  name: mypostgres
  namespace: default

spec:

   replicas: 3
   image: postgres:14.1
   port: 5432

   database:
      size: 200Mi
      storageClassName: local-path #longhorn
      volumeMount: /var/lib/postgresql/data

   resources:
      limits:
         memory: "500Mi"
         cpu: "0.5"
      requests:
         memory: "500Mi"
         cpu: "0.5"

   env:
      - name: POSTGRES_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: superUserPassword

      - name: POSTGRES_REPLICATION_PASSWORD
        valueFrom:
           secretKeyRef:
              name: mypostgres-secret
              key: replicationUserPassword
fupelaqu commented 1 year ago

It was an selinux issue Changing it to permissive resolved the problem