SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
1 1 / 6 / 2 0 1 8
GANESH POL
Advantages of running K8s on Azure
How to configure K8s on Azure?
Other important notes/observations
Azure K8s Service (AKS)
Author: - GANESH POL, version 0.1.d, last updated on 6
th
Nov 218.
Advantages of running K8s on Azure
 Managed Service Azure k8s is managed service i.e as an end user we should not
concentrate on managing cluster, health check etc.
 Pay Only for worker node :-
o K8s has two types of nodes I.e. master and worker node
o Azure manages Master node for us.
o End user doesn’t need to pay for it.
o End user cannot see it in console.
o Not possible to SSH master node.
 Hybrid Cluster (proposed) :- Microsoft is in process to bring hybrid cluster I,e .
Single cluster with both Windows and Unix based OS. POD designed specifically for
running windows machine will run on windows VM while those for UNIX will run on
Unix VM.
Prerequisite for configuring AKS
 Azure account
 Azure cli
 Kubectl
Steps
1. Login to azure from command line
az login
It will open browser window for providing authentication details. Once successful
authentication done we can perform various operations on Azure from CLI
2. Create resource group
Syntax az group create -n <resource-group-name> -l <azure-location>
Example az group create -n rgroup-neu-mypersonalproject-dev-001 -l
northeurope
It will create resource group named rgroup-neu-mypersonalproject-dev-001 in north
Europe
Please note currently AKS is not available in all Azure locations.
3. Create azure container registry (ACR)
Syntax az acr create -n <name of registry> -g <resource group name> –-sku <sku
type> -l <location>
Example az acr create -n ipmon -g rgroup-neu-mypersonalproject-dev-001 –-sku
Basic -l northeurope
Azure container registry is private docker registry similar to docker hub or AWS Container
registry.
In above example we are creating registry named ipmon in existing resource group named as
rgroup-neu-mypersonalproject-dev-001
4. Login to azure container registry (ACR)
Syntax az acr login - -name <registry-name>
Example az acr login - -name ipmon
to push docker image to registry we need to login azure container registry
5. Push docker image to ACR
 build local docker image and tag it
docker build -t ipmon:dev
 Tag image specific to acr login server
docker tag ipmon:dev ipmon.azurecr.io/ipmon:dev
 Push docker image
docker push ipmon.azurecr.io/ipmon:dev
Author: - GANESH POL, version 0.1.d, last updated on 6
th
Nov 218.
6. Create service principal
 What is service principal?
We can correlate it with AWS ROLE. We attach policy to role to communicate with
other resources in AWS. In same fashion we attach service principal to connect to
other resources.
 What is the purpose of creating service principal in this case?
In next few sections we will create K8s cluster in Azure. This Azure K8s cluster need
to communicate to ACR to pull docker images. In this case we will create service
principal with role reader and specific to our ACR repository.
 Command to create service principal
az ad sp create-for-rbac --skip-assignment
when we execute above command it will provide JSON which contains appid and
password. Please keep note of it as we need to use it in next steops.
 What is rbac?
Rbac :- role based access control
 Purpose of skip-assignment :- --skip-assignment this will avoid additional
permissions being assigned for service principal. Note appId and password.
7. Assign reader role to service principal and assign it specific to our
registry.
Syntax az role assignment create --assignee <app-id> --role Reader --scope
<registry-id>
Example az role assignment create --assignee “f67e8e9c-9af5-4998-a84d-59d95c36957a” --
role Reader --scope "/subscriptions/ 7ede5e80-17cf-4913-b68e-
e9e13a8a4123/resourceGroups/rgroup-neu-mypersonalproject-dev-001/providers/
Microsoft.ContainerRegistry/registries/ipmon"
Please note in above case we can retrieve registry id with the help of following command.
az acr show --name <registryid> --resource-group <resource-group-name> --query "id"
az acr show --name ipmon --resource-group rgroup-neu-mypersonalproject-dev-001 --query "id"
8. Create K8s cluster in Azure.
Syntax az aks create -g <resource-group-name> -n <aks-name> --node-count
<number of VM> --generate-sshkeys --service-principal <appid from service
principal> --client-secret <password from service principal>
Example az aks create -g rgroup-neu-mypersonalproject-dev-001 -n aks-myproject-test-dev-
001 --node-count 1 --generate-sshkeys --service-principal f67e8e9c-9af5-4998-
a84d-59d95c36957a --client-secret dc040ae3-475a-4b87-a1aed0d367dbf292
In above case Azure will create K8s cluster with one node.
9. Deploying app in Azure K8s cluster with manifest file.
 Command for running this is same as we deploy application declaratively in local
