I'm new to docker and I'm reading a book which says:
Docker can't safely replaced an unhealthy container. Docker could remove that container and start a new one from the same setup, but maybe your app writes data inside the container, so that would mean downtime and a loss of data. Docker can’t be sure that taking action to fix the unhealthy container won’t make the situation worse, so it broadcasts that the container is unhealthy but leaves it running
I'm a little bit confused here, container orchestration tool like Kubernetes can replace unhealthy container with new container, so in this case, there will be a loss of data, because the old container hasn't finished writting, isn't it? obviously the new container can't take over the writing job from the old container, a loss of data issue still happen.