Easiest way with dns?


I have setup rancher with rke2 cluster on premise on bare metal. When I deploy ingresses and services I want to reach them from outside the cluster via dns name.

Our datacenter can forward dns requests for the kubernetes subdomain to a dns server which runs inside kubernetes.

What is best practice to easily achieve this? Can you point to a tutorial?`

Thanks, Andreas

a tutorial would be great

I can not tell what the best practice is but I can tell you what we did. We forwarded the port 53 to the coredns on kubernetes. Then we created on the main dns zone a delegated sub-zone with the name kube.client.com. Then we added the the coredns plugin k8s_external with the config line

k8s_external kube.client.com

And then we created the service objects as described on the link. You will then get service dns names which look like this: servicename.servicenamespace.kube.client.com