Docker and Kubernetes are rapidly getting adopted. Kubernetes is available on most of the major cloud platform. Docker is used for containerizing the application while the kubernetes is used for managing the container based applications, their networking, storage and other aspects.
In this article, let’s have a look at some of the important concepts in Azure Kubernetes Service. We will also try to create an instance of AKS in this article.
This article assumes that you already know basic components of kubernetes. Also, for following some of the steps in this article, you will need an Azure account. If you do not have an Azure account, you can create free account on Azure.
Azure kubernetes service (AKS) provides a kubernetes cluster. A kubernetes cluster has mainly two parts: Control Plane and Nodes.
The control plane is automatically provided when you create Azure kubernetes service instance. It is managed azure resource. Meaning, you do not need to worry about configuring the etcd store for high availability or upgrading the kubernetes cluster or securing communication between kubernetes control plane and nodes. These activities are automatically taken care by Azure and are abstracted from users.
From cost perspective, there is no cost involved for control plane.
The control plane includes key kubernetes components:
- etcd data store,
- kube-apiserver for allowing interactions through CLI, APIs, etc.
- scheduler to help in scaling the applications. It decides which nodes can run the application.
- kube-controller-manager performing some important actions such as replicating pods, node management, etc.
You need nodes to run your application. In AKS cluster, you can have one or more nodes. In AKS, the node is nothing but a virtual machine. This virtual machine has kubernetes node components:
- kubelets that processes orchestration requests from control plane and schedules of running the requested containers.
- kube-proxy routes network traffic on virtual network and handles IP addressing for services and pods
- runtime that allows containerized application to run and interact with other services like network. Moby is the runtime used by Azure.
In AKS, Linux Ubuntu operating system is used for Nodes. While creating the AKS cluster, you need to provide number of nodes. Azure automatically creates those virtual machines and configure to be used as nodes.
Nodes of same configurations are grouped together in the node pools. The number of nodes you provide while creating AKS cluster, form the default node pool. When you perform scaling on cluster, the default node pool is the target. You can also specify specific node pool to scale.
You can specify node selector in the deployment yaml document to tell cluster which node pool to use.
Let’s Create AKS Instance
Go to Azure portal and click on Create a resource button and select kubernetes service and click on create.
This will open you below dialog. Below are the basic information which you need to provide. Ignore all other tabs.
- subscription under which resource will be created
- resource group under which the resource will be placed
- cluster name for AKS instance
- region where AKS cluster is physically located
- kubernetes version, you can update this later as well.
- DNS name prefix (keep it default)
- Node size where you can select the virtual machine size for each node
- Node count specifies now many individual nodes are require
Once you click on Review + Create button, the deployment will try to validate all the inputs. If all validations pass, you will be brought on last tab where you can click create button to start creation of cluster. The creation will take a couple of minutes.
Using Azure CLI
You can also use below command to create the AKS cluster from CLI.
It creates a cluster of name myAKSCluster and places it in myResourcwGroup. It has 2 nodes and it also tries to attach azure container registry using –attach-acr switch.
az aks create \ --resource-group myResourceGroup \ --name myAKSCluster \ --node-count 2 \ --generate-ssh-keys \ --attach-acr acrName
Once it is created, you can go to the resource group you provided and verify that the kubernetes cluster is available there.
Please note that currently we have not deployed any application. We will try that in next blog of this series.