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,443

    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

  • jherng
    jherng Posts: 1

    This is what I did.

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

    curl my pod a few times

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

Categories

Upcoming Training