https://rancher.com/ logo
i

icy-parrot-30770

08/04/2022, 1:58 PM
Hi all, i am using rancher desktop, I post here as I tried mainly everything I think about, maybe you will have a response... I would like to use postgres, but I have "access issues / Permission denied" when I enable storage... it works fine without it I tried 2 different images (alpine, bulleyes), 2 different StorageClasses (local-path, openESB), with or without securityContext option (maybe I do not find the right one) and my mount point is set (as recommended) to "/var/lib/postgresql/data" and the "PGDATA" variable is set to "/var/lib/postgresql/data/db/" Full configuration files set is available here : https://github.com/sorriso/kube-postgres-dockerhub is someone who knows how to make it working with local-path StorageClasses ? best regards
f

freezing-airplane-30363

08/04/2022, 2:25 PM
Hi, I just tried to install postgres over helm chart where you can directly define used StorageClass without any further configuration and it seems to work (created pv and pvc are Bound)
Copy code
$ helm repo add bitnami <https://charts.bitnami.com/bitnami>
$ helm install postgres bitnami/postgresql --set global.storageClass=local-path
$ kubectl get sc,pv,pvc
NAME                                               PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
<http://storageclass.storage.k8s.io/local-path|storageclass.storage.k8s.io/local-path> (default)   <http://rancher.io/local-path|rancher.io/local-path>   Delete          WaitForFirstConsumer   false                  7h50m

NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                STORAGECLASS   REASON   AGE
persistentvolume/pvc-b5f5aec9-565a-44ce-99bb-144516405338   8Gi        RWO            Delete           Bound    default/data-postgres-postgresql-0   local-path              4m38s

NAME                                               STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
persistentvolumeclaim/data-postgres-postgresql-0   Bound    pvc-b5f5aec9-565a-44ce-99bb-144516405338   8Gi        RWO            local-path     4m41s
i

icy-parrot-30770

08/04/2022, 2:36 PM
thank you !! I will be able to compare & find with it do not work 🙂
f

freezing-airplane-30363

08/04/2022, 2:37 PM
you are welcome 🙂
i

icy-parrot-30770

08/04/2022, 2:42 PM
the final objective is to build a postgres image from source on an UBI-minimal base image... there is stil some work to do :)
f

freezing-airplane-30363

08/04/2022, 2:44 PM
it should be doable I guess, good luck with that
63 Views