Docker container and kubernetes daily inspection

 [Guide] This article sorts out the daily inspection work of containers and kubernetes container clouds. It is hoped that through third-party open source tools and log inspection methods, it will provide troubleshooting methods, troubleshooting ideas, and typical cases to help you learn to find problems as soon as possible and troubleshoot problem, solve problem.

1 Docker container daily inspection

Check by:

1.1 docker/podman ps view container status

Docker/podman ps -a View container status STATUS:

Exited(0): Indicates that the container exited normally

Exited (other numbers): The container exited abnormally, you need to check the reason through the log

Up: The container is running

Up(Paused): The container is paused

Up(healthy): The container monitors health

Up(unhealthy): The container listens for exceptions

1.2 Health Check—HealthCheck

Some parameters need to be supported by docker 17.05 or above

1.2.1 Add health check via docker run or dockerfile

For example:

docker run --name=nginx --health-cmd="curl --silent --fail localhost/ || exit 1" --health-inter-val=30s --health-retries=3 --health-timeout=10s --start-period

Guess you like

Origin blog.csdn.net/weixin_57147647/article/details/131201877