Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure my DNS to work with Rancher 2.0 ingress?

I'm new to Kubernetes and Rancher, but have a cluster setup and a workload deployed. I'm looking at setting up an ingress, but am confused by what my DNS should look like.

I'll keep it simple: I have a domain (example.com) and I want to be able to configure the DNS so that it's routed through to the correct IP in my 3 node cluster, then to the right ingress and load balancer, eventually to the workload.

I'm not interested in this xip.io stuff as I need something real-world, not a sandbox, and there's no documentation on the Rancher site that points to what I should do.

Should I run my own DNS via Kubernetes? I'm using DigitalOcean droplets and haven't found any way to get Rancher to setup DNS records for me (as it purports to do for other cloud providers).

It's really frustrating as it's basically the first and only thing you need to do... "expose an application to the outside world", and this is somehow not trivial.

Would love any help, or for someone to explain to me how fundamentally dumb I am and wha tI'm missing!

Thanks.

like image 769
Steadman Avatar asked Aug 30 '18 10:08

Steadman


People also ask

What is the rancher ingress controller?

The ingress controller ensures that the Rancher load balancer matches the ingress and backend services in Kubernetes. The Rancher ingress controller will leverage the existing load balancing functionality within Rancher and convert what is in Kubernetes ingress to a load balancer in Rancher.

How does rancher integrate with Kubernetes ingress?

The Rancher ingress controller will leverage the existing load balancing functionality within Rancher and convert what is in Kubernetes ingress to a load balancer in Rancher. The ingress controller will: Listen to Kubernetes server events. Deploy a load balancer and program it with the routing rules defined in Ingress.

What happens to the rancher load balancer when an ingress is changed?

If an ingress is updated or service endpoints are changed, the ingress controller will update the corresponding Rancher load balancer to the changes in the ingress. Similarly, if the ingress is removed, the Rancher load balancer will be removed as well.

How do I add healthchecks to rancher load balancers?

You can add TCP and HTTP healthchecks for the backends configured in HAProxy software running inside Rancher’s load balancers. In order to configure the healthchecks, you would use an annotation (i. e. io. rancher. kubernetes. livenessprobes) in the ingress spec. The format of the ‘io. rancher. kubernetes.


1 Answers

You aren't dumb, man. This stuff gets complicated. Are you using AWS or GKE? Most methods of deploying kubernetes will deploy an internal DNS resolver by default for intra-cluster communication. These URLs are only useful inside the cluster. They take the form of <service-name>.<namespace>.svc.cluster.local and have no meaning to the outside world.

However, exposing a service to the outside world is a different story. On AWS you may do this by setting the service's ServiceType to LoadBalancer, where kubernetes will automatically spin up an AWS LoadBalancer, and along with it a public domain name, and configure it to point to the service inside the cluster. From here, you can then configure any domain name that you own to point to that loadbalancer.

like image 93
Grant David Bachman Avatar answered Sep 17 '22 10:09

Grant David Bachman