SlideShare a Scribd company logo
Install Kubernetes Cluster on Azure Platform using
KubeSpray
Prerequisite:
1. Azure Account
Setup system:
1. Install azure cli (choose any method of your choice)
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
2. Install ansible
We can install it from different ways but i install using pip
pip3 install ansible>=2.4.0
pip3 install ansible-modules-hashivault>=3.9.4
Installation:
1. Clone Code:
git clone https://github.com/kubernetes-incubator/kubespray.git
2. Configure Files:
a. cd kubespray
b. cp -r inventory/sample/ inventory/azcluster
c. Add Azure Detail
vi ./inventory/azcluster/group_vars/all.yml
Note: Check Appendix-1 for more Detail
d. Configure Node related info
vi contrib/azurerm/group_vars/all
e. Create infra
cd /kubespray/contrib/azurerm
./apply-rg.sh op-np [op-np is resource group in my case]
f. Create Inventory file
./generate-inventory.sh op-np
cd ..
check inventory file at vi contrib/azurerm/inventory
g. Create New Node (optional)
edit file vi contrib/azurerm/group_vars/all
repeat step e & f
h. Delete infra
cd /kubespray/contrib/azurerm
./clear-rg.sh op-np
3. Configure Kubernetes
a. First Time
ansible-playbook -i contrib/azurerm/inventory -u clusteradmin --become -e
"@inventory/azcluster/group_vars/all.yml" -e
kube_network_plugin=flannel -e network_plugin=flannel -e
dns_domain=cluster.local cluster.yml -b -v --private-key=privatekey
b. Add Node [Follow steps define in 2g section before doing this]
ansible-playbook -i contrib/azurerm/inventory -u clusteradmin --become -e
"@inventory/azcluster/group_vars/all.yml" -e
kube_network_plugin=flannel -e network_plugin=flannel -e
dns_domain=cluster.local scale.yml --limit nodename2 -b -v --private-
key=privatekey
c. Delete Node
ansible-playbook -i contrib/azurerm/inventory -u clusteradmin --become -e
"@inventory/azcluster/group_vars/all.yml" remove-node.yml -b -v --
private-key=privatekey --extra-vars "node=nodename1,nodename2”
Appendix-1:
A. What All parameters should be update:
a. Cloud_provider: azure
b. azure_tenant_id + azure_subscription_id:
i. az account show
c. azure_aad_client_id:
i. Create an Azure AD Application run command “az ad app create --
display-name kubernetes --identifier-uris http://kubernetes” [get app
id]
ii. Create Service principal for the application run command:
az ad sp create --id <app-id>
iii. Create the role assignments run command:
az ad app create --display-name kubernetestest1 --identifier-uris
http://kubernetes --password dfdf678002fdfdy8obdYHhv
d. Azure_aad_client_secret: dfdf678002fdfdy8obdYHhv
e. azure_resource_group: op-np
Note: create resource group if not “az group create --name op-np --
location eastasia” (in this example i am using op-np u can use your own
name)
f. Azure_location: eastasia
g. azure_subnet_name: minion-subnet
h. azure_security_group_name: op-np
i. azure_vnet_name: KubeVNET
j. azure_vnet_resource_group: op-np
k. Azure_route_table_name: routetable
Appendix-2:Troubleshooting
A. If some user get error of storage account name already exist
Sol: edit storageAccountName in file “vi roles/generate-
templates/defaults/main.yml”

More Related Content

What's hot (20)

PDF
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Jo Hoon
 
PPTX
How to Troubleshoot OpenStack Without Losing Sleep
Sadique Puthen
 
PPTX
Kubernetes Security
Karthik Gaekwad
 
PDF
Zararlı Yazılım Analizi (ÖZET)
Alper Başaran
 
PDF
Evolution of containers to kubernetes
Krishna-Kumar
 
PPTX
Helm.pptx
SISTechnologies
 
PPTX
GIT presentation
Naim Latifi
 
PDF
Amazon EKS를 위한 AWS CDK와 CDK8s 활용법 - 염지원, 김광영 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
Amazon Web Services Korea
 
PDF
How MITRE ATT&CK helps security operations
Sergey Soldatov
 
PDF
MySQL Cluster 8.0 tutorial
Frazer Clement
 
