Tutorial Highlights & Transcript
00:00 - Problems
01:46 - Solutions
03:56 - Demo - Fully Qualified Domain Name
First, this is the CoreDNS and its default settings currently deployed that the EKS cluster comes with. It comes with two pods and two replicas. But for the easiness of the demo, I will reduce it to one, so that we can check the logs of a single container. I will execute this command, and we will see how the Kubernetes cluster results in DNS requests. It provided us with the IP addresses. Now let’s check how the query works. By default, whenever it is a fully qualified domain, the request will look like this. Of course, it will match up against these services, default dot services dot cluster dot local. These are all the Kubernetes internal domain names, including this EC2 internal, right? After creating four times, CoreDNS comes up with the right IP addresses and the right domain name to query against. If you want to consider and calculate the time it is taken, you need to take all the query times and sum up all the things into one. Before the demo, I had a basic timing notation. This is the normal timing. This is with the fully qualified domain name and this is with the AutoPath.
The fully qualified domain name and AutoPath work similarly, but AutoPath requires it to create a CNAME record internally for the CoreDNS for the domains that you are using. So that’s why it is hard compared to normal DNS queries. This is the normal DNS query. I will delete this code so it will recreate a new pod. It will be easier to check the logs with the fully qualified domain name. I’m just copying this command again. In this command, I will add the trailing dot which is a fully qualified domain name. The pod is up and running and I will execute this command. It provided us with the IP addresses and as you can see the timing only queried one time and provided us the IP addresses and the query time is very low compared to the five queries. So, this is the fully qualified domain name and for each and every AWS service, we need to use a case in the Kubernetes variables. So that query performance can be optimized for the smaller scale cluster, it is not much of an impact, but when the cluster grows, and for high traffic clusters, it will be very useful.
08:37 - Demo - AutoPath
08:37 - Demo - AutoPath
Now I will enable the node’s local DNS cache and Kubernetes proportional autoscaler, as well. For that, this is the definition that I have used, which is a Helm chart and Kubernetes manifest. If I go to the proportioner autoscaler configuration file, the system main configuration file that I have mentioned that I use. Currently, I’m using a two-core CPU and eight GB RAM for instance. I use the two number of cores per replica and nodes per replica are also one so it will behave like a daemon set. As there is another option that prevents single-point failure. I have deployed a single node only. Basically, for one node, it should be a single replica, but this autoscaler will deploy two replicas and it will scale up our CoreDNS. I will deploy this and for this node local DNS cache.
17:49 - Official Kubernetes Documentation
Parth Vyas
DevOps Engineer
nClouds
Parth is a DevOps Engineer at nClouds with multiple AWS certifications including AWS Certified Solutions Architect - Professional, AWS Certified DevOps Engineer - Professional, AWS Certified Developer - Associate, and AWS Certified SysOps Administrator - Associate.