14
[email protected] 1 Create Azure Kubernetes Cluster [Edition 01] [Last Update 200629] Atul Kumar Oracle ACE & Cloud Expert

Create Azure Kubernetes Cluster

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Create Azure Kubernetes Cluster

[email protected] 1

Create Azure Kubernetes Cluster

[Edition 01]

[Last Update 200629]

Atul Kumar

Oracle ACE & Cloud Expert

Page 2: Create Azure Kubernetes Cluster

[email protected] 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

Page 3: Create Azure Kubernetes Cluster

[email protected] 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)

Page 4: Create Azure Kubernetes Cluster

[email protected] 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

Page 5: Create Azure Kubernetes Cluster

[email protected] 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

Page 6: Create Azure Kubernetes Cluster

[email protected] 6

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

3. Specify Authentication method and enable RBAC

Page 7: Create Azure Kubernetes Cluster

[email protected] 7

4. Specify network settings

5. Enable Log Analytics

Page 8: Create Azure Kubernetes Cluster

[email protected] 8

6. It enters validation phase for all specified parameters

Page 9: Create Azure Kubernetes Cluster

[email protected] 9

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

8. Cluster creation in progress

Page 10: Create Azure Kubernetes Cluster

[email protected] 10

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

Page 11: Create Azure Kubernetes Cluster

[email protected] 11

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

Page 12: Create Azure Kubernetes Cluster

[email protected] 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”

Page 13: Create Azure Kubernetes Cluster

[email protected] 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

Page 14: Create Azure Kubernetes Cluster

[email protected] 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)