I’m trying to deploy Postgres with a PersistentVolumeClaim in GKE. As per the description here (look at PGDATA), it is recommended to create a subdirectory if mounting an external volume. So, this is what I did with my PG deployment: spec: containers: – name: postgres-dev image: “postgres:12.1” imagePullPolicy: IfNotPresent ports: – containerPort: 5432 env: – […]
Categories
Postgres mount volume error in k8s
- Post author By Server Questions
- Post date May 23, 2020
- No Comments on Postgres mount volume error in k8s
- Tags and I get the following events: Events: Type Reason Age From, and then it complains about it. The PVC was created just right before the deployment, as recommented for initdb, but the effect is the same. Another interesting point is that when I set this up in minikube, everything works fine. How do I approach this?, gke-cluster-pool-1-4ce1e4d6-m33c Back-off restarting failed container These are the logs from the Postgres container: initdb: e, gke-cluster-pool-1-4ce1e4d6-m33c Container image "postgres:12.1" already present on machine Normal Created 9s, gke-cluster-pool-1-4ce1e4d6-m33c Created container postgres-dev Normal Started 9s (x2 over 10s) kubelet, gke-cluster-pool-1-4ce1e4d6-m33c Started container postgres-dev Warning BackOff 7s (x2 over 8s) kubelet, I create the subdir for mountpoint, I'm trying to deploy Postgres with a PersistentVolumeClaim in GKE. As per the description here (look at PGDATA), it is recommended to create a subdirectory if mounting an external volume. So, it stalls at Back-off error, perhaps due to it being a mount point. Using a mount point directly as the data directory is not recommended. Create a subdirectory under the, so there is no data in it. I tried with completely new, this is what I did with my PG deployment: spec: containers: - name: postgres-dev image: "postgres:12.1" imagePullPolicy: I, un-existent dir like /var/lib/postgres/data as well, which would be the original mount point for Postgres' data. But when I try to deploy the Postgres pod