Quantcast
Channel: Cloud Training Program
Viewing all articles
Browse latest Browse all 1907

Create Azure Kubernetes Cluster: A Complete Step-by-Step Guide

$
0
0

Kubernetes is dominating all the containerization techniques that are available in today’s world, and there is no match for it. Even though Kubernetes includes a set of various impressive features it requires significant manual configurations, that is where we need thrid-party services. Azure Kubernetes Service (AKS) by Microsoft is one of the leading managed K8s services. An AKS cluster is Let us look at how to create an AKS Cluster in this blog.

Are you new to Kubernetes? Check out our Kubernetes for Beginners to know in detail.

Azure Kubernetes Service (AKS)

Azure Kubernetes Service (AKS) is a managed Kubernetes service in which the master node is managed by Azure and end-users manages worker nodes. Users can use AKS to deploy, scale, and manage Docker containers and container-based applications across a cluster of container hosts. One of the best parts about AKS is that you only pay for the worker nodes within your clusters, not for the masters. You can create an AKS cluster in the Azure portal, with the Azure CLI, or template-driven deployment options such as Resource Manager templates and Terraform.

The AKS cluster can be accessed from a local machine’s terminal to manage Kubernetes components like deployments and pods. It can even be used to create a Kubernetes deployment.

Note: Know more about Azure Kubernetes Service (AKS) and Kubernetes Architecture.

How To Create Azure Kubernetes Cluster

Azure Kubernetes Service (AKS) is a Kubernetes service that lets you quickly deploy and manage master and worker nodes in clusters. Creating an AKS cluster is easy and there are more than enough manuals who will guide you through the process. It is an effortless process to create an AKS cluster by following the steps given below.

There are 2 ways to deploy an Azure Kubernetes Cluster, which are using:
I) Azure Portal
II) Azure CLI

Now let us look at how do we create a cluster using Azure Portal. But before all that you should an Azure Cloud account to create a cluster. Create a FREE TRIAL AZURE ACCOUNT to get $200 free credit on your Azure portal.

Steps To Create AKS Cluster

Once you have created an Azure account, or if you already have one, please follow the steps given below in order to create an Azure Kubernetes or AKS Cluster easily.

Step 1 [Kubernetes Services]:  Go to the Azure Portal and search for Kubernetes Service in the search bar and click on it.

Kubernetes service

Step 2 [Add Kubernetes Cluster]: Once you reach the Kubernetes Services page, click on Add and then Add Kubernetes Cluster.

kubernetes cluster

Step 3 [Basics]: Once you click on add Kubernetes cluster, the next step is to update the specifications of the cluster. So, click on Basics.

  • Give the Resource Group name as per your requirement.
  • Specify a name to your cluster in the Kubernetes cluster name field.
  • Choose a Region in which you want to create your cluster. In the specified region, our master node will be created.
  • Select the Kubernetes Version.  Here I am choosing the default, i.e., 1.17.9

Kubernetes custer

Next, comes the size and count of the nodes of the cluster that we are gonna create. These can be updated as per the requirements.

  • Select the Node Size. We are choosing Standard Ds2 v2 which has the following configuration: 2 vCPUs, 7 GiB RAM, 8 Data Disks, 14 GiB Temp Storage.
  • Give the Node Count value which specifies how many Worker Nodes we want.

Kubernetes cluster

Step 4 [Node Pools]: Next comes the Node Pools, follow the steps given below:

  • The Virtual nodes are a type of Serverless container instance. As we want to create the Worker nodes as Virtual Machines, so we will Disable this option.
  • The VM scale sets provide an auto-scaling option. Hence, we will keep it Enabled.

Kubernetes cluster

Step 5 [Authentication]: Next is to click on Authentication.

  • Choose the System-assigned managed identity.
  • If you want to go for Role-based Access Control (RBAC) then select Enabled.
  • Choose the Encryption Type of your choice, I will use the Default one.

Kubernetes cluster

Step 6 [Networking]: Next is the Networking part.

  • Select the Network Configuration. Basic will create a new Vnet using basic values. The advanced networking option allows us to create a new Vnet with customizable addresses. So I will be choosing Advanced.
  • The Cluster Subnet option is to choose which Subnet you want the Nodes and Containers to be placed in.
  • Kubernetes service address range is the CIDR notation IP range from which to assign server cluster IPs.
  • Docker Bridge address is the IP address assigned to Docker Bridge. The Bridge Network is for the container to container communication.

Kubernetes cluster

  • In Private Cluster, the communication between the nodes and the API server happens internally.
  • So, I am Disabling the Private Cluster.
  • Keep the Network Policy to None.
  • HTTP application routing to No.

Kubernetes cluster

Step 7 [Integration]: Next is the Integration.

Here we keep all settings to default and move to the next step.

Kubernetes cluster

Step 8 [Review & Create]: The final step is to click on Review & Create. If you click on Create, it will first Validate your  AKS Cluster and if everything is fine then the cluster will be created.

Kubernetes cluster

You can see that our new Azure Kubernetes AKS Cluster has been successfully created. Yayyy! But hold on, we will have to connect this cluster, which I am going to cover next.

AKS

To see the cluster, Go to Kubernetes services and there we can see the cluster that has been created.

AKS cluster

Connect To The AKS Cluster

There are two ways to connect the AKS Cluster:
I) Using Cloud Shell
II) Using Azure CLI

I am going to cover how do we connect using Cloud Shell. We can see the option on top of our screen (marked red in the below image).

Cloud shell

Step 1: Run the following command, on the Azure bash shell:

   
  $ az aks get-credentials --resource-groups <name of resource group> --name <name of cluster

Cloud shell

Step 2: To get the Nodes running in our cluster, run the following command, and you will see all the nodes in your AKS cluster.

   
  $ kubectl get nodes

cloud shell

Summary

If you want to be successful in orchestrating containers, Kubernetes is the way to go. If you have followed the above steps you will have an AKS cluster up and running. But, keep a watch on what Microsoft is doing with AKS and Azure. AKS is continuously in development and new features are added almost every day. Super cool new features are coming soon too. Microsoft is fully dedicated to Kubernetes!

Related Post

Join FREE Class

We cover Azure Kubernetes Service (AKS) as a bonus in our Certified Kubernetes Administrator (CKA) training program. To know about what is the Roles and Responsibilities of Kubernetes administrator, why you should learn Docker and Kubernetes, Job opportunities for Kubernetes administrator in the market, and what to study Including Hands-On labs you must perform to clear the Certified Kubernetes Administrator (CKA) certification exam by registering for our FREE Masterclass.

Click on the below image to Register Our FREE Masterclass on Docker & Kubernetes For Beginners & Certification (CKA) Now!

Free Masterclass

The post Create Azure Kubernetes Cluster: A Complete Step-by-Step Guide appeared first on Cloud Training Program.


Viewing all articles
Browse latest Browse all 1907

Latest Images

Trending Articles



Latest Images