How to Fix Kubernetes DNS Redirect to External on Proxmox

How to Fix Kubernetes DNS Redirect to External on Proxmox

What Happened?

I want deploy spring boot microservices and I have services called dexter and enclave and want communicate to each other using REST. They can communicate if I set service url using container hostname which is dexter and enclave. But somehow they won’t communicate if I use Fully Qualified Domain Name (FQDN) on kubernetes and got 302 Found. Seems redirect to external domain on public network which should not be registered.


What did expect to happen?

Pods should resolve DNS and exposed service should be reachable.


The Environment

Cloud Provider : Proxmox 8.2 (Bare Metal)

Kubernetes Cluster Info : v1.30.3


Root Cause?

DNS Resolve /etc/resolv.conf on Proxmox VE have registered search name because when first install Proxmox that DNS must be filled. That's why when create new VM from Proxmox using cloud init, the DNS resolve on VM (kubernetes node) was override from Proxmox VE and impacted the DNS resolution on kubernetes cluster.


How to Solve?

Remove kubernetes cluster and VM. Remove registered search example.com on your Proxmox VE bare metal. This example i use my router gateway IP and use google DNS also take a note to adjust with your preference.

nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4        

Create VM and reinstall kubernetes cluster, and that issue should be resolved.


要查看或添加评论,请登录

Alvinditya Saputra的更多文章

社区洞察

其他会员也浏览了