Create Azure Kubernetes Cluster

Preview:

Citation preview

support@k21academy.com 1

Create Azure Kubernetes Cluster

[Edition 01]

[Last Update 200629]

Atul Kumar

Oracle ACE & Cloud Expert

support@k21academy.com 2

Contents

1 Introduction .........................................................................................................................................................3

2 Documentation Links ........................................................................................................................................4

3 Setting up Azure Kubernetes Cluster On Cloud .......................................................................................5 3.1.1 Setting Up Kubernetes cluster ......................................................................................................................................... 5 3.1.2 Create Kubernetes cluster and specify the details as below snapshot ........................................................... 5 3.1.3 Install Azure CLI to be able to interact with the Kubernetes cluster using your local machine ....... 12 3.1.4 To manage a Kubernetes cluster, we use kubectl, the Kubernetes command-line client ..................... 12

4 Summary............................................................................................................................................................. 14

support@k21academy.com 3

1 INTRODUCTION

A Kubernetes cluster is a set of node machines for running containerized applications. If you're running Kubernetes, you're running a cluster. At a minimum, a cluster contains a control plane and one or more compute machines, or nodes.

This activity guide cover steps to

• Setting up Azure Kubernetes Cluster On Cloud

• How to Manage a Kubernetes Cluster using KUBECTL (Kubernetes CLI Client)

support@k21academy.com 4

2 DOCUMENTATION LINKS

1. Kubernetes: https://azure.microsoft.com/en-in/overview/kubernetes-getting-started/

2. Azure Kubernetes Service (AKS): https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes

support@k21academy.com 5

3 SETTING UP AZURE KUBERNETES CLUSTER ON CLOUD

3.1.1 SETTING UP KUBERNETES CLUSTER

1. Login to Azure portal @ portal.azure.com and sign in using your account credentials.

2. On the search bar type in kubernetes and select “Kubernetes services”

3.1.2 CREATE KUBERNETES CLUSTER AND SPECIFY THE DETAILS AS BELOW SNAPSHOT

1. Specify name, region and Kubernetes version details

support@k21academy.com 6

2. Specify agent pool details, select machine size as per your requirement

3. Specify Authentication method and enable RBAC

support@k21academy.com 7

4. Specify network settings

5. Enable Log Analytics

support@k21academy.com 8

6. It enters validation phase for all specified parameters

support@k21academy.com 9

7. Validation is passed so now click on create to deploy the cluster

8. Cluster creation in progress

support@k21academy.com 10

9. Deployment is underway, it will take 5-7 mins wait for it to complete

support@k21academy.com 11

10. Cluster creation is done. Verify the details, go to the resource.

support@k21academy.com 12

3.1.3 INSTALL AZURE CLI TO BE ABLE TO INTERACT WITH THE KUBERNETES CLUSTER USING YOUR LOCAL MACHINE

1. Azure CLI installation on windows

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest

2. Azure CLI installation on macOS

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-macos?view=azure-cli-latest

3.1.4 TO MANAGE A KUBERNETES CLUSTER, WE USE KUBECTL, THE KUBERNETES COMMAND-LINE CLIENT

1. To install kubectl locally, use the az aks install-cli command

$ az aks install-cli

2. Get a list of your subscriptions with the az account list command:

$ az account list

3. Use az account set with the subscription ID or name you want to switch to.

$ az account set –subscription “subscription ID or name”

support@k21academy.com 13

4. To configure kubectl to connect to your Kubernetes cluster, use the az aks get-credentials command. This command downloads credentials and configures the Kubernetes CLI to use them.

$ az aks get-credentials --resource-group k8s-demo --name k8s-demo

5. To verify the connection to your cluster, use the kubectl get command to return a list of the cluster nodes.

$ kubectl get nodes

support@k21academy.com 14

4 SUMMARY

This completes step by step guide covering:

• Setting up Azure Kubernetes Cluster On Cloud

• How to Manage a Kubernetes Cluster using KUBECTL (Kubernetes CLI Client)

Recommended