PPTX
Introduction to helm
Jeeva Chelladhurai
 
PDF
Running Kubernetes in hybrid environments with AWS (EKS Distro & EKS Anywhere...
Amazon Web Services Korea
 
PDF
Room 3 - 1 - Nguyễn Xuân Trường Lâm - Zero touch on-premise storage infrastru...
Vietnam Open Infrastructure User Group
 
PDF
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
PDF
An Introduction to Kubernetes
Imesh Gunaratne
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
PPTX
EKS workshop 살펴보기
Jinwoong Kim
 
PDF
Docker London: Container Security
Phil Estes
 
PPTX
K8s security best practices
Sharon Vendrov
 
PDF
kubernetes for beginners
Dominique Dumont
 
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Jo Hoon
 
How to Troubleshoot OpenStack Without Losing Sleep
Sadique Puthen
 
Kubernetes Security
Karthik Gaekwad
 
Zararlı Yazılım Analizi (ÖZET)
Alper Başaran
 
Evolution of containers to kubernetes
Krishna-Kumar
 
Helm.pptx
SISTechnologies
 
GIT presentation
Naim Latifi
 
Amazon EKS를 위한 AWS CDK와 CDK8s 활용법 - 염지원, 김광영 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
Amazon Web Services Korea
 
How MITRE ATT&CK helps security operations
Sergey Soldatov
 
MySQL Cluster 8.0 tutorial
Frazer Clement
 
Introduction to helm
Jeeva Chelladhurai
 
Running Kubernetes in hybrid environments with AWS (EKS Distro & EKS Anywhere...
Amazon Web Services Korea
 
Room 3 - 1 - Nguyễn Xuân Trường Lâm - Zero touch on-premise storage infrastru...
Vietnam Open Infrastructure User Group
 
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
An Introduction to Kubernetes
Imesh Gunaratne
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
EKS workshop 살펴보기
Jinwoong Kim
 
Docker London: Container Security
Phil Estes
 
K8s security best practices
Sharon Vendrov
 
kubernetes for beginners
Dominique Dumont
 

Similar to Install Kubernetes Cluster on Azure Platform using kubespray (20)

PDF
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Tenchi Security
 
PDF
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Alexandre Sieira
 
ODP
Ansible Automation Inside Cloudforms ( Embedded Ansible)
Prasad Mukhedkar
 
PDF
What Is AWS Elastic Kubernetes Service
AMELIAOLIVIA2
 
PPTX
ARGUS - THE OMNISCIENT CI
Cosmin Poieana
 
PDF
k8s-on-azure
Ganesh Pol
 
PPTX
Infraestrutura Imutável na AWS usando Packer, Ansible, CloudFormation e Kuber...
Rodrigo Fior Kuntzer
 
PPTX
From 0 to 60 with kubernetes and istio
Joonathan Mägi
 
PDF
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
Takayoshi Tanaka
 
PDF
New features of Azure Cloud Provider at OCP 3.10
Takayoshi Tanaka
 
PDF
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila
 
PDF
Multinode kubernetes-cluster
Ram Nath
 
PDF
Build containerized application using Docker and Azure.pdf
Hamida Rebai Trabelsi
 
DOCX
SCasia 2018 MSFT hands on session for Azure Batch AI
Hiroshi Tanaka
 
PPTX
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
ssuser92b4be
 
PDF
Setting up a kubernetes cluster on ubuntu 18.04- loves cloud
Loves Cloud
 
PDF
Kubernetes installation
Ahmed Mekawy
 
PDF
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
ODP
AWS ground zero; EC2 & S3 hands-on
Vitor Domingos
 
PPTX
Azure cli-azure devops
Thi Nguyen Dinh
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Tenchi Security
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Alexandre Sieira
 
Ansible Automation Inside Cloudforms ( Embedded Ansible)
Prasad Mukhedkar
 
What Is AWS Elastic Kubernetes Service
AMELIAOLIVIA2
 
ARGUS - THE OMNISCIENT CI
Cosmin Poieana
 
k8s-on-azure
Ganesh Pol
 
Infraestrutura Imutável na AWS usando Packer, Ansible, CloudFormation e Kuber...
Rodrigo Fior Kuntzer
 
From 0 to 60 with kubernetes and istio
Joonathan Mägi
 
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
Takayoshi Tanaka
 
New features of Azure Cloud Provider at OCP 3.10
Takayoshi Tanaka
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila
 
Multinode kubernetes-cluster
Ram Nath
 
Build containerized application using Docker and Azure.pdf
Hamida Rebai Trabelsi
 
SCasia 2018 MSFT hands on session for Azure Batch AI
Hiroshi Tanaka
 
kubeadm Cluster Creation Internals_ From Self-Hosting to Upgradability and HA...
ssuser92b4be
 
Setting up a kubernetes cluster on ubuntu 18.04- loves cloud
Loves Cloud
 
Kubernetes installation
Ahmed Mekawy
 
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
AWS ground zero; EC2 & S3 hands-on
Vitor Domingos
 
Azure cli-azure devops
Thi Nguyen Dinh
 
Ad

Recently uploaded (20)

PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Ad

Install Kubernetes Cluster on Azure Platform using kubespray

  • 1. Install Kubernetes Cluster on Azure Platform using KubeSpray Prerequisite: 1. Azure Account Setup system: 1. Install azure cli (choose any method of your choice) https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest 2. Install ansible We can install it from different ways but i install using pip pip3 install ansible>=2.4.0 pip3 install ansible-modules-hashivault>=3.9.4 Installation: 1. Clone Code: git clone https://github.com/kubernetes-incubator/kubespray.git 2. Configure Files: a. cd kubespray b. cp -r inventory/sample/ inventory/azcluster c. Add Azure Detail vi ./inventory/azcluster/group_vars/all.yml Note: Check Appendix-1 for more Detail d. Configure Node related info vi contrib/azurerm/group_vars/all e. Create infra cd /kubespray/contrib/azurerm ./apply-rg.sh op-np [op-np is resource group in my case] f. Create Inventory file ./generate-inventory.sh op-np cd .. check inventory file at vi contrib/azurerm/inventory g. Create New Node (optional) edit file vi contrib/azurerm/group_vars/all repeat step e & f
  • 2. h. Delete infra cd /kubespray/contrib/azurerm ./clear-rg.sh op-np 3. Configure Kubernetes a. First Time ansible-playbook -i contrib/azurerm/inventory -u clusteradmin --become -e "@inventory/azcluster/group_vars/all.yml" -e kube_network_plugin=flannel -e network_plugin=flannel -e dns_domain=cluster.local cluster.yml -b -v --private-key=privatekey b. Add Node [Follow steps define in 2g section before doing this] ansible-playbook -i contrib/azurerm/inventory -u clusteradmin --become -e "@inventory/azcluster/group_vars/all.yml" -e kube_network_plugin=flannel -e network_plugin=flannel -e dns_domain=cluster.local scale.yml --limit nodename2 -b -v --private- key=privatekey c. Delete Node ansible-playbook -i contrib/azurerm/inventory -u clusteradmin --become -e "@inventory/azcluster/group_vars/all.yml" remove-node.yml -b -v -- private-key=privatekey --extra-vars "node=nodename1,nodename2”
  • 3. Appendix-1: A. What All parameters should be update: a. Cloud_provider: azure b. azure_tenant_id + azure_subscription_id: i. az account show c. azure_aad_client_id: i. Create an Azure AD Application run command “az ad app create -- display-name kubernetes --identifier-uris http://kubernetes” [get app id] ii. Create Service principal for the application run command:
  • 4. az ad sp create --id <app-id> iii. Create the role assignments run command: az ad app create --display-name kubernetestest1 --identifier-uris http://kubernetes --password dfdf678002fdfdy8obdYHhv d. Azure_aad_client_secret: dfdf678002fdfdy8obdYHhv e. azure_resource_group: op-np Note: create resource group if not “az group create --name op-np -- location eastasia” (in this example i am using op-np u can use your own name) f. Azure_location: eastasia g. azure_subnet_name: minion-subnet h. azure_security_group_name: op-np i. azure_vnet_name: KubeVNET j. azure_vnet_resource_group: op-np k. Azure_route_table_name: routetable
  • 5. Appendix-2:Troubleshooting A. If some user get error of storage account name already exist Sol: edit storageAccountName in file “vi roles/generate- templates/defaults/main.yml”