Question using Pritunl DNS Server

We have a scenario where we want a k8s Deployment to communicate to our devices (i.e. raspberry pis) using the VPN Client Mapping that pritunl-dns provides. The only way we can access 11d2dd3d3.foo.vpn dns is by connecting into the Pritunl server then accessing the dns names. How we used to access our devices was by sshing into our openvpn server and then sshing into the device.

Which brings me to my question: How can we access the DNS server from a k8s Deployment to then access other devices? I was looking into adding an initContainer to connect to the server then accessing the devices.

Would like guidance if this anyone has had to do this.

The Pritunl server would need to run on the Kubernetes network or have a site-to-site link on the network. This would then allow the DNS server and containers to be accessed. When running Pritunl in a container the /var/lib/pritunl/pritunl.uuid must be persistent.

The pritunl server and the k8s cluster live within the same VPC. However, I was able to connect to our devices by sshing from my K8s pod into my pritunl server where I ran dig in the server and had it connect to one of my devices that should be registered in the DNS server with the virtual network’s private ip: dig @ec2-35-15-215-22o.us-east-1.compute.amazonaws.com 22f2fhhgfgf.foo.vpn +short

This is what allows me to ssh into our devices. This is a start. I’ll need to create a script where it can be highly available. Maybe this can help anyone out there finding a way to connect to devices.