k8s cluster
 Difference between local k8s deployment manifest and azure deployment
manifest.
o In azure AKS we need to use image specific to present in ACR
o Type we need to use LoadBalancer instead of NodePort
o Example of this manifest file available at my github repo
Author: - GANESH POL, version 0.1.d, last updated on 6
th
Nov 218.
10. Running example
Please note in following case 40.87.135.10 is IP address obtained by running kubectl get svc
command.
Important notes/observations for Azure AKS
1. When we login Azure console we can see Azure create one more resource group
specific to K8S cluster we created. It has syntax
MC_<resource-group-name>_<AKS-name>_<location>
2. All VM in Azure AKS cluster are linux based. These are acting as worker node. By
looking above screenshot and as explained earlier AKS is managing master node
internally. End user don’t need to pay any money for it.
3. Load balancer IP will be same as what obtained from kubectl get svc command.
4. How to upgrade k8s version in azure
a. Check possible versions to upgrade
i. Syntax.
az aks get-upgrades --resource-group <resource-group-name> -n <name of cluster>-output table
az aks upgrade –
i. Example
az aks get-upgrades --resource-group rgroup-neu-mypersonalproject-dev-001 -n aks-myproject-
test-dev-001 -output table.
Please note in above example it indicates current k8s cluster is 1.9.11 and it is possible to
upgrade 1.1.7 or 1.10.8
b. How to upgrade.
i. syntax
az aks upgrade --resource-group <resource-group-name> -n <aks-name> -kubernetes-version
<version-to-upgrade>
ii. Example
Author: - GANESH POL, version 0.1.d, last updated on 6
th
Nov 218.
az aks upgrade --resource-group rgroup-neu-mypersonalproject-dev-001 -n aks-myproject-
test-dev-001 -kubernetes-version 1.10.7
Please note if we are having more than one worker node running in cluster and we are
planning to upgrade K8s cluster version then it will not have any down time.
.

Contenu connexe

Tendances

Docker For Azure Deployment Walkthrough
Docker For Azure Deployment WalkthroughDocker For Azure Deployment Walkthrough
Docker For Azure Deployment WalkthroughTimothy Wong
 
Running your Java EE 6 applications in the cloud
Running your Java EE 6 applications in the cloudRunning your Java EE 6 applications in the cloud
Running your Java EE 6 applications in the cloudArun Gupta
 
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30thMAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30thChristian "kiko" Reis
 
Ansible-for-openstack
Ansible-for-openstackAnsible-for-openstack
Ansible-for-openstackUdayendu Kar
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaBasics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaSahil Davawala
 
Hands-on Lab: re-Modernize - Updating and Consolidating MySQL
Hands-on Lab: re-Modernize - Updating and Consolidating MySQLHands-on Lab: re-Modernize - Updating and Consolidating MySQL
Hands-on Lab: re-Modernize - Updating and Consolidating MySQLAmazon Web Services
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKI Goo Lee
 
Openstack glance
Openstack glanceOpenstack glance
Openstack glanceSHAMEEM F
 
Eclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applicationsEclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applicationsjochen.hiller
 
Integrating OpenStack with Active Directory
Integrating OpenStack with Active DirectoryIntegrating OpenStack with Active Directory
Integrating OpenStack with Active Directorycjellick
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKYoungHeon (Roy) Kim
 
Setting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in KubernetesSetting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in KubernetesElizabeth Yu, MBA
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupAnanth Padmanabhan
 
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMANagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMANagios
 
Building Windows Images with Packer
Building Windows Images with PackerBuilding Windows Images with Packer
Building Windows Images with PackerMatt Wrock
 
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with NagiosNagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with NagiosNagios
 

Tendances (20)

