Welcome to the Linux Foundation Forum!

Lab 7.2 - curl -H "Host: www.example.com" http://<ip address> fails with 404

Posts: 17
edited January 2022 in LFD259 Class Forum

I'm lost on step 19 - "Now pass a matching header and you should see the default web server page.
student@cp: ̃/ingress-nginx$ curl -H "Host: www.example.com" http://10.104.227.7"

I've read: https://forum.linuxfoundation.org/discussion/856881/lab-7-2-ingress-controller-service-available-via-internal-ip-not-via-ingress

and https://forum.linuxfoundation.org/discussion/856881/lab-7-2-ingress-controller-service-available-via-internal-ip-not-via-ingress

What I see is a failing pod
kubectl get pods | grep ingress
myingress-ingress-nginx-controller-q2bms 1/2 CrashLoopBackOff 15 (113s ago) 40m
myingress-ingress-nginx-controller-zjfl8 1/1 Running 0 131m

Describing the pod
kubectl describe pod myingress-ingress-nginx-controller-q2bms

Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 20m default-scheduler Successfully assigned default/myingress-ingress-nginx-controller-q2bms to cp
Normal Pulled 20m kubelet Container image "cr.l5d.io/linkerd/proxy-init:v1.4.0" already present on machine
Normal Created 20m kubelet Created container linkerd-init
Normal Started 20m kubelet Started container linkerd-init
Normal Pulled 20m kubelet Container image "cr.l5d.io/linkerd/proxy:stable-2.11.1" already present on machine
Normal Created 20m kubelet Created container linkerd-proxy
Normal Started 20m kubelet Started container linkerd-proxy
Warning FailedPreStopHook 19m kubelet Exec lifecycle hook ([/wait-shutdown]) for Container "controller" in Pod "myingress-ingress-nginx-controller-q2bms_default(0ed1e50d-19c8-4eee-8082-f7a3230b80a8)" failed - error: command '/wait-shutdown' exited with 137: , message: ""
Normal Created 19m (x2 over 20m) kubelet Created container controller
Normal Started 19m (x2 over 20m) kubelet Started container controller
Warning Unhealthy 19m (x6 over 20m) kubelet Readiness probe failed: HTTP probe failed with statuscode: 502
Normal Killing 19m kubelet Container controller failed liveness probe, will be restarted
Warning Unhealthy 15m (x30 over 20m) kubelet Liveness probe failed: HTTP probe failed with statuscode: 502
Normal Pulled 10m (x8 over 20m) kubelet Container image "k8s.gcr.io/ingress-nginx/controller:v1.1.1@sha256:0bc88eb15f9e7f84e8e56c14fa5735aaa488b840983f87bd79b1054190e660de" already present on machine
Warning BackOff 20s (x57 over 15m) kubelet Back-off restarting failed container

POD
ClusterIP for second app - works
curl -H "Host: www.example.com" http://10.98.39.102

ENDPOINT
kubectl get endpoints
NAME ENDPOINTS AGE
kubernetes 10.128.0.6:6443 56d
myingress-ingress-nginx-controller 192.168.171.106:443,192.168.171.106:80 123m
myingress-ingress-nginx-controller-admission 192.168.171.106:8443 123m
nginx 192.168.171.108:443 48d
registry 192.168.171.107:5000 48d
secondapp 192.168.171.86:80 166m

curl -H "Host: www.example.com" http://192.168.171.106

404 Not Found

404 Not Found


nginx


My external IP addresses are in the 34.x.x.x and 35.x.x.x range.
... so I think I am not overlapping... if I am I have zero idea of how that came to be or how to fix it.

External Works
curl -H "Host: www.example.com" http:// control plane ip address:32000
curl -H "Host: www.example.com" http:// worker ip address:32000

INGRESS
kubectl get svc | grep ingress
myingress-ingress-nginx-controller LoadBalancer 10.111.207.48 80:32465/TCP,443:30635/TCP 116m

curl -H "Host: www.example.com" http://10.111.207.48:32000
Hangs

curl -H "Host: www.example.com" http://10.111.207.48

404 Not Found

404 Not Found


nginx


Answers

  • Uninstalled linkerd
    Uninstalled ingress-nginx

    re-ran all the commands. Discovered that I have failed to change the stable version to 2.10....

    got past the issues of yesterday. Though, I am not convinced I discovered the error.

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