SlideShare a Scribd company logo
Kubespray
Deploy Kubernetes Cluster with Ansible
David Chang
Linkernetworks
BackEnd, DevOps,
Kubernetes
Headlines
• Deploy a K8s cluster on laptop
• Talk a little about Vagrant, a VM managing tool
• Kubespray & Ansible
• Try our localhost K8s cluster
Prerequisite
• virtualbox 5.1+ https://www.virtualbox.org/wiki/Downloads
• vagrant 2.0.x+ https://www.vagrantup.com/downloads.html
Install Ansible
# Ubuntu
apt-add-repository ppa:ansible/ansible 
&& apt-get update 
&& apt-get install -y python3 ansible
&& pip install netaddr
# Mac
pip install ansible
pip install netaddr
port install py27-netaddr # if you’re using MacPort
# netaddr is required by Kubespray
Let’s Get Started
clone https://github.com/kubernetes-incubator/kubespray.git
cd kubespray
vagrant up
# All done.
Let’s get to more details while waiting.
(It takes about 20 mins on my Mac lol)
Virtualbox
• K8s runs on servers, and Virtualbox is our server
virtualizer
• Virtualbox come with GUI, but we don’t use it because
• Clicking is time-consuming and engineers are lazy
• Bad for automation. Manual operation causes mistake.
• Lack of scalability. We can click 10 VMs but how about
100+ VMs.
Vagrant
• Kubespray provides vagrant for deploy K8s on VMs.
• Vagrant create you VMs with Vagrtantfile, a ruby based
script.
• A script is essential for automation.
• Vagrant bring VMs up & down within 1 command.
https://www.vagrantup.com/
Vagrant Operations
vagrant up (already done)
vagrant status
vagrant ssh k8s-01
vagrant destroy
What vagrant do?
• After vagrant up, vagrant create VMs with virtual box
• Vagrant also make necessary provisions to VMs
• Vagrant deploy k8s on to VMs with Kubespray
Vagrant & CICD
• Commit Vagrantfile to source code
• Bring VMs up & down
• Testing app on K8s and VMs
• Clean up VMs with vagrant
Ansible
• Ansible is a IT automation tools.
• Ansible-playbook is a script to modify remote servers
• Check components status on each step
• Come with lots of handy tools
(better than shell script)
Kubespray
• Deploy k8s with ansible-playbook
• Available on AWS, GCE, or baremetal
• High Available cluster
• Install K8s components to each servers
https://github.com/kubernetes-incubator/kubespray
Done!!
Test with Kubectl
Kubectl
• Kubectl is a k8s client tool to control k8s cluster
• Kubectl convert commands to API call to k8s cluster API
server
• Kubectl use authorized context
Deploy to Real Servers
• ansible-playbook
http://docs.ansible.com/ansible/latest/intro_installation.htm
l
• kubectl https://kubernetes.io/docs/tasks/tools/install-
kubectl/
• Check inventory/mycluster/hosts.ini
• playbook -i inventory/myCluster/hosts.ini cluster.yml
Thank you

More Related Content

PPTX
Deploying Kubernetes on GCP with Kubespray
PPTX
Spinnaker for Azure
PDF
Spinnaker - Bay Area AWS Meetup - 20160726
PDF
Orchestrating VM & Container Deployments
PPT
Spinnaker VLDB 2011
PPTX
Configure Grafana Chat Bot with GitHub Hubot and SLACK.
PPTX
Challenges of Kubernetes On-premise Deployment
PDF
Spinnaker Chadev
Deploying Kubernetes on GCP with Kubespray
Spinnaker for Azure
Spinnaker - Bay Area AWS Meetup - 20160726
Orchestrating VM & Container Deployments
Spinnaker VLDB 2011
Configure Grafana Chat Bot with GitHub Hubot and SLACK.
Challenges of Kubernetes On-premise Deployment
Spinnaker Chadev

What's hot (20)

