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

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • 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

  • Posts: 11

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

  • Posts: 2,443

    Hi @zite,

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

    Regards,
    -Chris

  • 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

  • Posts: 11

    Ok, I managed to get the logs

  • Posts: 1

    This is what I did.

    1. ubuntu@cp:~/LFD259/MY_SOLUTIONS/s_03$ kubectl get pods -o wide
    2. NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
    3. break2-7df45c9687-5g7sm 2/2 Running 0 12m 10.0.1.115 worker <none> <none>
    4. nginx-7b8bd4f85d-fg6f7 1/1 Running 1 (90m ago) 100m 10.0.1.35 worker <none> <none>
    5. registry-8596585bb9-nvqc4 1/1 Running 1 (90m ago) 100m 10.0.1.15 worker <none> <none>

    curl my pod a few times

    1. curl 10.0.1.115
    1. ubuntu@cp:~/LFD259/MY_SOLUTIONS/s_03$ kubectl logs break2-7df45c9687-5g7sm
    2. Defaulted container "brokenapp" out of: brokenapp, goproxy
    3. /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
    4. /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
    5. /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
    6. 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
    7. 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
    8. /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
    9. /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
    10. /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
    11. /docker-entrypoint.sh: Configuration complete; ready for start up
    12. 2025/04/16 14:28:10 [notice] 1#1: using the "epoll" event method
    13. 2025/04/16 14:28:10 [notice] 1#1: nginx/1.27.4
    14. 2025/04/16 14:28:10 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)
    15. 2025/04/16 14:28:10 [notice] 1#1: OS: Linux 6.8.0-1026-aws
    16. 2025/04/16 14:28:10 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
    17. 2025/04/16 14:28:10 [notice] 1#1: start worker processes
    18. 2025/04/16 14:28:10 [notice] 1#1: start worker process 30
    19. 2025/04/16 14:28:10 [notice] 1#1: start worker process 31
    20. 10.0.0.219 - - [16/Apr/2025:14:29:55 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"
    21. 10.0.0.219 - - [16/Apr/2025:14:35:05 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"
    22. 10.0.0.219 - - [16/Apr/2025:14:35:06 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"
    23. 10.0.0.219 - - [16/Apr/2025:14:35:06 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"
    24. 10.0.0.219 - - [16/Apr/2025:14:39:11 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"
    25. 10.0.0.219 - - [16/Apr/2025:14:39:11 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"
    26. 10.0.0.219 - - [16/Apr/2025:14:39:12 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/8.5.0" "-"

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training