Service loses connection to Etcd DB when pod restarts Service loses connection to Etcd DB when pod restarts kubernetes kubernetes

Service loses connection to Etcd DB when pod restarts


Keeping application and database in one pod is one of the worst practices in Kubernetes. If you update application code - you have to restart pod to apply changes. So you restart database also just for nothing.

Solution is very simple - you should run application in one deployment and database - in another. That way you can update application without restarting database. In that case you can also scale app and DB separately, like add more replicas to app while keeping DB at 1 replicas or vice versa.