PDF
Cloud Native User Group: Prometheus Day 2
PPT
AWS migration: getting to Data Center heaven with AWS and Chef
PPTX
Journey to Microservice architecture via Amazon Lambda
PPTX
Continuous Deployment to the Cloud using Spinnaker
PDF
Integrating Puppet with Cloud Infrastructures-Remco Overdijk
PDF
reBuy on Kubernetes
PDF
Cloudformation vs terraform_vs_ansible
PDF
My early experience with Mirantis OpenStack 6.0
PPTX
Serverless on Kubernetes
PDF
Ansible and CloudStack
PDF
reInvent 2021 Recap and k9s review
PDF
Kubernetes User Group: 維運 Kubernetes 的兩三事
PDF
Docker Summit 2016 - Kubernetes: Sweets and Bitters
PDF
DevOps Summit 2016 - The immutable Journey
PPTX
GlobalAzureBootCamp 2018
PDF
Micro services infrastructure with AWS and Ansible
PDF
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
PDF
Open source and cross platform .net
PDF
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
PDF
AgileTW Feat. DevOpsTW: 維運 Kubernetes 的兩三事
Cloud Native User Group: Prometheus Day 2
AWS migration: getting to Data Center heaven with AWS and Chef
Journey to Microservice architecture via Amazon Lambda
Continuous Deployment to the Cloud using Spinnaker
Integrating Puppet with Cloud Infrastructures-Remco Overdijk
reBuy on Kubernetes
Cloudformation vs terraform_vs_ansible
My early experience with Mirantis OpenStack 6.0
Serverless on Kubernetes
Ansible and CloudStack
reInvent 2021 Recap and k9s review
Kubernetes User Group: 維運 Kubernetes 的兩三事
Docker Summit 2016 - Kubernetes: Sweets and Bitters
DevOps Summit 2016 - The immutable Journey
GlobalAzureBootCamp 2018
Micro services infrastructure with AWS and Ansible
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
Open source and cross platform .net
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
AgileTW Feat. DevOpsTW: 維運 Kubernetes 的兩三事
Ad

Similar to Deploy High Availability Kubernetes with Kubespray (20)

PDF
Automating with ansible (Part B)
PPT
Fake IT, until you make IT
PDF
Cncf meetup kubespray
PPTX
KuberneteSADASDSADASDASDASDASDASDAs Labs.pptx
PPTX
DevOps, A brief introduction to Vagrant & Ansible
PDF
Mihai Criveti - PyCon Ireland - Automate Everything
PDF
ShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
PDF
Vagrant Workshop
PDF
Vagrant For DevOps
PPTX
Ansible E2E Testing
PDF
Kubernetes for Java Developers
PPTX
A Million ways of Deploying a Kubernetes Cluster
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
PDF
Take Home Your Very Own Free Vagrant CFML Dev Environment
PDF
Kubernetes Basis: Pods, Deployments, and Services
PDF
Local development environment through virtualisation
PPTX
Vagrant to-aws-flow
PDF
Automated Deployment and Configuration Engines. Ansible
PDF
[WSO2Con Asia 2018] Deploying Applications in K8S and Docker
PDF
Run K8s on Local Environment
Automating with ansible (Part B)
Fake IT, until you make IT
Cncf meetup kubespray
KuberneteSADASDSADASDASDASDASDASDAs Labs.pptx
DevOps, A brief introduction to Vagrant & Ansible
Mihai Criveti - PyCon Ireland - Automate Everything
ShipItCon - Continuous Deployment and Multicloud with Ansible and Kubernetes
Vagrant Workshop
Vagrant For DevOps
Ansible E2E Testing
Kubernetes for Java Developers
A Million ways of Deploying a Kubernetes Cluster
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take Home Your Very Own Free Vagrant CFML Dev Environment
Kubernetes Basis: Pods, Deployments, and Services
Local development environment through virtualisation
Vagrant to-aws-flow
Automated Deployment and Configuration Engines. Ansible
[WSO2Con Asia 2018] Deploying Applications in K8S and Docker
Run K8s on Local Environment
Ad

More from Che-Chia Chang (8)

PDF
COSCUP Scouter: Face recognizer retrieves your Github contribution
PPTX
Intro to go web assembly
PDF
Elk for applications on k8s
PDF
Gdg devfest-2018
PDF
CRI, OCI, and CRI-O
PPTX
Kubernetes networks
PPTX
Automated container-deployment-on-kubernetes
PDF
K8s storage-glusterfs-20180210
COSCUP Scouter: Face recognizer retrieves your Github contribution
Intro to go web assembly
Elk for applications on k8s
Gdg devfest-2018
CRI, OCI, and CRI-O
Kubernetes networks
Automated container-deployment-on-kubernetes
K8s storage-glusterfs-20180210

