Lab 7.2 Ingress Controller - Service available via internal ip, not via ingress
Hi,
I'm running into an issue with Lab 7.2. I've managed to create the ClusterRole and ClusterRole binding as well as the traefik ingress controller. After doing this the ingress controller is up but on the external IP address I get a Connection Refused message from curl.
ip address for this vbox host:
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:99:32:3f brd ff:ff:ff:ff:ff:ff
inet 10.10.10.121/24 brd 10.10.10.255 scope global dynamic enp0s3
valid_lft 54906sec preferred_lft 54906sec
inet6 fe80::a00:27ff:fe99:323f/64 scope link
valid_lft forever preferred_lft forever
failing curl command:
thijs@ckad1:~/LFD259/labs/7/app2$ curl -H "Host: www.example.com" http://10.10.10.121
curl: (7) Failed to connect to 10.10.10.121 port 80: Connection refused
Ingress exists, but it has no address. I suspect this might be the problem as the describe shows that the default-http-backend was not found (but I have no idea how to solve that...).
thijs@ckad1:~/LFD259/labs/7/app2$ kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
ingress-test www.example.com 80 21h
thijs@ckad1:~/LFD259/labs/7/app2$ kubectl describe ing ingress-test
Name: ingress-test
Namespace: default
Address:
Default backend: default-http-backend:80 ()
Rules:
Host Path Backends
---- ---- --------
www.example.com
/ secondapp:80 (192.168.148.24:80)
Annotations: kubernetes.io/ingress.class: traefik
Events:
I'm using VirtualBox so as mentioned in the labs, there maybe issues when using LoadBalancer instead of NodePort. The service is available on NodePort and running correctly:
thijs@ckad1:~/LFD259/labs/7/app2$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 443/TCP 20d
nginx ClusterIP 10.105.71.234 443/TCP 19d
registry ClusterIP 10.105.67.82 5000/TCP 19d
secondapp LoadBalancer 10.110.213.97 80:32000/TCP 21h
thijs@ckad1:~/LFD259/labs/7/app2$ kubectl describe svc secondapp
Name: secondapp
Namespace: default
Labels: run=my-nginx
Annotations:
Selector: example=second
Type: LoadBalancer
IP: 10.110.213.97
Port: 80/TCP
TargetPort: 80/TCP
NodePort: 32000/TCP
Endpoints: 192.168.148.24:80
Session Affinity: None
External Traffic Policy: Cluster
Events:
thijs@ckad1:~/LFD259/labs/7/app2$ curl http://10.110.213.97
<!DOCTYPE html>
Welcome to nginx!
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to
nginx.org.
Commercial support is available at
nginx.com.
Thank you for using nginx.
Any ideas what I'm missing here?
Comments
-
Hi @tknoops,
You mentioned this:
I'm using VirtualBox so as mentioned in the labs, there maybe issues when using LoadBalancer instead of NodePort
Yet your service is still a
LoadBalancer
type. Did you try changing it to aNodePort
type instead?Regards,
-Chris0 -
HI @chrispokorni , completely forgot to mention that but yeah I did try that but to no effect. The labs don't say I have to change it back though as a NodePort will always be available even though there is no LoadBalancer available (like in non cloud setups like mine).
0 -
I removed everything, tried to switch to Traefik image 2.2.1 which got the traefik pods going into a error crash backoff loop. Switched back to image 1.17.3 (without removing anything but the serviceaccount/daemonset/service) and it worked. Not sure how as I've redeployed everything a few times already, but hope this helps someone in the future.
0 -
The lab does not use traefik v2. If you read carefully step 4 of the ingress exercise, it states that v1.7.13 is used instead.
0 -
I'm aware of that but since 1.7.13 wasn't working either I was wondering if 2.2.1 did work. It didn't, but it did make me redeploy everything which somehow solved the issue
For future references, address is still empty while I have both backend services available via the Traefik ingress service, so that wasn't part of the problem.
0 -
Hello,
Perhaps if we troubleshoot from the pod out we can figure out where the issue may be.
If you curl to the pod ip it works, 192.168.xx.yy? I think yes.
If you curl to the endpoint of the service secondapp it works, 10.110.213.97? I think yes.So we know the web server is running and the service is working. On to if the Ingress controller is working. Do you see any messages for the Ingress controller pods or daemonset? If you run kubectl describe against each object are there any warnings or other messages that could help us to the next step?
Your previous output indicates the Ingress pods are not getting IP addresses. As the IP is given via the API server that makes me wonder if there is an overall networking issue - not a Kubernetes issue.
So, did you open up every port on every interface? VirtualBox locks down interfaces a bit and you may need to turn each one into promiscuous mode.
From the host if you try to nc a VMs primary IP at port 80, does it connect to anything?
Use tcpdump or wireshark to see where the traffic is going, both from the host as well as from the VM perspective?
Troubleshooting network issues with VirtualBox can be tricky because there are several possible ways you set up the VB network. As well the host may have some firewall rules in place that are blocking the traffic. If nothing else works at least we can rule in or out that aspect with tcpdump information.
Regards,
0 -
Hello, I think I can help here in case anyone else runs into this.
The lab instructs you to run the following : student@master: ̃$ ip a
The command will show you the ip address for the master node. What you really want is the ip address for the worker node since that is where your ingress controller is running.
The documentation should instruct you to open a new terminal on the worker node and perform: student@worker: ̃$ ip a
Once I had the worker ip the request to host example.com worked.
0 -
Hello,
This is incorrect. The ingress pod is running on all nodes. If it is not for your system perhaps you missed the step which removes the master taint, or other issue.
0 -
Hello,
I seem to be having a similar issue, or perhaps a perceived issue.
Essentially the command ip a does not present a usable IP for the curl command. After setting up ingress, ingress controller and such I end up with the ingress-test as followsName: ingress-test Namespace: anthill Address: Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>) Rules: Host Path Backends ---- ---- -------- www.example.com / secondapp:80 192.168.77.199:80) Annotations: kubernetes.io/ingress.class: traefik Events: <none>
Curl attempts to 192.168.77.199:80 responds successfully with the desired Thank you for using nginx message.
The results of ip a are as follows1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens160: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:0c:29:77:83:0b brd ff:ff:ff:ff:ff:ff inet 192.168.1.64/24 brd 192.168.1.255 scope global dynamic ens160 valid_lft 77141sec preferred_lft 77141sec inet6 fe80::20c:29ff:fe77:830b/64 scope link valid_lft forever preferred_lft forever 3: docker0: mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:54:a1:84:b8 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever 6: vxlan.calico: mtu 1440 qdisc noqueue state UNKNOWN group default link/ether 66:b0:66:fc:8e:8c brd ff:ff:ff:ff:ff:ff inet 192.168.153.64/32 brd 192.168.153.64 scope global vxlan.calico valid_lft forever preferred_lft forever inet6 fe80::64b0:66ff:fefc:8e8c/64 scope link valid_lft forever preferred_lft forever 7: calid69e41364fe@if3: mtu 1440 qdisc noqueue state UP group default link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 fe80::ecee:eeff:feee:eeee/64 scope link valid_lft forever preferred_lft forever 8: calif0ee3aada81@if3: mtu 1440 qdisc noqueue state UP group default link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 1 inet6 fe80::ecee:eeff:feee:eeee/64 scope link valid_lft forever preferred_lft forever
nc -vz requests to any of the IP's above at port 80 provide (tcp) failed: Connection refused
The curl command as follows fails:curl -H "HOST: www.example.com" http://192.168.1.64:80 curl: (7) Failed to connect to 192.168.1.64 port 80: Connection refused
0 -
Hello,
I seem to have a similar issue. I can curl the ip shown in ingress-test with successName: ingress-test Namespace: anthill Address: Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>) Rules: Host Path Backends ---- ---- -------- www.example.com / secondapp:80 192.168.77.199:80) Annotations: kubernetes.io/ingress.class: traefik Events: <none>
curl -H "HOST: www.example.com" http://192.168.77.199 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> ...
However I'm not sure if this is the correct IP. The following command doesn't provide any usable IP address for the ingress
nkerr@unode1:~$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:0c:29:77:83:0b brd ff:ff:ff:ff:ff:ff inet 192.168.1.64/24 brd 192.168.1.255 scope global dynamic ens160 valid_lft 76414sec preferred_lft 76414sec inet6 fe80::20c:29ff:fe77:830b/64 scope link valid_lft forever preferred_lft forever 3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:54:a1:84:b8 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever 6: vxlan.calico: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 qdisc noqueue state UNKNOWN group default link/ether 66:b0:66:fc:8e:8c brd ff:ff:ff:ff:ff:ff inet 192.168.153.64/32 brd 192.168.153.64 scope global vxlan.calico valid_lft forever preferred_lft forever inet6 fe80::64b0:66ff:fefc:8e8c/64 scope link valid_lft forever preferred_lft forever 7: calid69e41364fe@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 qdisc noqueue state UP group default link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 fe80::ecee:eeff:feee:eeee/64 scope link valid_lft forever preferred_lft forever 8: calif0ee3aada81@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 qdisc noqueue state UP group default link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff link-netnsid 1 inet6 fe80::ecee:eeff:feee:eeee/64 scope link valid_lft forever preferred_lft forever
Using the curl command with one of the above IP's doesn't work. nc commands to these result in (tcp) failed: Connection refused
Not sure what I'm missing here.
0 -
Hi @nkerr,
The
ip a
command is returning the node's IP address, that you can then test withcurl -H ...
. If unsure, you may be able to confirm the node IP from your hypervisor or cloud console used to configure your node instances.From your output, however, it may seem that you cluster is misconfigured - your node IP addresses overlapping with the default pod network
192.168.0.0/16
managed by Calico. These two networks should not overlap in a cluster.Regards,
-Chris0 -
Hi @mmckenzie,
Being able to access a pod, its service, and an ingress from only from the node where the pod is deployed, only shows that the networking is misconfigured at the cluster infrastructure level. It is not a solution, nor does it fix the networking issue.
Regards,
-Chris0 -
@chrispokorni
I'm not sure what indicator I've provided shows an overlapping IP addresses, but the kubernetes/calico cluster is configured based on the provided scripts with a slight alteration that was required to get it to work, Switching from IP-in-IP to VXLAN.0 -
Hello,
If you are using the 192.168 network for you nodes it will overlap with the default Kubernetes network range set via Calico and when the cluster is initialized. Rebuild you nodes to use a different IP range would be the easiest way to avoid this conflict.
Regards,
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
- 693 LFD259 Class Forum
- 111 LFD272 Class Forum
- 4 LFD272-JP クラス フォーラム
- 12 LFD273 Class Forum
- 145 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
- 130 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
- 150 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
- 370 Off Topic
- 114 Introductions
- 173 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)