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:
vxr@ubuntu-k8s-master:~$ 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 vxr@ubuntu-k8s-master:~$
If I list the default ingress classes:
vxr@ubuntu-k8s-master:~$ kubectl get ingressclasses.networking.k8s.io nginx NAME CONTROLLER PARAMETERS AGE nginx k8s.io/ingress-nginx <none> 95m vxr@ubuntu-k8s-master:~$
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
vxr@ubuntu-k8s-master:~$ 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
- All Categories
- 217 LFX Mentorship
- 217 LFX Mentorship: Linux Kernel
- 788 Linux Foundation IT Professional Programs
- 352 Cloud Engineer IT Professional Program
- 177 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 146 Cloud Native Developer IT Professional Program
- 137 Express Training Courses
- 137 Express Courses - Discussion Forum
- 6.2K Training Courses
- 46 LFC110 Class Forum - Discontinued
- 70 LFC131 Class Forum
- 42 LFD102 Class Forum
- 226 LFD103 Class Forum
- 18 LFD110 Class Forum
- 37 LFD121 Class Forum
- 18 LFD133 Class Forum
- 7 LFD134 Class Forum
- 18 LFD137 Class Forum
- 71 LFD201 Class Forum
- 4 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 2 LFD233 Class Forum
- 4 LFD237 Class Forum
- 24 LFD254 Class Forum
- 695 LFD259 Class Forum
- 111 LFD272 Class Forum
- 4 LFD272-JP クラス フォーラム
- 12 LFD273 Class Forum
- 148 LFS101 Class Forum
- 1 LFS111 Class Forum
- 3 LFS112 Class Forum
- 2 LFS116 Class Forum
- 4 LFS118 Class Forum
- 6 LFS142 Class Forum
- 5 LFS144 Class Forum
- 4 LFS145 Class Forum
- 2 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 2 LFS157 Class Forum
- 25 LFS158 Class Forum
- 7 LFS162 Class Forum
- 2 LFS166 Class Forum
- 4 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 3 LFS178 Class Forum
- 3 LFS180 Class Forum
- 2 LFS182 Class Forum
- 5 LFS183 Class Forum
- 31 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 3 LFS201-JP クラス フォーラム
- 18 LFS203 Class Forum
- 132 LFS207 Class Forum
- 2 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 302 LFS211 Class Forum
- 56 LFS216 Class Forum
- 52 LFS241 Class Forum
- 48 LFS242 Class Forum
- 38 LFS243 Class Forum
- 15 LFS244 Class Forum
- 2 LFS245 Class Forum
- LFS246 Class Forum
- 48 LFS250 Class Forum
- 2 LFS250-JP クラス フォーラム
- 1 LFS251 Class Forum
- 151 LFS253 Class Forum
- 1 LFS254 Class Forum
- 1 LFS255 Class Forum
- 7 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 118 LFS260 Class Forum
- 159 LFS261 Class Forum
- 42 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 24 LFS267 Class Forum
- 22 LFS268 Class Forum
- 30 LFS269 Class Forum
- LFS270 Class Forum
- 202 LFS272 Class Forum
- 2 LFS272-JP クラス フォーラム
- 1 LFS274 Class Forum
- 4 LFS281 Class Forum
- 9 LFW111 Class Forum
- 259 LFW211 Class Forum
- 181 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 795 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 102 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 758 Linux Distributions
- 82 Debian
- 67 Fedora
- 17 Linux Mint
- 13 Mageia
- 23 openSUSE
- 148 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 353 Ubuntu
- 468 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 93 Linux Security
- 78 Network Management
- 102 System Management
- 47 Web Management
- 63 Mobile Computing
- 18 Android
- 33 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 22 Study Material
- 805 Programming and Development
- 303 Kernel Development
- 484 Software Development
- 1.8K Software
- 261 Applications
- 183 Command Line
- 3 Compiling/Installing
- 987 Games
- 317 Installation
- 96 All In Program
- 96 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)