6 Communication in a Kubernetes cluster

 

This chapter covers

  • How nodes communicate via CNI and the different CNIs available
  • How Pod-to-Pod communication happens
  • Types of Services in Kubernetes and when they are used
  • Assigning IP addresses to Pods
  • Communication via DNS and how to use CoreDNS
  • Using Ingress and Ingress controllers

Many find that networking in Kubernetes is complex, but we will break it down fully in this chapter, especially since it’s 20% of the CKA exam. There are a few important concepts that will clear up a lot of confusion, and because we’ve covered how bridge networking works within containers, I think it will all start to come together. By the end of this chapter, you’ll know how Pods talk to each other within a cluster, which is the essence of the Services and networking section of the exam.

6.1 Configuring DNS

Inside a Kubernetes cluster, CoreDNS is responsible for resolving hostnames to IP addresses. As of version 1.12 of Kubernetes, CoreDNS has been the default DNS server and will be present on the exam. CoreDNS is also used in our kind Kubernetes cluster.

6.2 CoreDNS

6.2.1 Config files

6.2.2 Replicating DNS

6.2.3 Pod-to-Pod connectivity

6.3 Ingress and Ingress controllers

6.4 Services

6.4.1 ClusterIP Service

6.4.2 NodePort Service