Recently uploaded (20)

PPTX
E -tech empowerment technologies PowerPoint
PPTX
Layers_of_the_Earth_Grade7.pptx class by
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
Uptota Investor Deck - Where Africa Meets Blockchain
PPTX
Introduction to cybersecurity and digital nettiquette
PPTX
Slides PPTX: World Game (s): Eco Economic Epochs.pptx
PPT
Ethics in Information System - Management Information System
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PDF
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PPTX
t_and_OpenAI_Combined_two_pressentations
PPTX
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
SAP Ariba Sourcing PPT for learning material
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
Slides PDF: The World Game (s) Eco Economic Epochs.pdf
PPTX
artificial intelligence overview of it and more
E -tech empowerment technologies PowerPoint
Layers_of_the_Earth_Grade7.pptx class by
simpleintnettestmetiaerl for the simple testint
Mathew Digital SEO Checklist Guidlines 2025
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Uptota Investor Deck - Where Africa Meets Blockchain
Introduction to cybersecurity and digital nettiquette
Slides PPTX: World Game (s): Eco Economic Epochs.pptx
Ethics in Information System - Management Information System
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
t_and_OpenAI_Combined_two_pressentations
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
SASE Traffic Flow - ZTNA Connector-1.pdf
SAP Ariba Sourcing PPT for learning material
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Slides PDF: The World Game (s) Eco Economic Epochs.pdf
artificial intelligence overview of it and more

Deploy High Availability Kubernetes with Kubespray

  • 3. Headlines • Deploy a K8s cluster on laptop • Talk a little about Vagrant, a VM managing tool • Kubespray & Ansible • Try our localhost K8s cluster
  • 4. Prerequisite • virtualbox 5.1+ https://www.virtualbox.org/wiki/Downloads • vagrant 2.0.x+ https://www.vagrantup.com/downloads.html
  • 5. Install Ansible # Ubuntu apt-add-repository ppa:ansible/ansible && apt-get update && apt-get install -y python3 ansible && pip install netaddr # Mac pip install ansible pip install netaddr port install py27-netaddr # if you’re using MacPort # netaddr is required by Kubespray
  • 6. Let’s Get Started clone https://github.com/kubernetes-incubator/kubespray.git cd kubespray vagrant up # All done. Let’s get to more details while waiting. (It takes about 20 mins on my Mac lol)
  • 7. Virtualbox • K8s runs on servers, and Virtualbox is our server virtualizer • Virtualbox come with GUI, but we don’t use it because • Clicking is time-consuming and engineers are lazy • Bad for automation. Manual operation causes mistake. • Lack of scalability. We can click 10 VMs but how about 100+ VMs.
  • 8. Vagrant • Kubespray provides vagrant for deploy K8s on VMs. • Vagrant create you VMs with Vagrtantfile, a ruby based script. • A script is essential for automation. • Vagrant bring VMs up & down within 1 command. https://www.vagrantup.com/
  • 9. Vagrant Operations vagrant up (already done) vagrant status vagrant ssh k8s-01 vagrant destroy
  • 10. What vagrant do? • After vagrant up, vagrant create VMs with virtual box • Vagrant also make necessary provisions to VMs • Vagrant deploy k8s on to VMs with Kubespray
  • 11. Vagrant & CICD • Commit Vagrantfile to source code • Bring VMs up & down • Testing app on K8s and VMs • Clean up VMs with vagrant
  • 12. Ansible • Ansible is a IT automation tools. • Ansible-playbook is a script to modify remote servers • Check components status on each step • Come with lots of handy tools (better than shell script)
  • 13. Kubespray • Deploy k8s with ansible-playbook • Available on AWS, GCE, or baremetal • High Available cluster • Install K8s components to each servers https://github.com/kubernetes-incubator/kubespray
  • 16. Kubectl • Kubectl is a k8s client tool to control k8s cluster • Kubectl convert commands to API call to k8s cluster API server • Kubectl use authorized context
  • 17. Deploy to Real Servers • ansible-playbook http://docs.ansible.com/ansible/latest/intro_installation.htm l • kubectl https://kubernetes.io/docs/tasks/tools/install- kubectl/ • Check inventory/mycluster/hosts.ini • playbook -i inventory/myCluster/hosts.ini cluster.yml