In kubernetes, if a pod go down for some reason, the admission controller will restart it.
We call this mecanism self healing.
I have never worked with docker-compose, but I wonder : is it the same ?
When deployed with docker-compose
or now docker compose
(with a space) you are deploying to a single node. You can define the service to automatically restart with a restart policy that handles a crashing application. However, there are a few scenarios where externalities like the network or volumes are not in a good state which I've seen cause the definition to be considered invalid by docker at which point it stops attempting to restart the service.
There's also Swarm Mode which is an orchestrator like Kubernetes, it can use the docker-compose.yml
to define the target state, and it will continue to restart services to recover from an outage, and migrate them to another node when a node in the cluster goes down.