I deployed the docker-openvpn container in my (local) Kubernetes cluster to locally access my services safely and debug dependent services.
I can connect to the cluster through the openVPN server. However, I cannot resolve my Services through DNS .
I managed to get to the point where, after setting up the routes on the VPN server:
- I can ping Pod over IP (
subnet 10.2.0.0/16 ) - I can ping the service over IP (
subnet 10.3.0.0/16 as DNS, which is at 10.3.0.10 ) - I can
curl perform IP Services and get the data I need.
but when I nslookup kubernetes or any service , I get:
nslookup kubernetes ;; Got recursion not available from 10.3.0.10, trying next server ;; Got SERVFAIL reply from 10.3.0.10, trying next server
I still lack something for the data to be returned from the DNS server, but they cannot figure out what I need to do.
How to debug this SERVFAIL problem in Kubernetes DNS ?
EDIT:
Things I noticed and I want to understand:
nslookup works to resolve the service name in any module except openvpn pod- while
nslookup works in these other Pods, ping does not work. - similarly, the
traceroute in these other Pods leads to the 10.0.2.2 flannel layer, and then stops there.
from this, I assume that ICMP should be blocked at the flannel level, and this does not help me figure out where the DNS is blocked.
EDIT2:
I finally figured out how to make nslookup work: I had to push the DNS lookup domain to the client using
push "dhcp-option DOMAIN-SEARCH cluster.local" push "dhcp-option DOMAIN-SEARCH svc.cluster.local" push "dhcp-option DOMAIN-SEARCH default.svc.cluster.local"
add with option -p to docker-openvpn image
so i get
docker run -v /etc/openvpn:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig \ -u udp://192.168.10.152:1194 \ -n 10.3.0.10 \ -n 192.168.10.1 \ -n 8.8.8.8 \ -n 75.75.75.75 \ -n 75.75.75.76 \ -s 10.8.0.0/24 \ -d \ -p "route 10.2.0.0 255.255.0.0" \ -p "route 10.3.0.0 255.255.0.0" \ -p "dhcp-option DOMAIN cluster.local" \ -p "dhcp-option DOMAIN-SEARCH svc.cluster.local" \ -p "dhcp-option DOMAIN-SEARCH default.svc.cluster.local"
nslookup now works, but curl is still not
docker dns kubernetes vpn
MrE
source share