11.2 Ingress Controller Lab Issue - Bug Found

Hi guys !
I hit what I believe is a documentation bug on LAB 11.2.
It was a good thing as I learned a lot more stuff troubleshooting (maybe this bug is there for that reason )
I followed all the steps an the Ingress was not working so I could not access the nginx by curling the ClusterIP of the service and by adding the Host header to curl like in the doc:
curl -H "Host: www.external.com" http://10.102.167.117
1 - Root cause:
The ingress.yaml file does not contain the default class for Ingress on the definition.
LOGS from Ingress Controller:
[email protected]:~$ kubectl logs myingress-ingress-nginx-controller-cqbt5 -v3 ------------------------------------------------------------------------------- NGINX Ingress controller Release: v1.0.2 Build: 2b8ed4511af75a7c41e52726b0644d600fc7961b Repository: https://github.com/kubernetes/ingress-nginx nginx version: nginx/1.19.9 ------------------------------------------------------------------------------- W0928 10:33:48.752897 7 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work. I0928 10:33:48.753025 7 main.go:221] "Creating API client" host="https://10.96.0.1:443" I0928 10:33:48.760687 7 main.go:265] "Running in Kubernetes cluster" major="1" minor="21" git="v1.21.1" state="clean" commit="5e58841cce77d4bc13713ad2b91fa0d961e69192" platform="linux/amd64" I0928 10:33:49.212817 7 main.go:104] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem" I0928 10:33:49.230844 7 ssl.go:531] "loading tls certificate" path="/usr/local/certificates/cert" key="/usr/local/certificates/key" I0928 10:33:49.256887 7 nginx.go:253] "Starting NGINX Ingress controller" I0928 10:33:49.269543 7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"default", Name:"myingress-ingress-nginx-controller", UID:"11845428-96da-4338-a23f-99a916f3fc04", APIVersion:"v1", ResourceVersion:"3434117", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap default/myingress-ingress-nginx-controller I0928 10:33:50.458770 7 nginx.go:295] "Starting NGINX process" I0928 10:33:50.458840 7 leaderelection.go:243] attempting to acquire leader lease default/ingress-controller-leader... I0928 10:33:50.459073 7 nginx.go:315] "Starting validation webhook" address=":8443" certPath="/usr/local/certificates/cert" keyPath="/usr/local/certificates/key" I0928 10:33:50.459341 7 controller.go:152] "Configuration changes detected, backend reload required" I0928 10:33:50.464504 7 status.go:84] "New leader elected" identity="ingress-nginx-controller-748d8ff6c7-stgsn" I0928 10:33:50.518415 7 controller.go:169] "Backend successfully reloaded" I0928 10:33:50.518462 7 controller.go:180] "Initial sync, sleeping for 1 second" I0928 10:33:50.518568 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"default", Name:"myingress-ingress-nginx-controller-cqbt5", UID:"45b03c4c-26d3-4246-955b-396d21ec1dfe", APIVersion:"v1", ResourceVersion:"3434201", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration I0928 10:34:25.927925 7 leaderelection.go:253] successfully acquired lease default/ingress-controller-leader I0928 10:34:25.928006 7 status.go:84] "New leader elected" identity="myingress-ingress-nginx-controller-cqbt5" I0928 10:37:32.933703 7 main.go:101] "successfully validated configuration, accepting" ingress="ingress-test/default" I0928 10:37:32.938381 7 store.go:361] "Ignoring ingress because of error while validating ingress class" ingress="default/ingress-test" error="ingress does not contain a valid IngressClass" I0928 11:00:45.760557 7 store.go:336] "Ignoring ingress because of error while validating ingress class" ingress="default/ingress-test" error="ingress does not contain a valid IngressClass" I0928 11:06:34.098285 7 store.go:435] "ignoring ingressclass as the spec.controller is not the same of this ingress" ingressclass="external-lb" I0928 11:06:44.600291 7 store.go:361] "Ignoring ingress because of error while validating ingress class" ingress="default/ingress-test" error="ingress does not contain a valid IngressClass" I0928 11:08:50.621894 7 store.go:336] "Ignoring ingress because of error while validating ingress class" ingress="default/ingress-test" error="ingress does not contain a valid IngressClass" I0928 11:09:01.521031 7 store.go:361] "Ignoring ingress because of error while validating ingress class" ingress="default/ingress-test" error="no object matching key \"external-lb\" in local store" I0928 11:12:46.121788 7 store.go:336] "Ignoring ingress because of error while validating ingress class" ingress="default/ingress-test" error="no object matching key \"external-lb\" in local store" I0928 11:16:56.358722 7 store.go:452] "ignoring ingressclass as the spec.controller is not the same of this ingress" ingressclass="external-lb" I0928 11:17:38.810403 7 store.go:365] "Found valid IngressClass" ingress="default/ingress-test" ingressclass="nginx" I0928 11:17:38.810552 7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"default", Name:"ingress-test", UID:"1e442104-5e27-4dc9-8e51-d9d4ab0bef95", APIVersion:"networking.k8s.io/v1", ResourceVersion:"3438329", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync I0928 11:17:38.810867 7 controller.go:152] "Configuration changes detected, backend reload required" I0928 11:17:38.890003 7 controller.go:169] "Backend successfully reloaded" I0928 11:17:38.890337 7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"default", Name:"myingress-ingress-nginx-controller-cqbt5", UID:"45b03c4c-26d3-4246-955b-396d21ec1dfe", APIVersion:"v1", ResourceVersion:"3434201", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration 192.168.89.0 - - [28/Sep/2021:11:18:27 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.58.0" 80 0.000 [default-web-one-80] [] 192.168.89.36:80 615 0.000 200 8b2e251094e3504862db879039d270e5 [email protected]:~$
If I list the default ingress classes:
[email protected]:~$ kubectl get ingressclasses.networking.k8s.io nginx NAME CONTROLLER PARAMETERS AGE nginx k8s.io/ingress-nginx <none> 95m [email protected]:~$
2 - Resolution
Add the default class to the ingress.yaml file
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-test namespace: default spec: ingressClassName: nginx rules: - host: www.external.com http: paths: - backend: service: name: web-one port: number: 80 path: / pathType: ImplementationSpecific status: loadBalancer: {}
3 - Verification
[email protected]:~$ curl -H "Host: www.external.com" http://10.102.167.117 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p> <p><em>Thank you for using nginx.</em></p> </body> </html>
Comments
-
Hi @melchior,
Thank you for your post. The ingress class annotation has also been addressed in this forum post:
Lab 11.2 Ingress Controller - connection refused on public ip address
Regards,
-Chris1 -
Thanks ! I did not realize this issue had been addressed on another post !
1 -
I also had to add
spec:
ingressClassName: nginx1 -
Another bug found another freaking hours lost on this course.
Don't use the latest linkerd from the course.
Use specifically: https://github.com/linkerd/linkerd2/releases/tag/stable-2.10.0
works with ingress-nginx Chart 4.0.13
If you use the latest you won't be able to create the ingress controller daemonset with the linkerd injected settings. it will stay stuck at pending. with errors
[ 0.400754s] INFO ThreadId(01) outbound: linkerd_app_core::serve: Connection closed error=ingress-mode routing is HTTP-only
[ 1.402211s] INFO ThreadId(01) outbound: linkerd_app_core::serve: Connection closed error=ingress-mode routing is HTTP-only
[ 2.403196s] INFO ThreadId(01) outbound: linkerd_app_core::serve: Connection closed error=ingress-mode routing is HTTP-only
[ 3.404067s] INFO ThreadId(01) outbound: linkerd_app_core::serve: Connection closed error=ingress-mode routing is HTTP-onlygoogling on the error lead to a link in this forum:
so this is a duplicate. i hope to spare you some time. if you met above issue (missing annotation setting in course) as well, like me.
1 -
The whole LF Kubernets Fundamentals is essentially a garbage training full of faults and bugs. Unfortunately I found out that too late to get the refund.
0 -
Why is this not updated in the actual course material? Not a big issue for me, but my colleagues who have less K8s experience will lose a lot of time with this.
0 -
Just wanted to say that I encountered the same issue just now with Lab 11.2, which took me a while Googling and reading through the Ingress docs to realize that adding
ingressClassName: nginx
solved the issue. It would be great to see the lab material updated ASAP to resolve the issue, thanks!P.S. Not related to the issue, but so far, I found the course educational and definitely a lot more in depth compared to the average online Kubernetes tutorial, also much easier to get started with than just reading the official docs. But it definitely does require a good understanding of Linux administration and networking to begin with, one which simply going through LFS101x and LFS158x does not suffice. I would suggest mentioning at the start of the course additional prerequisites such as LFS201 and possibly even LFS211, thanks!
0
Categories
- 9.7K All Categories
- 21 LFX Mentorship
- 74 LFX Mentorship: Linux Kernel
- 437 Linux Foundation Boot Camps
- 259 Cloud Engineer Boot Camp
- 87 Advanced Cloud Engineer Boot Camp
- 40 DevOps Engineer Boot Camp
- 18 Cloud Native Developer Boot Camp
- Express Training Courses
- Express Courses - Discussion Forum
- 1.5K Training Courses
- 17 LFC110 Class Forum
- 3 LFC131 Class Forum
- 18 LFD102 Class Forum
- 113 LFD103 Class Forum
- 8 LFD121 Class Forum
- 59 LFD201 Class Forum
- 1 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum
- 23 LFD254 Class Forum
- 526 LFD259 Class Forum
- 99 LFD272 Class Forum
- 1 LFD272-JP クラス フォーラム
- 1 LFS145 Class Forum
- 18 LFS200 Class Forum
- 736 LFS201 Class Forum
- 1 LFS201-JP クラス フォーラム
- LFS203 Class Forum
- 23 LFS207 Class Forum
- 292 LFS211 Class Forum
- 53 LFS216 Class Forum
- 41 LFS241 Class Forum
- 33 LFS242 Class Forum
- 31 LFS243 Class Forum
- 9 LFS244 Class Forum
- 27 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- 123 LFS253 Class Forum
- 917 LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 78 LFS260 Class Forum
- 122 LFS261 Class Forum
- 27 LFS262 Class Forum
- 77 LFS263 Class Forum
- 15 LFS264 Class Forum
- 10 LFS266 Class Forum
- 13 LFS267 Class Forum
- 16 LFS268 Class Forum
- 13 LFS269 Class Forum
- 190 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- 201 LFW211 Class Forum
- 147 LFW212 Class Forum
- 887 Hardware
- 210 Drivers
- 74 I/O Devices
- 44 Monitors
- 115 Multimedia
- 206 Networking
- 98 Printers & Scanners
- 85 Storage
- 744 Linux Distributions
- 88 Debian
- 64 Fedora
- 12 Linux Mint
- 13 Mageia
- 24 openSUSE
- 132 Red Hat Enterprise
- 33 Slackware
- 13 SUSE Enterprise
- 353 Ubuntu
- 465 Linux System Administration
- 37 Cloud Computing
- 65 Command Line/Scripting
- Github systems admin projects
- 94 Linux Security
- 77 Network Management
- 107 System Management
- 47 Web Management
- 59 Mobile Computing
- 21 Android
- 24 Development
- 1.2K New to Linux
- 1.1K Getting Started with Linux
- 523 Off Topic
- 126 Introductions
- 210 Small Talk
- 19 Study Material
- 779 Programming and Development
- 254 Kernel Development
- 491 Software Development
- 918 Software
- 255 Applications
- 181 Command Line
- 2 Compiling/Installing
- 75 Games
- 316 Installation
- 43 All In Program
- 43 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)