Welcome to the Linux Foundation Forum!

Lab 3.4. Domain Review

Hi, i am new to kubernetes and trying to get a hang of it. Not sure what is really expected from this exercise (Lab 3.4. Domain Review):

  1. Use the build-review1.yaml file to create a non-working deployment. Fix the deployment such that both containers are running and in a READY state. The web server listens on port 80, and the proxy listens on port 8080.
  2. View the default page of the web server. When successful verify theGETactivity logs in the container log. The messageshould look something like the following. Your time and IP may be different.
  3. 192.168.124.0 - - [30/Jan/2020:03:30:31 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.58.0" "-"

I am able to make both the pods running and ready by just changing the port to 8080 under the liveness and readiness probes as mentioned in build-review1.yaml file. Also i added port section for nginx container on 80 as mentioned above.

But in logs for both the containers i don't see the below line (its empty logs)
192.168.124.0 - - [30/Jan/2020:03:30:31 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.58.0" "-"

not sure what is expected from this exercise? I understand ip will be different but i don't see anything for both container logs.

Thanks
Rishu

Comments

  • serewicz
    serewicz Posts: 1,000

    Hello,

    Keep viewing the default page of the web server. Are you able to see the default nginx welcome page? Once you can see this, do you see a entry in the log showing the GET?

    Regards,

    Tim

  • Hi Tim, the missing part was i didn't try to curl to the nginx server and was checking the logs directly. i did curl -vk http://&lt;>:<> from the master node and after this i can see the logs getting updated..
    thanks
    Rishu

  • where did you see the logs? @Rishu1977 All i saw the html for the nginx

  • Hi @ashdev,

    You can revisit "Chapter 3 - Build" for an example on how to display container logs.

    Regards,
    -Chris

  • zite
    zite Posts: 11

    Hi, I keep reading "chapter 3 - Build" but couldnt find how to display and configure logs...

  • chrispokorni
    chrispokorni Posts: 2,376

    Hi @zite,

    You can find kubectl logs command usage examples on the Testing page in Chapter 3.

    Regards,
    -Chris

  • zite
    zite Posts: 11

    Hi, sorry if I'm wrong, but using LFD259-labs_V2023-05-31.pdf document, and cannot find 'kubectl logs' command on chapter 3. I can see the first occurrence of this command on chapter 5

  • zite
    zite Posts: 11

    Ok, I managed to get the logs

Categories

Upcoming Training