Docker For Azure Deployment Walkthrough
Docker For Azure Deployment WalkthroughDocker For Azure Deployment Walkthrough
Docker For Azure Deployment Walkthrough
 
Ansible container
Ansible containerAnsible container
Ansible container
 
Running your Java EE 6 applications in the cloud
Running your Java EE 6 applications in the cloudRunning your Java EE 6 applications in the cloud
Running your Java EE 6 applications in the cloud
 
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30thMAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
 
Ansible-for-openstack
Ansible-for-openstackAnsible-for-openstack
Ansible-for-openstack
 
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony LinAnsible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaBasics of Ansible - Sahil Davawala
Basics of Ansible - Sahil Davawala
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
Hands-on Lab: re-Modernize - Updating and Consolidating MySQL
Hands-on Lab: re-Modernize - Updating and Consolidating MySQLHands-on Lab: re-Modernize - Updating and Consolidating MySQL
Hands-on Lab: re-Modernize - Updating and Consolidating MySQL
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Openstack glance
Openstack glanceOpenstack glance
Openstack glance
 
Eclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applicationsEclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applications
 
Integrating OpenStack with Active Directory
Integrating OpenStack with Active DirectoryIntegrating OpenStack with Active Directory
Integrating OpenStack with Active Directory
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Setting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in KubernetesSetting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in Kubernetes
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetup
 
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMANagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
Nagios Conference 2014 - Troy Lea - Monitoring VMware Virtualization Using vMA
 
Building Windows Images with Packer
Building Windows Images with PackerBuilding Windows Images with Packer
Building Windows Images with Packer
 
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with NagiosNagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
 
Amazed by aws 1st session
Amazed by aws 1st sessionAmazed by aws 1st session
Amazed by aws 1st session
 

Similaire à k8s-on-azure

Dockerized .Net Core based app services in azure K8s
Dockerized .Net Core based app services in azure K8s Dockerized .Net Core based app services in azure K8s
Dockerized .Net Core based app services in azure K8s Ranjeet Bhargava
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila
 
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...QCloudMentor
 
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...Davide Benvegnù
 
Bdc from bare metal to k8s
Bdc   from bare metal to k8sBdc   from bare metal to k8s
Bdc from bare metal to k8sChris Adkin
 
VSTS Release Pipelines with Kubernetes
VSTS Release Pipelines with KubernetesVSTS Release Pipelines with Kubernetes
VSTS Release Pipelines with KubernetesMarc Müller
 
What Is AWS Elastic Kubernetes Service
 What Is AWS Elastic Kubernetes Service What Is AWS Elastic Kubernetes Service
What Is AWS Elastic Kubernetes ServiceAMELIAOLIVIA2
 
1. CNCF kubernetes meetup - Ondrej Sika
1. CNCF kubernetes meetup - Ondrej Sika1. CNCF kubernetes meetup - Ondrej Sika
1. CNCF kubernetes meetup - Ondrej SikaJuraj Hantak
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSLaura Frank Tacho
 
Building a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKSBuilding a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKSDevOps.com
 
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsAndrey Karpov
 
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016Amazon Web Services Korea
 
Monitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesMonitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesAmazon Web Services
 
Ansible Automation Inside Cloudforms ( Embedded Ansible)
Ansible Automation Inside Cloudforms ( Embedded Ansible)Ansible Automation Inside Cloudforms ( Embedded Ansible)
Ansible Automation Inside Cloudforms ( Embedded Ansible)Prasad Mukhedkar
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAmazon Web Services
 
Kubernetes Summit 2018 - Kubernetes: Stateless -> Stateful
Kubernetes Summit 2018 - Kubernetes: Stateless -> StatefulKubernetes Summit 2018 - Kubernetes: Stateless -> Stateful
Kubernetes Summit 2018 - Kubernetes: Stateless -> Statefulsmalltown
 
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS SummitAutomatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS SummitAmazon Web Services
 

Similaire à k8s-on-azure (20)

Dockerized .Net Core based app services in azure K8s
Dockerized .Net Core based app services in azure K8s Dockerized .Net Core based app services in azure K8s
Dockerized .Net Core based app services in azure K8s
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
 
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
 
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
 
