Welcome to the Linux Foundation Forum!

lab 3.4 - why?

How do we get that log output on step 4? When I do curl, all i get is the html/default page of the web server. Also what is the point of making sure the web server listens on port 80? I put
ports:
containerPort: 80
in the yaml file but it did not make a diference. The html page shows whether or not this is there.

Comments

  • Hi @ashdev,

    If you revisit "Chapter 3 - Build", you will find an example of how to display the logs of a container running in a pod.

    Also, revisit the probes and understand their role in monitoring containers' health. What is the expected behavior of a healthy webserver container, with respect to its port(s)? What about an unhealthy webserver container?

    Regards,
    -Chris

  • ashdev
    ashdev Posts: 15
    edited September 2020

    @chrispokorni the closest I could find to the logging was number 6 and 7 on this file:
    https://lms.quickstart.com/x/LAB_3.2.pdf
    But wont that mean I have to start configuring a docker compose?

  • serewicz
    serewicz Posts: 1,000

    Hello,

    In on the page 03. Build -> Build -> Testing , do you find any commands that would show the logs of the container?

    When you use that command after viewing the default page of an pod running nginx, do you see an entry similar to

    10.128.0.47 - - [03/Sep/2020:19:50:38 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.58.0" "-"

    Regards,

  • @serewicz I have done it! Thank you so much. But can you expand on how we are supposed to make sure the web server listens on port 80? I don't get that part because the html file of the server is given to us whether there is a port specified in the yaml file or not. What was the point of that instruction?

  • serewicz
    serewicz Posts: 1,000

    Hello,

    Indeed any container listening on 0.0.0.0 would see the http request on port 80. Some of the reason is historical, where it was a requirement, and now is more informational. Here is the API spec:

    Container Port

    Could there be other reasons to know and add this information, sure. For example if you add targetPort you can could change the port the traffic is sent to.

    Regards,

Categories

Upcoming Training