Can't get nginx ingress controller working in Kubernetes

3/8/2017

I'm trying to get Ingress working in Kubernetes and I haven't been successful. I'm following the tutorial at https://github.com/kubernetes/ingress/tree/master/controllers/nginx using the default example.

I'm able to deploy everything successfully, but it doesn't expose port 80 on the host, so I have no access. I'm using CoreOS stable in a bare-metal installation.

-- cygnus8595
kubernetes
nginx

1 Answer

3/9/2017

I found the answer to this problem. The nginix ingress controller uses hostPort to expose ports 80 and 443 directly from the host. However, I'm using Flannel as an overlay network with CNI, and hostPort is unavailable when CNI is used.

I could use nodePort, but then I may as well just use a regular service anyway. I'll be using a standard load balancer in front of my ingress hosts that's not part of the Kubernetes system and it should work just fine.

UPDATE: So I was right, but there's a fix. Just add hostNetwork: yes to the yaml file creating the controller and hostPort works. :)

-- cygnus8595
Source: StackOverflow