Search:

NodeLocal DNSCache Becomes GA

With Kubernetes version 1.18 NodeLocal DNSCache is Promoted to General Availability

Category: Kubernetes k8s
Category: Kubernetes k8s

With Kubernetes 1.18 NodeLocal DNSCache Becomes GA

The first release of Kubernetes in 2020 has done on 25th of March with version 1.18. You can read the official announcement here

As there are many new features with this release, I’m going to focus on NodeLocal DNSCache in this article which is graduated from beta to GA with this release.

So the first question to answer here is what the NodeLocal DNSCache is and what it solves.

NodeLocal DNSCache is an add-on you can install on your Kubernetes Cluster using the nodelocaldns.yaml

You can find it here

When you apply this manifest file, it will create a daemonset which will run a pod on each node to serve as an agent that runs CoreDNS with hostNetwork:True option (creates an interface with a default IP of 169.254.20.10/32) and caches the DNS queries.

It queries ClusterDNS Service for cache misses.

Using the NodeLocal DNSCache helps to avoid iptable DNAT rules and connections tracking, which improves DNS performance and reduces the average DNS lookup time.

One of the significant advantages of using NodeLocal DNSCache is that you can upgrade to TCP for DNS queries which improve reliability.

 

Asset_3@3x
DNS Querying Path with NodeLocal DNSCache enabled

 

Different that the general caching mechanisms, it can do Negative Caching! Even if you have a failed resolving action of a domain, it can cache this and avoid querying the ClusterDNS Service.

Using NodeLocal DNSCache give us metrics and creates visibility on Node level!

And last but not least, pods don’t need to be modified to use it!!

NodeLocal DNSCluster was available starting with Kubernetes 1.15 in beta and with Kubernetes version 1.18, it is graduated from beta to GA!

Please give it a go and let us know if you have questions!

Onur Gurdamar

Onur is a software developer & architect for 17+ years and has been working with AWS professionally for 5 years.