Defining a Pod’s Readiness and Liveness Probe
- Create a new Pod named
hello
with the imagebonomat/nodejs-hello-world
that exposes the port3000
. Provide the namenodejs-port
for the container port. - Add a
Readiness Probe
that checks the URL path/
on the port referenced with the namenodejs-port
after a 2 seconds delay. You do not have to define the period interval. - Add a
Liveness Probe
that 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 container. Write down the output.
答案:
Create the intial YAML with the following c