+ All Categories
Home > Documents > Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to...

Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to...

Date post: 10-Mar-2021
Category:
Upload: others
View: 16 times
Download: 0 times
Share this document with a friend
15
Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options: Project details: Select an Azure Subscription, then select or create an Azure Resource group, such as myResourceGroup. Cluster details: Enter a Kubernetes cluster name, such as myAKSCluster. Select a Region, Kubernetes version, and DNS name prefix for the AKS cluster. Primary node pool: Select a VM Node size for the AKS nodes. The VM size can't be changed once an AKS cluster has been deployed. - Select the number of nodes to deploy into the cluster. For this quickstart, set Node count to 1. Node count can be adjusted after the cluster has been deployed.
Transcript
Page 1: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

Create Kubernetes cluster

Login to portal and select kubernetes service

On the Basics page, configure the following options:

Project details: Select an Azure Subscription, then select or create an Azure Resource group, such as

myResourceGroup.

Cluster details: Enter a Kubernetes cluster name, such as myAKSCluster. Select a Region, Kubernetes

version, and DNS name prefix for the AKS cluster.

Primary node pool: Select a VM Node size for the AKS nodes. The VM size can't be changed once an

AKS cluster has been deployed. - Select the number of nodes to deploy into the cluster. For this

quickstart, set Node count to 1. Node count can be adjusted after the cluster has been deployed.

Page 2: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 3: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 4: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 5: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 6: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 7: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 8: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 9: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

Connect to cluster

az aks get-credentials --resource-group andromidia --name andromediakubecluster

nano azure-vote.yaml

apiVersion: apps/v1

kind: Deployment

metadata:

name: azure-vote-back

spec:

replicas: 1

selector:

matchLabels:

app: azure-vote-back

template:

metadata:

labels:

app: azure-vote-back

spec:

nodeSelector:

"beta.kubernetes.io/os": linux

containers:

- name: azure-vote-back

image: redis

Page 10: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

resources:

requests:

cpu: 100m

memory: 128Mi

limits:

cpu: 250m

memory: 256Mi

ports:

- containerPort: 6379

name: redis

---

apiVersion: v1

kind: Service

metadata:

name: azure-vote-back

spec:

ports:

- port: 6379

selector:

app: azure-vote-back

---

apiVersion: apps/v1

kind: Deployment

metadata:

name: azure-vote-front

spec:

replicas: 1

selector:

matchLabels:

app: azure-vote-front

template:

Page 11: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

metadata:

labels:

app: azure-vote-front

spec:

nodeSelector:

"beta.kubernetes.io/os": linux

containers:

- name: azure-vote-front

image: microsoft/azure-vote-front:v1

resources:

requests:

cpu: 100m

memory: 128Mi

limits:

cpu: 250m

memory: 256Mi

ports:

- containerPort: 80

env:

- name: REDIS

value: "azure-vote-back"

---

apiVersion: v1

kind: Service

metadata:

name: azure-vote-front

spec:

type: LoadBalancer

ports:

- port: 80

selector:

Page 12: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

app: azure-vote-front

kubectl apply -f azure-vote.yaml

test

kubectl get service azure-vote-front –watch

Page 13: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:
Page 14: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

Upgrade a cluster

To minimize disruption to running applications, AKS nodes are carefully cordoned and drained. In

this process, the following steps are performed:

The Kubernetes scheduler prevents additional pods being scheduled on a node that is to be

upgraded.

Running pods on the node are scheduled on other nodes in the cluster.

A node is created that runs the latest Kubernetes components.

When the new node is ready and joined to the cluster, the Kubernetes scheduler begins to run pods

on it.

The old node is deleted, and the next node in the cluster begins the cordon and drain process.

Use the az aks upgrade command to upgrade the AKS cluster.

using cli

az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version

1.15.5

Page 15: Create Kubernetes cluster Login to portal and select ... · Create Kubernetes cluster Login to portal and select kubernetes service On the Basics page, configure the following options:

Confirm that the upgrade was successful using the az aks show command as follows:

Azure CLI

az aks show --resource-group myResourceGroup --name myAKSCluster --output table

Delete the cluster

az group delete --name myResourceGroup --yes --no-wait


Recommended