Defining a Pod’s Readiness and Liveness Probe
- Create a new Pod named
hellowith the imagebonomat/nodejs-hello-worldthat exposes the port3000. Provide the namenodejs-portfor the container port. - Add a
Readiness Probethat checks the URL path/on the port referenced with the namenodejs-portafter a 2 seconds delay. You do not have to define the period interval. - Add a
Liveness Probethat verifies that the app is up and running every 8 seconds by checking the URL path / on the port referenced with the namenodejs-port. The probe should start with a 5 seconds delay. - Shell into container and curl
localhost:3000. Write down the output. Exit the container. Retrieve the logs from the

本文通过创建一个Pod并配置Readiness和Liveness Probe来演示如何检查应用的运行状态。首先定义了一个使用nginx镜像的Pod,设置延迟2秒的Readiness Probe检查路径`/health`,以及每8秒检查一次路径`/`的Liveness Probe。然后,通过shell进入容器执行curl命令,并查看及修复Pod的配置问题,确保应用正常运行。
4000

被折叠的 条评论
为什么被折叠?



