{"id":33670,"date":"2024-07-05T14:20:28","date_gmt":"2024-07-05T12:20:28","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=33670"},"modified":"2024-07-05T14:20:31","modified_gmt":"2024-07-05T12:20:31","slug":"cloudnativepg-storage","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/","title":{"rendered":"CloudNativePG \u2013 Storage"},"content":{"rendered":"\n<p>This is the next post in the series about CloudNativePG (the previous one are <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-on-minicube-on-opensuse-leap-micro-6\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>, <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-bootstrapping-an-empty-cluster\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>, <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-configuring-the-postgresql-instance\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>, <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-postgresql-extensions\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>, <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-the-kubectl-plugin\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a> and <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-scaling-up-and-down\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>). In this post we&#8217;ll look at storage, and if you ask me, this is the most important topic when it comes to deploying PostgreSQL on Kubernetes. In the past we&#8217;ve seen a lot of deployments which used <a href=\"https:\/\/en.wikipedia.org\/wiki\/Network_File_System\" target=\"_blank\" rel=\"noreferrer noopener\">NFS<\/a> as a shared storage for their deployments. While this works, it is usually not a good choice for PostgreSQL workloads in such a setup, and this is because of performance. But a lot of things changed in the recent years, and today there is plenty of choice when it comes to storage with Kubernetes.<\/p>\n\n\n\n<p>What you usually have with PostgreSQL, is a streaming replication setup as we&#8217;ve seen it in the previous posts. In such a setup there is no need for shared storage, as data is replicated by PostgreSQL. This means you need <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/storage\/persistent-volumes\/\" target=\"_blank\" rel=\"noreferrer noopener\">persistent local storage<\/a>, which means local storage on the Kubernetes worker nodes. This storage is then mapped into the containers and can be used by PostgreSQL to store data persistently. Using the <a href=\"https:\/\/github.com\/kubernetes\/community\/blob\/master\/sig-storage\/volume-plugin-faq.md#kubernetes-volume-plugin-faq-for-storage-vendors\">CSI<\/a> (Container Storage Interface) everybody can plugin some kind of storage into the Kubernetes system and containers can then use this for storing their data. You can find a list of storage drivers <a href=\"https:\/\/kubernetes-csi.github.io\/docs\/drivers.html\">here<\/a>.<\/p>\n\n\n\n<p>As mentioned in the CloudNativePG <a href=\"https:\/\/cloudnative-pg.io\/documentation\/1.23\/storage\/\" target=\"_blank\" rel=\"noreferrer noopener\">documentation<\/a>, you should chose a driver which supports snapshots, because this is used for backing up your PostgreSQL instance. What we&#8217;ve tested recently at dbi services is <a href=\"https:\/\/openebs.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenEBS<\/a> and this gave very good results. This solution comes with <a href=\"https:\/\/github.com\/openebs\/\">two types of storage<\/a> services, local and replicated. As we don&#8217;t need a replicated storage for the PostgreSQL deployment, we&#8217;ll obviously go for the local one. There are additional choices for the local one, which are <a href=\"https:\/\/en.wikipedia.org\/wiki\/Logical_volume_management\">LVM<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/ZFS\">ZFS<\/a> or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Raw_device\">raw<\/a> device. For our use case, LVM fits best, so let&#8217;s start by setting this up.<\/p>\n\n\n\n<p>In all the previous posts we&#8217;ve used <a href=\"https:\/\/minikube.sigs.k8s.io\/docs\/\">minicube<\/a>, but as this is a single node deployment I&#8217;ve changed my environment to a more production grade setup by deploying a vanilla Kubernetes with one <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/overview\/components\/\">Control Plane and three Worker Nodes<\/a> (in a real production setup you should have three ore more Control Planes for high availability):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get nodes\nNAME                       STATUS   ROLES           AGE     VERSION\nk8s1                       Ready    control-plane   4d23h   v1.30.2\nk8s2.it.dbi-services.com   Ready    worker          4d23h   v1.30.2\nk8s3.it.dbi-services.com   Ready    worker          4d23h   v1.30.2\nk8s4.it.dbi-services.com   Ready    worker          4d23h   v1.30.2\n<\/pre><\/div>\n\n\n<p>The CloudNativePG operator and the <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/access-application-cluster\/web-ui-dashboard\/\">Kubernetes Dashboard<\/a> are already deployed (<a href=\"https:\/\/docs.tigera.io\/calico\/latest\/about\/\" target=\"_blank\" rel=\"noreferrer noopener\">Calico<\/a> is the network component):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get pods -A\nNAMESPACE              NAME                                                    READY   STATUS    RESTARTS       AGE\ncnpg-system            cnpg-controller-manager-6ddc45757d-fql27                1\/1     Running   1 (24m ago)    4d19h\nkube-system            calico-kube-controllers-564985c589-jtm5j                1\/1     Running   1 (24m ago)    4d22h\nkube-system            calico-node-52qxf                                       1\/1     Running   1 (24m ago)    4d22h\nkube-system            calico-node-6f4v4                                       1\/1     Running   1 (24m ago)    4d22h\nkube-system            calico-node-jfj7s                                       1\/1     Running   1 (24m ago)    4d22h\nkube-system            calico-node-l92mf                                       1\/1     Running   1 (24m ago)    4d22h\nkube-system            coredns-7db6d8ff4d-98x5z                                1\/1     Running   1 (24m ago)    4d23h\nkube-system            coredns-7db6d8ff4d-mf7xq                                1\/1     Running   1 (24m ago)    4d23h\nkube-system            etcd-k8s1                                               1\/1     Running   20 (24m ago)   4d23h\nkube-system            kube-apiserver-k8s1                                     1\/1     Running   19 (24m ago)   4d23h\nkube-system            kube-controller-manager-k8s1                            1\/1     Running   26 (24m ago)   4d23h\nkube-system            kube-proxy-h6fsv                                        1\/1     Running   1 (24m ago)    4d23h\nkube-system            kube-proxy-jqmkl                                        1\/1     Running   1 (24m ago)    4d23h\nkube-system            kube-proxy-sz9lx                                        1\/1     Running   1 (24m ago)    4d23h\nkube-system            kube-proxy-wg7nx                                        1\/1     Running   1 (24m ago)    4d23h\nkube-system            kube-scheduler-k8s1                                     1\/1     Running   29 (24m ago)   4d23h\nkubernetes-dashboard   kubernetes-dashboard-api-bf787c6f4-2c4bw                1\/1     Running   1 (24m ago)    4d22h\nkubernetes-dashboard   kubernetes-dashboard-auth-6765c66c7c-7xzbx              1\/1     Running   1 (24m ago)    4d22h\nkubernetes-dashboard   kubernetes-dashboard-kong-7696bb8c88-cc462              1\/1     Running   1 (24m ago)    4d22h\nkubernetes-dashboard   kubernetes-dashboard-metrics-scraper-5485b64c47-cz75d   1\/1     Running   1 (24m ago)    4d22h\nkubernetes-dashboard   kubernetes-dashboard-web-84f8d6fff4-vzdcw               1\/1     Running   1 (24m ago)    4d22h\n<\/pre><\/div>\n\n\n<p>For being able able to create a LVM physical volume, there is an additional small disk (vdb) on all the worker nodes:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,9,17]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ ssh k8s2 &#039;lsblk&#039;\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsr0     11:0    1 1024M  0 rom  \nvda    254:0    0   20G  0 disk \n\u251c\u2500vda1 254:1    0   19G  0 part \/\n\u251c\u2500vda2 254:2    0    1K  0 part \n\u2514\u2500vda5 254:5    0  975M  0 part \nvdb    254:16   0    5G  0 disk \nk8s@k8s1:~$ ssh k8s3 &#039;lsblk&#039;\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsr0     11:0    1 1024M  0 rom  \nvda    254:0    0   20G  0 disk \n\u251c\u2500vda1 254:1    0   19G  0 part \/\n\u251c\u2500vda2 254:2    0    1K  0 part \n\u2514\u2500vda5 254:5    0  975M  0 part \nvdb    254:16   0    5G  0 disk \nk8s@k8s1:~$ ssh k8s4 &#039;lsblk&#039;\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsr0     11:0    1 1024M  0 rom  \nvda    254:0    0   20G  0 disk \n\u251c\u2500vda1 254:1    0   19G  0 part \/\n\u251c\u2500vda2 254:2    0    1K  0 part \n\u2514\u2500vda5 254:5    0  975M  0 part \nvdb    254:16   0    5G  0 disk \n<\/pre><\/div>\n\n\n<p>As LVM is not installed by default in a <a href=\"https:\/\/www.debian.org\/\">Debian 12<\/a> minimal installation (which is used here on all the nodes), this needs to be installed:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ ssh k8s2 &#039;sudo apt install -y lvm2&#039;\nk8s@k8s1:~$ ssh k8s3 &#039;sudo apt install -y lvm2&#039;\nk8s@k8s1:~$ ssh k8s4 &#039;sudo apt install -y lvm2&#039;\n<\/pre><\/div>\n\n\n<p>Now the physical volume and the volume group can be created, on all the worker nodes:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,3,5,7,9,11,13]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ ssh k8s2 &#039;sudo pvcreate \/dev\/vdb&#039;\n  Physical volume &quot;\/dev\/vdb&quot; successfully created.\nk8s@k8s1:~$ ssh k8s3 &#039;sudo pvcreate \/dev\/vdb&#039;\n  Physical volume &quot;\/dev\/vdb&quot; successfully created.\nk8s@k8s1:~$ ssh k8s4 &#039;sudo pvcreate \/dev\/vdb&#039;\n  Physical volume &quot;\/dev\/vdb&quot; successfully created.\nk8s@k8s1:~$ ssh k8s2 &#039;sudo vgcreate vgopenebs \/dev\/vdb&#039;\n  Volume group &quot;vgopenebs&quot; successfully created\nk8s@k8s1:~$ ssh k8s3 &#039;sudo vgcreate vgopenebs \/dev\/vdb&#039;\n  Volume group &quot;vgopenebs&quot; successfully created\nk8s@k8s1:~$ ssh k8s4 &#039;sudo vgcreate vgopenebs \/dev\/vdb&#039;\n  Volume group &quot;vgopenebs&quot; successfully created\nk8s@k8s1:~$ ssh k8s2 &#039;sudo vgs&#039;\n  VG        #PV #LV #SN Attr   VSize  VFree \n  vgopenebs   1   0   0 wz--n- &lt;5.00g &lt;5.00g\n<\/pre><\/div>\n\n\n<p>That&#8217;s it from the LVM side. The next step is to install the OpenEBS LVM2 LocalPV-LVM driver, which is done with <a href=\"https:\/\/helm.sh\/\">Helm<\/a>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,3,8]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ helm repo add openebs https:\/\/openebs.github.io\/openebs\n&quot;openebs&quot; has been added to your repositories\nk8s@k8s1:~$ helm repo update\nHang tight while we grab the latest from your chart repositories...\n...Successfully got an update from the &quot;openebs&quot; chart repository\n...Successfully got an update from the &quot;kubernetes-dashboard&quot; chart repository\nUpdate Complete. \u2388Happy Helming!\u2388\nk8s@k8s1:~$ helm install openebs --namespace openebs openebs\/openebs --create-namespace\nNAME: openebs\nLAST DEPLOYED: Wed Jun 19 08:43:14 2024\nNAMESPACE: openebs\nSTATUS: deployed\nREVISION: 1\nNOTES:\nSuccessfully installed OpenEBS.\n\nCheck the status by running: kubectl get pods -n openebs\n\nThe default values will install both Local PV and Replicated PV. However,\nthe Replicated PV will require additional configuration to be fuctional.\nThe Local PV offers non-replicated local storage using 3 different storage\nbackends i.e HostPath, LVM and ZFS, while the Replicated PV provides one replicated highly-available\nstorage backend i.e Mayastor.\n\nFor more information, \n- view the online documentation at https:\/\/openebs.io\/docs\n- connect with an active community on our Kubernetes slack channel.\n        - Sign up to Kubernetes slack: https:\/\/slack.k8s.io\n        - #openebs channel: https:\/\/kubernetes.slack.com\/messages\/openebs\n<\/pre><\/div>\n\n\n<p>By looking at what&#8217;s happening in the &#8220;openebs&#8221; namespace, we can see that OpenEBS is being deployed and created:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get pods -n openebs\nNAME                                              READY   STATUS              RESTARTS   AGE\ninit-pvc-1f4f8c25-5523-44f4-94ad-8aa896bcd382     0\/1     ContainerCreating   0          53s\ninit-pvc-39544e8c-3c0c-4b0b-ba07-dd23502acaa1     0\/1     ContainerCreating   0          53s\ninit-pvc-5ebe4c41-9f77-408c-afde-0a2213c10f0f     0\/1     ContainerCreating   0          53s\ninit-pvc-a33f5f49-7366-4f0d-986b-c8a282bde36e     0\/1     ContainerCreating   0          53s\nopenebs-agent-core-b48f4fbc4-r94wc                0\/2     Init:0\/1            0          71s\nopenebs-agent-ha-node-89fcp                       0\/1     Init:0\/1            0          71s\nopenebs-agent-ha-node-bn7wt                       0\/1     Init:0\/1            0          71s\nopenebs-agent-ha-node-w574q                       0\/1     Init:0\/1            0          71s\nopenebs-api-rest-74954d444-cdfwt                  0\/1     Init:0\/2            0          71s\nopenebs-csi-controller-5d4fc97648-znvph           0\/6     Init:0\/1            0          71s\nopenebs-csi-node-2kwlx                            0\/2     Init:0\/1            0          71s\nopenebs-csi-node-8sct6                            0\/2     Init:0\/1            0          71s\nopenebs-csi-node-bjknj                            0\/2     Init:0\/1            0          71s\nopenebs-etcd-0                                    0\/1     Pending             0          71s\nopenebs-etcd-1                                    0\/1     Pending             0          71s\nopenebs-etcd-2                                    0\/1     Pending             0          71s\nopenebs-localpv-provisioner-7cd9f85f8f-5vnvp      1\/1     Running             0          71s\nopenebs-loki-0                                    0\/1     Pending             0          71s\nopenebs-lvm-localpv-controller-64946b785c-dnvh4   0\/5     ContainerCreating   0          71s\nopenebs-lvm-localpv-node-42n8f                    0\/2     ContainerCreating   0          71s\nopenebs-lvm-localpv-node-h47r8                    0\/2     ContainerCreating   0          71s\nopenebs-lvm-localpv-node-ndgwk                    2\/2     Running             0          71s\nopenebs-nats-0                                    0\/3     ContainerCreating   0          71s\nopenebs-nats-1                                    0\/3     ContainerCreating   0          71s\nopenebs-nats-2                                    0\/3     ContainerCreating   0          71s\nopenebs-obs-callhome-5b7fdb675-8f85b              0\/2     ContainerCreating   0          71s\nopenebs-operator-diskpool-794596c9b7-jtg5t        0\/1     Init:0\/2            0          71s\nopenebs-promtail-2mfgt                            1\/1     Running             0          71s\nopenebs-promtail-8np7q                            0\/1     ContainerCreating   0          71s\nopenebs-promtail-lv4ht                            1\/1     Running             0          71s\nopenebs-zfs-localpv-controller-7fdcd7f65-mnnhf    0\/5     ContainerCreating   0          71s\nopenebs-zfs-localpv-node-6pd4v                    2\/2     Running             0          71s\nopenebs-zfs-localpv-node-c5vld                    0\/2     ContainerCreating   0          71s\nopenebs-zfs-localpv-node-kqxrg                    0\/2     ContainerCreating   0          71s\n<\/pre><\/div>\n\n\n<p>After a while, you should see the following state:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get pods -n openebs -l role=openebs-lvm\nNAME                                              READY   STATUS    RESTARTS   AGE\nopenebs-lvm-localpv-controller-64946b785c-dnvh4   5\/5     Running   0          12m\nopenebs-lvm-localpv-node-42n8f                    2\/2     Running   0          12m\nopenebs-lvm-localpv-node-h47r8                    2\/2     Running   0          12m\nopenebs-lvm-localpv-node-ndgwk                    2\/2     Running   0          12m\n<\/pre><\/div>\n\n\n<p>Now we are ready to create the <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/storage\/storage-classes\/\" target=\"_blank\" rel=\"noreferrer noopener\">storage class<\/a>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We want the storage class to be named &#8220;openebs-lvmpv&#8221;<\/li>\n\n\n\n<li>We want to allow volume expansion<\/li>\n\n\n\n<li>We reference the volume group we&#8217;ve created above<\/li>\n\n\n\n<li>We want ext4 as the file system<\/li>\n\n\n\n<li>We restrict this to our worker nodes<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,20,22]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ cat sc.yaml \napiVersion: storage.k8s.io\/v1\nkind: StorageClass\nmetadata:\n  name: openebs-lvmpv\nallowVolumeExpansion: true\nparameters:\n  storage: &quot;lvm&quot;\n  volgroup: &quot;vgopenebs&quot;\n  fsType: &quot;ext4&quot;\nprovisioner: local.csi.openebs.io\nallowedTopologies:\n- matchLabelExpressions:\n  - key: kubernetes.io\/hostname\n    values:\n      - k8s2.it.dbi-services.com\n      - k8s3.it.dbi-services.com\n      - k8s4.it.dbi-services.com\n\nk8s@k8s1:~$ kubectl apply -f sc.yaml \nstorageclass.storage.k8s.io\/openebs-lvmpv created\nk8s@k8s1:~$ kubectl get sc\nNAME                     PROVISIONER               RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE\nmayastor-etcd-localpv    openebs.io\/local          Delete          WaitForFirstConsumer   false                  21m\nmayastor-loki-localpv    openebs.io\/local          Delete          WaitForFirstConsumer   false                  21m\nopenebs-hostpath         openebs.io\/local          Delete          WaitForFirstConsumer   false                  21m\nopenebs-lvmpv            local.csi.openebs.io      Delete          Immediate              true                   22s\nopenebs-single-replica   io.openebs.csi-mayastor   Delete          Immediate              true                   21m\n<\/pre><\/div>\n\n\n<p>Once this is ready we need to modify our cluster definition to use the new storage class by adding a PVC template:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\napiVersion: postgresql.cnpg.io\/v1\nkind: Cluster\nmetadata:\n  name: my-pg-cluster\nspec:\n  instances: 3\n \n  bootstrap:\n    initdb:\n      database: db1\n      owner: db1\n      dataChecksums: true\n      walSegmentSize: 32\n      localeCollate: &#039;en_US.utf8&#039;\n      localeCType: &#039;en_US.utf8&#039;\n      postInitSQL:\n      - create user db2\n      - create database db2 with owner = db2\n  storage:\n    pvcTemplate:\n      accessModes:\n        - ReadWriteOnce\n      resources:\n        requests:\n          storage: 1Gi\n      storageClassName: openebs-lvmpv\n      volumeMode: Filesystem\n<\/pre><\/div>\n\n\n<p>As usual deploy the cluster and wait until the pods are up and running:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,3]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl apply -f pg.yaml \ncluster.postgresql.cnpg.io\/my-pg-cluster created\nk8s@k8s1:~$ kubectl get pods \nNAME              READY   STATUS    RESTARTS   AGE\nmy-pg-cluster-1   1\/1     Running   0          2m55s\nmy-pg-cluster-2   1\/1     Running   0          111s\nmy-pg-cluster-3   1\/1     Running   0          52s\n<\/pre><\/div>\n\n\n<p>If you go to one of the worker nodes, you can see the mount and it&#8217;s content:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,3,5]; title: ; notranslate\" title=\"\">\nroot@k8s2:\/home\/k8s$ df -h | grep ebs\n\/dev\/mapper\/vgopenebs-pvc--2bcc48bc--4600--4c6a--a13f--6dfc1e9ea081  974M  230M  728M  24% \/var\/lib\/kubelet\/pods\/5b9441b5-039e-4a75-8865-0ccd053f08fc\/volumes\/kubernetes.io~csi\/pvc-2bcc48bc-4600-4c6a-a13f-6dfc1e9ea081\/mount\nroot@k8s2:\/home\/k8s$ ls \/var\/lib\/kubelet\/pods\/5b9441b5-039e-4a75-8865-0ccd053f08fc\/volumes\/kubernetes.io~csi\/pvc-2bcc48bc-4600-4c6a-a13f-6dfc1e9ea081\/mount\nlost+found  pgdata\nroot@k8s2:\/home\/k8s$ ls \/var\/lib\/kubelet\/pods\/5b9441b5-039e-4a75-8865-0ccd053f08fc\/volumes\/kubernetes.io~csi\/pvc-2bcc48bc-4600-4c6a-a13f-6dfc1e9ea081\/mount\/pgdata\/\nbase              global         pg_dynshmem    pg_logical    pg_replslot   pg_stat      pg_tblspc    pg_wal                postgresql.conf\ncurrent_logfiles  override.conf  pg_hba.conf    pg_multixact  pg_serial     pg_stat_tmp  pg_twophase  pg_xact               postmaster.opts\ncustom.conf       pg_commit_ts   pg_ident.conf  pg_notify     pg_snapshots  pg_subtrans  PG_VERSION   postgresql.auto.conf  postmaster.pid\n<\/pre><\/div>\n\n\n<p>As mentioned initially: The storage part is critical and you need to carefully select what you want to use and really test it. This will be the topic for the next post.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the next post in the series about CloudNativePG (the previous one are here, here, here, here, here and here). In this post we&#8217;ll look at storage, and if you ask me, this is the most important topic when it comes to deploying PostgreSQL on Kubernetes. In the past we&#8217;ve seen a lot of [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[955,229,198,1320],"tags":[77],"type_dbi":[],"class_list":["post-33670","post","type-post","status-publish","format-standard","hentry","category-cloud","category-database-administration-monitoring","category-database-management","category-devops","tag-postgresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>CloudNativePG \u2013 Storage - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CloudNativePG \u2013 Storage\" \/>\n<meta property=\"og:description\" content=\"This is the next post in the series about CloudNativePG (the previous one are here, here, here, here, here and here). In this post we&#8217;ll look at storage, and if you ask me, this is the most important topic when it comes to deploying PostgreSQL on Kubernetes. In the past we&#8217;ve seen a lot of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-05T12:20:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-05T12:20:31+00:00\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"CloudNativePG \u2013 Storage\",\"datePublished\":\"2024-07-05T12:20:28+00:00\",\"dateModified\":\"2024-07-05T12:20:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/\"},\"wordCount\":646,\"commentCount\":0,\"keywords\":[\"PostgreSQL\"],\"articleSection\":[\"Cloud\",\"Database Administration &amp; Monitoring\",\"Database management\",\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/\",\"name\":\"CloudNativePG \u2013 Storage - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-07-05T12:20:28+00:00\",\"dateModified\":\"2024-07-05T12:20:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-storage\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CloudNativePG \u2013 Storage\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\\\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/westermanndanie\"],\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/daniel-westermann\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"CloudNativePG \u2013 Storage - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/","og_locale":"en_US","og_type":"article","og_title":"CloudNativePG \u2013 Storage","og_description":"This is the next post in the series about CloudNativePG (the previous one are here, here, here, here, here and here). In this post we&#8217;ll look at storage, and if you ask me, this is the most important topic when it comes to deploying PostgreSQL on Kubernetes. In the past we&#8217;ve seen a lot of [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/","og_site_name":"dbi Blog","article_published_time":"2024-07-05T12:20:28+00:00","article_modified_time":"2024-07-05T12:20:31+00:00","author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"CloudNativePG \u2013 Storage","datePublished":"2024-07-05T12:20:28+00:00","dateModified":"2024-07-05T12:20:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/"},"wordCount":646,"commentCount":0,"keywords":["PostgreSQL"],"articleSection":["Cloud","Database Administration &amp; Monitoring","Database management","DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/","url":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/","name":"CloudNativePG \u2013 Storage - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2024-07-05T12:20:28+00:00","dateModified":"2024-07-05T12:20:31+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CloudNativePG \u2013 Storage"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=33670"}],"version-history":[{"count":22,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33670\/revisions"}],"predecessor-version":[{"id":33855,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33670\/revisions\/33855"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=33670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=33670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=33670"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=33670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}