Hi everyone, I need help with few issues.
1. I tried to create a postgresql container as a deployment workload in Rancher Desktop following this article https://www.hanaburtin.net/archives/83 without the NFS replication. Then created databases and users related to an application, and the application was running fine. But when I restart Rancher, the entire postgresql is truncated as a new one. The created databases and users are lost.
2. While restarting Rancher, is there any way to create an order in which the containers should start running? For deploying a micro-services application, the services must be started in certain order. The database container must be in ready state for the other services to start. So is there any way to ensure that.
3. When restarting Rancher, the IP Address of existing containers is getting changed sometimes. Is there any way to fix that? We've checked that Cluster IP doesn't change after restarting, but not sure if that's the correct way of referring containers.
If anyone has faced and solved these issues, please share the references to follow.
09/13/2022, 9:26 AM
If you are not storing volumes on NFS or any other kind of persistent storage, then it's not surprising that the database is empty when the pod is re-created.
I don't believe there is a tool to order pod startups (well, the StatefulSet controller kinda does, but only for pods managed by itself). Instead, pods are expected to implement liveness/readiness probes and retry (or get terminated) until the database is available.