Bdc from bare metal to k8s
Bdc   from bare metal to k8sBdc   from bare metal to k8s
Bdc from bare metal to k8s
 
VSTS Release Pipelines with Kubernetes
VSTS Release Pipelines with KubernetesVSTS Release Pipelines with Kubernetes
VSTS Release Pipelines with Kubernetes
 
What Is AWS Elastic Kubernetes Service
 What Is AWS Elastic Kubernetes Service What Is AWS Elastic Kubernetes Service
What Is AWS Elastic Kubernetes Service
 
1. CNCF kubernetes meetup - Ondrej Sika
1. CNCF kubernetes meetup - Ondrej Sika1. CNCF kubernetes meetup - Ondrej Sika
1. CNCF kubernetes meetup - Ondrej Sika
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKS
 
Building a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKSBuilding a Kubernetes App with Amazon EKS
Building a Kubernetes App with Amazon EKS
 
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation Slides
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
 
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
대용량 데이타 쉽고 빠르게 분석하기 :: 김일호 솔루션즈 아키텍트 :: Gaming on AWS 2016
 
Monitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesMonitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar Series
 
AWS Serverless Workshop
AWS Serverless WorkshopAWS Serverless Workshop
AWS Serverless Workshop
 
Ansible Automation Inside Cloudforms ( Embedded Ansible)
Ansible Automation Inside Cloudforms ( Embedded Ansible)Ansible Automation Inside Cloudforms ( Embedded Ansible)
Ansible Automation Inside Cloudforms ( Embedded Ansible)
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
 
Kubernetes Summit 2018 - Kubernetes: Stateless -> Stateful
Kubernetes Summit 2018 - Kubernetes: Stateless -> StatefulKubernetes Summit 2018 - Kubernetes: Stateless -> Stateful
Kubernetes Summit 2018 - Kubernetes: Stateless -> Stateful
 
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS SummitAutomatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
 

Dernier

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 

