dev4devs-com / postgresql-operator

Operator in Go developed using the Operator Framework to package, install, configure and manage a PostgreSQL database.
Apache License 2.0
29 stars 15 forks source link

Storage class not working #93

Open penumbra23 opened 2 years ago

penumbra23 commented 2 years ago

Bug Report

What did you do?

I've followed the instructions and deployed the operator inside a custom namespace (postgresql-operator). Logs show it's working and when deploying a Database object inside the same namespace, it creates the deployment, service, and PVC objects, but the PVC hangs in pending status because it has no storage class.

What did you expect to see?

Running database with attached dynamically provisioned volume.

Environment

Kubernetes v1.19.7 running on rke Postgres Operator by Dev4devs v0.1.1

I have already working storage and PostgreSQL databases working with that storage classes, but it seems that the mapping to the PVC doesn't work. Here is some additional output:

> kubectl get pods -n postgresql-operator
NAME                                   READY   STATUS    RESTARTS   AGE
my-database-5886cc5d7c-92fqc           0/1     Pending   0          11m
postgresql-operator-767db75547-6dlpc   1/1     Running   0          67m

> kubectl describe pvc -n postgresql-operator
Name:          my-database
Namespace:     postgresql-operator
StorageClass:
Status:        Pending
Volume:
Labels:        cr=my-database
               owner=postgresqloperator
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
Mounted By:    my-database-5886cc5d7c-92fqc
Events:
  Type    Reason         Age                 From                         Message
  ----    ------         ----                ----                         -------
  Normal  FailedBinding  93s (x42 over 11m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set

> kubectl get sc
NAME         PROVISIONER                                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
ceph-fs      rook-ceph.cephfs.csi.ceph.com              Delete          Immediate           false                  8d
nfs-client   cluster.local/nfs-nfs-client-provisioner   Delete          Immediate           true                   243d

I've read the docs, but nothing helps it seems. Any idea why? Or where to lookup?

Thanks!