CoreDNS Docker Deployment & systemd-resolved configuration for port 53
Recently, I'm so much into Docker & Kubernetes world. Coming from a purely "Microsoft" background, I have to tell you, I'm having a lot of fun. Because, to learn Kubernetes, you need to first learn Docker. You don't have to but if you want to understand well Docker, you need to understand Linux and it's runtime environments, in some cases, same goes for Windows as well. And when you start learning Linux, well... you get the idea, I don't have to keep this going. It's challenging, yet fun. I built a couple of VMs for practicing and using like my "staging" environment for my tests and experiments.
I also bought 3 X Raspberry PI 4 and loaded them with Ubuntu & configured a MicroK8S cluster. MicroK8S is a Ubuntu project and it's a supported version of Kubernetes for smaller environments. It basically supports all kubectl commands.
One of the biggest issues was, when I tried to install a simple DNS server on my network using Docker (not kubernetes yet) I had an issue with the local systemd-resolved process which was already listening on the port 53 (DNS).
I found a couple of methods to fix this issue. The most popular one is to completely disalbe the local systemd-resolved process and it stops listening on the port 53 which allows us to run the container and expose this port.
Another more eficient way I found is to change the DNSStubListener value to No in the /etc/systemd/resolved.conf file on my host.
Follow these steps;
- Stop "systemd-resolved"
sudo systemctl stop systemd-resolved - edit /etc/systemd/resolved.conf like this
- Run the following command for the symlink creation;
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
And that's it. You should be able to run any DNS server on your docker host natively listening on port 53.
Comments
Post a Comment