Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

What is Azure Kubernetes Service(AKS) and Why Do You Need it?

3 min read

Thanks to Collabnix community member Mewantha Bandar  , a Senior Software Engineer at IFS for contributing this content for KubeLabs – The #1 Kubernetes Resources for all Levels. Do you have anything exciting to share with Collabnix community? Do visit Collabnix community Slack and we might feature you in Collabnix website.

If you’re a great fan of Minikube and have been using it to host your Kubernetes clusters, it is important to understand that it might be a great tool for development and testing but however, when it comes to production, you need a Cloud-based, scalable, and highly available solution. Implementing this out of scratch on our own server would be very challenging, and make little sense, which is why all major cloud providers have an implementation that allows you to run your Kubernetes cluster on the cloud. AKS helps achieve this to some degree.

What is AKS?

To start understanding exactly what AKS is, let’s backtrack to the beginning. If you’ve forgotten the Kubernetes architecture, perhaps this is a good time to revisit this article.

Consider the following architecture, which is how Kubernetes works:

Kubernetes Architecture

You have the master node which handles and provisions worker nodes, which do the actual work of holding pods. Previously, when we used minikube, we ran everything on our local machine. However, now, we can move part of this to AKS. One thing to note is that AKS does not act as an alternative to the entire Kubernetes architecture, rather, it only replaces the master node. As such, AKS is free and only requires a normal Azure subscription. The processes which take place within the master node would be invisible to you, and you should not really care as to what goes on in the background. Instead, you only have to think about the service it provides, and how your worker nodes would use that service. In short, AKS abstracts away anything specific to the master node, and provides a host of other features as well. It does this by hosting everything on Azure, and providing it as a service.

Why use AKS?

You can reap the full benefits of AKS if the rest of your application, or your organization uses Azure cloud as their main cloud platform. The master node, which is handled by AKS allow you to upgrade your cluster with minimal hassle, allows seamless integration with other Azure services. Azure policies that you may have defined can be applied across clusters, and AKS handles provisioning and scaling with autoscaler integrations which takes all the manual work away from your. If you use Azure Container Instances (ACI), then you can schedule your containers in conjuction with AKS.

A major part of AKS is it’s ability to network, so we’ll be taking a look at that further.

AKS Networking

When deploying a cluster, there are two networking models to consider:

  • Kubenetes networking
  • Azure Container Networking Interface (CNI) networking

Kubenetes Networking

This model works off the Kubenet Kubernetes plugin, and is the default configuration for AKS. Since you would want to integrate your cluster with services across Azure, you would rely on your Azure Virtual Network (VNet). Your VNet is essentially your private network within Azure, and allows unrestricted communication between you Azure resoureces. It also allows communication with external resources, as well as the internet, and this is what Kubenet will be using as well. Both your nodes and your pods will get IP addresses from VNet, grouped by two different address spaces. That is to say, pods don’t get real IP’s. Since they reside in different address spaces, they have to use IP forwarding and Azure routing services. If you are not sure about these concepts, feel free to take a look at how traffic gets routed around Azue VNets from the official docs. Any resources that need to be addressed that are outside the Azure VNet get accessed by NAT (Network Address Translation). Once again, if this concept is unfamiliar to you, the official docs are you best friend.

Advantages

Why would you want to use Kubernetes networking? There are a couple of reasons:

  • Not too much pre-planning required
  • Little setup time (default option)
  • Only node get real IP addresses, not Pods, which means you don’t need as many allocatable IP addresses.

Disadvantages

There are several disadvantages of Kubernetes network, which can make organisations consider Azure CNI instead. They are:

  • User defined routes can be hard to manage as your cluster gets bigger
  • Since pods don’t have IP addresses, there is addional latency when communicating among nodes
  • You can only have one AKS cluster per subnet

Azure Container Networking Interface (CNI) networking

Unlike Kubenet, where the pods didn’t get real IPs, using CNI’s assigns real routable IP addresses to pods. This is a slightly more advanced form of networking and will require some planning ahead. This method allows the pod to be accessed directly using the IP addresses they get from the subnet. The number of IP addresses needed is set aside for the node. Since this is a hard limit, this is where planning is needed to prevent exhausting IP addresses. Both pods and nodes get IPs from the same subnet and therefore support up to 250 pods per node.

So how would a pod communicate between resources? If the resource is within the same VNet, the target resource will see the pod’s IP directly, while if the resource is outside the VNet, then the target resource sees the node IP. Not the pod IP.

Advantages

There are a couple of advantages to using CNI, which contrasts with Kubenet:

Disadvantages

  • Proper planning needed to prevent IP address exhaustion
  • Setup is more complex

In our next blog post, you will see how to manage roles in AKS. Stay tuned!


References:

 

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

29 Replies to “What is Azure Kubernetes Service(AKS) and Why Do You…”

  1. Thank you for another fantastic article. Where else could anybody get that kind of information in such an ideal way of writing? I’ve a presentation next week, and I am on the look for such information.

  2. Have you ever thought about publishing an ebook or guest authoring on other sites? I have a blog based on the same information you discuss and would really like to have you share some stories/information. I know my readers would appreciate your work. If you’re even remotely interested, feel free to shoot me an e-mail.

  3. When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!

  4. Hello there! I know this is somewhat off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

  5. I have been exploring for a little bit for any high quality articles or blog posts on this kind of area . Exploring in Yahoo I ultimately stumbled upon this web site. Reading this info So i?¦m glad to exhibit that I have a very just right uncanny feeling I discovered just what I needed. I so much without a doubt will make certain to do not omit this site and provides it a glance on a continuing basis.

  6. Heya i’m for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you helped me.

  7. I got what you intend, thankyou for putting up.Woh I am happy to find this website through google. “Wisdom doesn’t necessarily come with age. Sometimes age just shows up by itself.” by Woodrow Wilson.

  8. I was just looking for this information for a while. After six hours of continuous Googleing, at last I got it in your website. I wonder what is the lack of Google strategy that do not rank this type of informative websites in top of the list. Usually the top websites are full of garbage.

Leave a Reply

Your email address will not be published.