Dernier (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 

k8s-on-azure

  • 1. 1 1 / 6 / 2 0 1 8 GANESH POL Advantages of running K8s on Azure How to configure K8s on Azure? Other important notes/observations Azure K8s Service (AKS)
  • 2. Author: - GANESH POL, version 0.1.d, last updated on 6 th Nov 218. Advantages of running K8s on Azure  Managed Service Azure k8s is managed service i.e as an end user we should not concentrate on managing cluster, health check etc.  Pay Only for worker node :- o K8s has two types of nodes I.e. master and worker node o Azure manages Master node for us. o End user doesn’t need to pay for it. o End user cannot see it in console. o Not possible to SSH master node.  Hybrid Cluster (proposed) :- Microsoft is in process to bring hybrid cluster I,e . Single cluster with both Windows and Unix based OS. POD designed specifically for running windows machine will run on windows VM while those for UNIX will run on Unix VM. Prerequisite for configuring AKS  Azure account  Azure cli  Kubectl Steps 1. Login to azure from command line az login It will open browser window for providing authentication details. Once successful authentication done we can perform various operations on Azure from CLI 2. Create resource group Syntax az group create -n <resource-group-name> -l <azure-location> Example az group create -n rgroup-neu-mypersonalproject-dev-001 -l northeurope It will create resource group named rgroup-neu-mypersonalproject-dev-001 in north Europe Please note currently AKS is not available in all Azure locations. 3. Create azure container registry (ACR) Syntax az acr create -n <name of registry> -g <resource group name> –-sku <sku type> -l <location> Example az acr create -n ipmon -g rgroup-neu-mypersonalproject-dev-001 –-sku Basic -l northeurope Azure container registry is private docker registry similar to docker hub or AWS Container registry. In above example we are creating registry named ipmon in existing resource group named as rgroup-neu-mypersonalproject-dev-001 4. Login to azure container registry (ACR) Syntax az acr login - -name <registry-name> Example az acr login - -name ipmon to push docker image to registry we need to login azure container registry 5. Push docker image to ACR  build local docker image and tag it docker build -t ipmon:dev  Tag image specific to acr login server docker tag ipmon:dev ipmon.azurecr.io/ipmon:dev  Push docker image docker push ipmon.azurecr.io/ipmon:dev
  • 3. Author: - GANESH POL, version 0.1.d, last updated on 6 th Nov 218. 6. Create service principal  What is service principal? We can correlate it with AWS ROLE. We attach policy to role to communicate with other resources in AWS. In same fashion we attach service principal to connect to other resources.  What is the purpose of creating service principal in this case? In next few sections we will create K8s cluster in Azure. This Azure K8s cluster need to communicate to ACR to pull docker images. In this case we will create service principal with role reader and specific to our ACR repository.  Command to create service principal az ad sp create-for-rbac --skip-assignment when we execute above command it will provide JSON which contains appid and password. Please keep note of it as we need to use it in next steops.  What is rbac? Rbac :- role based access control  Purpose of skip-assignment :- --skip-assignment this will avoid additional permissions being assigned for service principal. Note appId and password. 7. Assign reader role to service principal and assign it specific to our registry. Syntax az role assignment create --assignee <app-id> --role Reader --scope <registry-id> Example az role assignment create --assignee “f67e8e9c-9af5-4998-a84d-59d95c36957a” -- role Reader --scope "/subscriptions/ 7ede5e80-17cf-4913-b68e- e9e13a8a4123/resourceGroups/rgroup-neu-mypersonalproject-dev-001/providers/ Microsoft.ContainerRegistry/registries/ipmon" Please note in above case we can retrieve registry id with the help of following command. az acr show --name <registryid> --resource-group <resource-group-name> --query "id" az acr show --name ipmon --resource-group rgroup-neu-mypersonalproject-dev-001 --query "id" 8. Create K8s cluster in Azure. Syntax az aks create -g <resource-group-name> -n <aks-name> --node-count <number of VM> --generate-sshkeys --service-principal <appid from service principal> --client-secret <password from service principal> Example az aks create -g rgroup-neu-mypersonalproject-dev-001 -n aks-myproject-test-dev- 001 --node-count 1 --generate-sshkeys --service-principal f67e8e9c-9af5-4998- a84d-59d95c36957a --client-secret dc040ae3-475a-4b87-a1aed0d367dbf292 In above case Azure will create K8s cluster with one node. 9. Deploying app in Azure K8s cluster with manifest file.  Command for running this is same as we deploy application declaratively in local k8s cluster  Difference between local k8s deployment manifest and azure deployment manifest. o In azure AKS we need to use image specific to present in ACR o Type we need to use LoadBalancer instead of NodePort o Example of this manifest file available at my github repo
  • 4. Author: - GANESH POL, version 0.1.d, last updated on 6 th Nov 218. 10. Running example Please note in following case 40.87.135.10 is IP address obtained by running kubectl get svc command. Important notes/observations for Azure AKS 1. When we login Azure console we can see Azure create one more resource group specific to K8S cluster we created. It has syntax MC_<resource-group-name>_<AKS-name>_<location> 2. All VM in Azure AKS cluster are linux based. These are acting as worker node. By looking above screenshot and as explained earlier AKS is managing master node internally. End user don’t need to pay any money for it. 3. Load balancer IP will be same as what obtained from kubectl get svc command. 4. How to upgrade k8s version in azure a. Check possible versions to upgrade i. Syntax. az aks get-upgrades --resource-group <resource-group-name> -n <name of cluster>-output table az aks upgrade – i. Example az aks get-upgrades --resource-group rgroup-neu-mypersonalproject-dev-001 -n aks-myproject- test-dev-001 -output table. Please note in above example it indicates current k8s cluster is 1.9.11 and it is possible to upgrade 1.1.7 or 1.10.8 b. How to upgrade. i. syntax az aks upgrade --resource-group <resource-group-name> -n <aks-name> -kubernetes-version <version-to-upgrade> ii. Example
  • 5. Author: - GANESH POL, version 0.1.d, last updated on 6 th Nov 218. az aks upgrade --resource-group rgroup-neu-mypersonalproject-dev-001 -n aks-myproject- test-dev-001 -kubernetes-version 1.10.7 Please note if we are having more than one worker node running in cluster and we are planning to upgrade K8s cluster version then it will not have any down time. .