On Wed, Jan 5, 2022 at 9:50 AM dulhaver via Postgres Operator <postgres...@crunchydata.com> wrote:
I am playing with the postgres-operator on a tanzu cluster.
After getting the initial setup running I try to get the simple postgres cluster from the examples working.
The command goes trough without any issue but the pods never come to live. I suspect storage which is not found to be the culprit.
In order to understand where things go wrong I guess looking at the postgres.yaml is the way to solve this. However (with yet very basic understanding of kubernetes in general and storage in particular) I can't draw much from this. What I would expect is to have some sort of reference to a storage class (which needs to exists prior spinning up the cluster in that file). Consequence of that would be to have to edit that file in order to adopt to my local scenario (where I have one default storageClass available).
The only hints I can see are a dataVolumeClaimSpec (L 10) and a volumeClaimSpec (L 22) but I can not make out any reference to any local storageClass or persistentVolume Component. Can anybody kindly shed some light on this? I am interested in a practical solution as well as the general understanding of how this works.
First, if you have not done so already, I would recommend picking up a copy of the book "Kubernetes in Action" by Marko Lukša. I don't believe the 2nd edition is fully published yet, but the 1st edition contains many foundational principles of Kubernetes as well as techniques for troubleshooting the happenings on a Kubernetes cluster. (I don't know Marko personally nor am I getting a commission on this recommendation).
Next, if you are not already doing so, I suggest walking through the PGO v5 tutorial (https://access.crunchydata.com/documentation/postgres-operator/v5/tutorial/); parts of the tutorial contain hints on why certain actions may not work and have resolutions.
PGO combines a bunch of fundamental Kubernetes objects, so knowing where to troubleshoot can be tricky at times. It helps to first look at the logs in the "postgres-operator" Pod to see if there are any errors directly related to that. If there is an issue with storage, the Operator itself may detect and report it. Errors around storage may also propagate on the PVC objects; you can use "kubectl describe pvc" to inspect those.