SlideShare a Scribd company logo
1 of 32
KUBERNETES 101
HANDS ON WORKSHOP
CONTAINER CAMP
22 MAY 2017
VISHAL BIYANI
CTO & Founder at
infraCloud technologies (www.infracloud.io )
https://twitter.com/vishal_biyani
https://www.vishalbiyani.com
1st Kubernetes partner India
2nd in APAC region
Rancher partner - APAC
InfraCloud has published a FREE eBook on
“Scaling and deploying Kubernetes”
http://info.rancher.com/deploying-scaling-kubernetes-ebook
TIMELINES
Time (Minutes - total 180) Agenda
00 - 15 Introduction & Setting up
15 - 45 Quick walkthrough of concepts
45 - 95 3 concepts, code & labs - 15 minute each
95 - 100 Break
100 - 150 3 concept, code & labs - 15 min each
150 - 180 Open House
HAVE YOU?
• You have worked with either of
Puppet/Chef/Ansible/Salt?
• You have used Docker
• You have experience of one of:
Kubernetes/Mesos/Swarm/Openshift?
TABLE OF CONTAINERS.. ..
• What is Kubernetes, exactly?
• How to setup a Kubernetes Cluster?
• Various ways to get started with a Kubernetes cluster
• Kubernetes Architecture
• Kubernetes Concepts
• POD, Deployments, Services, Labels & Selectors etc.
• Kubectl Usage
• Deploying app with Helm
KUBERNETES - THE BOOKISH DEFINITION
• Kubernetes is an open-source
platform for automating
deployment, scaling, and
operations of application
containers across clusters of
hosts, providing container-
centric infrastructure (From
http://kubernetes.io/docs/whatisk8s/)
Open source project by
Google
Primarily targeted
at containerized
workloads
Platform - automates
deployment, scaling etc.
Abstracts hosts and
underlying
infrastructure from you
Portable - Run on
public/private cloud, data
center, your laptop -
doesn’t matter
Self - healing: It restarts,
replaces, scales, monitors
Containers
Extensible - replace certain
components if you want
to. Extend with pluggable
architecture
KUBERNETES HAS COMMON PATTERNS/DESIGNS
Need to run related
processes together in a
shared context
Integrating with underlying
storage (Block or Bucket
based)
Check health of
applications and maintain
certain number of
instances.
Scale instances based on
triggers.
Load balancing between
multiple instances of a
container
Provide easy and scalable
way to locate and reach
services (Aka service
discovery and naming)
Monitoring and log
management
Tagging and searching
instances dynamically to do
certain operations (For
example list all web servers
across all applications)
Rolling updates, Canary
deployments
Everything is API based- so
can be integrated with
external systems.
SETTING UP KUBERNETES
On Cloud & managed
Google
Container
Engine
StackpointCloud
Tectonic from
CoreOS
Openshift SaaS
DIY - any cloud/data center
Kubeadm
(official utility)
DIY On steroids
KOPS (Targeted
to AWS)
Kismatic from
Apperanda
Rancher -
provides
enterprise
features, multi
cluster support
Redhat
OpenShift -
comes with
complete
lifecycle
features
Many more: http://kubernetes.io/docs/getting-started-guides
Platform9
KUBERNETES ARCHITECTURE
Image Source: info.rancher.com/deploying-scaling-kubernetes-ebook
Lab - Setup Kubernetes in GKE & laptop setup
• GKE Cluster creation
• Kubectl on Google Cloud Console
• Checkout https://github.com/infracloudio/kubernetes-101
POD
• Related containers together
• Share same IP, port space & storage
etc.
• It’s a single unit for all practical
purposes
Code & Demo: Pod - create and destroy
Pod
nginx
monolith
NFSiSCSIGCE
10.10.1.100
POD - LAB
HEALTHCHECK
Hey, app v1... You
alive?
Kubelet
Pod
app v1
HEALTHCHECK - LAB
DEPLOYMENT
• Drive desired state
• Maintain desired POD instances
• Enable deployment mechanisms
such as rolling deploy, Canary,
pause/resume etc.
Deployment
ReplicaSet
Pod
DEPLOYMENT LAB
ROLLING UPGRADE - DEPLOYMENT LAB
SERVICES
• Provide a fixed endpoint for PODs irrespective of
deletion/movement/modification of POD
• Expose services/endpoints to outside cluster or to world
• Services utilize labels to target PODs to represent
SERVICE TYPES
ExternalName (Kubenretes 1.5 onwards)
• Maps to a external provided CNAME like service.orgname.com
ClusterIP (Default)
• Exposes service only within cluster
NodePort
• Creates a ClusterIP + exposes the same port on every node/host. This is typically used if
you want to use an external loadBalancer
LoadBalancer
• NodePort+Creates a LB in cloud provider (Such as ELB) and points to respective ports
SERVICES- LAB
LABLES AND SELECTORS
Lables:
“relase”:”1.4”
“environment”:”QA”
“app”:”billing”
Selectors:
env = prod
release in (1.3, 1.4)
app != payment
• Classification mechanism
• Lables
• Tag things
• Think like “roles”
• Selectors
• Filters & conditions
EXAMPLE
Pod
hello
Pod
hello
labels:
version: v1
track: stable
labels:
version: v1
track: test
selector: “version=v1” selector: “track=stable”
Pod
hello
Pod
hello
labels:
version: v1
track:
stable
labels:
version: v1
track: test
SECRETS & CONFIG MAPS
• Secrets
• Deliver sensitive data to intended target
• ConfigMap
• Configuration properties
NAMESPACES & NODES
• Namespaces
• Logically separate cluster
• Nodes
• Info about nodes
MORE TYPES
Volume types for
handling persistent data.
They interact with cloud
provider's storage.
StatefulSet - for
maanging clusters with
strong identity
requirements (Kafka,
Elastic, Zookeeper etc.)
DaemonSet - things
which need to run on a
set or all nodes of cluster.
For example logging
agents or
Job - ensures a certain
number of PODs execute
the process and upon
completion terminates.
(For batch jobs)
HELM - PACKAGE MANAGER FOR KUBERNETES
• Helm is a package manager for Kubernetes
• Tiller - Repo Server
• Chart - a package
• Helm is the client for Tiller
• Charts are in a repo (Typically some Git repo)
• A chart - is set of manifests
• The values can be defaulted to or overridden as input from user
• A chart is released as a release so that it can be tracked.
HELM ON MY MACHINE
• Configure ~/.kube/config file - verify with kubectl
• ‘helm init’ - initializes all directories and standard repo
• helm search WordPress
• helm install --name cc-release stable/wordpress
HELM - LAB
RESOURCES
• The workshop material & codelabs at
https://github.com/GoogleCloudPlatform/kubernetes-
workshops
• http://kubernetesbyexample.com
• info.rancher.com/deploying-scaling-kubernetes-ebook
Scalable Microservices with Kubernetes
https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615
ধন্যবাদ!
Dank je!
Kiitos!
આભાર!
धन्यवाद!
Grazie!
Je vous remercie!
ありがとうございました!
ਤੁਹਾਡਾ ਧੰਨਵਾਦ!
நன்றி!
ధన్యవాదాలు!
നന്ദി!
THANK YOU!

More Related Content

What's hot

DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with KubernetesOleg Chunikhin
 
Orchestrating Docker Containers with Google Kubernetes on OpenStack
Orchestrating Docker Containers with Google Kubernetes on OpenStackOrchestrating Docker Containers with Google Kubernetes on OpenStack
Orchestrating Docker Containers with Google Kubernetes on OpenStackTrevor Roberts Jr.
 
Scaling Microservices with Kubernetes
Scaling Microservices with KubernetesScaling Microservices with Kubernetes
Scaling Microservices with KubernetesDeivid Hahn Fração
 
Marc Sluiter - 15 Kubernetes Features in 15 Minutes
Marc Sluiter - 15 Kubernetes Features in 15 MinutesMarc Sluiter - 15 Kubernetes Features in 15 Minutes
Marc Sluiter - 15 Kubernetes Features in 15 MinutesMarc Sluiter
 
CoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersCoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersRamit Surana
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesVishal Biyani
 
Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introductionJason Hu
 
Apache Stratos 4.1.0 Architecture
Apache Stratos 4.1.0 ArchitectureApache Stratos 4.1.0 Architecture
Apache Stratos 4.1.0 ArchitectureImesh Gunaratne
 
Kubernetes in 15 minutes
Kubernetes in 15 minutesKubernetes in 15 minutes
Kubernetes in 15 minutesrhirschfeld
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with KubernetesCarlos Sanchez
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionPeng Xiao
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceBen Hall
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 

What's hot (20)

DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with Kubernetes
 
Orchestrating Docker Containers with Google Kubernetes on OpenStack
Orchestrating Docker Containers with Google Kubernetes on OpenStackOrchestrating Docker Containers with Google Kubernetes on OpenStack
Orchestrating Docker Containers with Google Kubernetes on OpenStack
 
Scaling Microservices with Kubernetes
Scaling Microservices with KubernetesScaling Microservices with Kubernetes
Scaling Microservices with Kubernetes
 
Marc Sluiter - 15 Kubernetes Features in 15 Minutes
Marc Sluiter - 15 Kubernetes Features in 15 MinutesMarc Sluiter - 15 Kubernetes Features in 15 Minutes
Marc Sluiter - 15 Kubernetes Features in 15 Minutes
 
CoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersCoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux Containers
 
Rex gke-clustree
Rex gke-clustreeRex gke-clustree
Rex gke-clustree
 
Intro to kubernetes
Intro to kubernetesIntro to kubernetes
Intro to kubernetes
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introduction
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Apache Stratos 4.1.0 Architecture
Apache Stratos 4.1.0 ArchitectureApache Stratos 4.1.0 Architecture
Apache Stratos 4.1.0 Architecture
 
Kubernetes in 15 minutes
Kubernetes in 15 minutesKubernetes in 15 minutes
Kubernetes in 15 minutes
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 

Similar to Kubernetes 101 Workshop

Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Harshal Shah
 
Container Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher KubernetesContainer Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher KubernetesVishal Biyani
 
Kubernetes for Java Developers
Kubernetes for Java DevelopersKubernetes for Java Developers
Kubernetes for Java DevelopersAnthony Dahanne
 
Docker clusters on AWS with Amazon ECS and Kubernetes
Docker clusters on AWS with Amazon ECS and KubernetesDocker clusters on AWS with Amazon ECS and Kubernetes
Docker clusters on AWS with Amazon ECS and KubernetesJulien SIMON
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019Kumton Suttiraksiri
 
Choosing PaaS: Cisco and Open Source Options: an overview
Choosing PaaS:  Cisco and Open Source Options: an overviewChoosing PaaS:  Cisco and Open Source Options: an overview
Choosing PaaS: Cisco and Open Source Options: an overviewCisco DevNet
 
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...DevOps.com
 
Containerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with KubernetesContainerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with KubernetesCodemotion Tel Aviv
 
Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.Jooho Lee
 
Docker and OpenStack Boston Meetup
Docker and OpenStack Boston MeetupDocker and OpenStack Boston Meetup
Docker and OpenStack Boston MeetupKamesh Pemmaraju
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMwareVMUG IT
 
Implementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using KubelessImplementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using KubelessAhmed Misbah
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Anthony Dahanne
 
Oscon London 2016 - Docker from Development to Production
Oscon London 2016 - Docker from Development to ProductionOscon London 2016 - Docker from Development to Production
Oscon London 2016 - Docker from Development to ProductionPatrick Chanezon
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Inhye Park
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Anthony Dahanne
 
Mete Atamel
Mete AtamelMete Atamel
Mete AtamelCodeFest
 
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐Pahud Hsieh
 
Docker open stack boston
Docker open stack bostonDocker open stack boston
Docker open stack bostondotCloud
 

Similar to Kubernetes 101 Workshop (20)

Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6
 
Container Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher KubernetesContainer Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher Kubernetes
 
Kubernetes for Java Developers
Kubernetes for Java DevelopersKubernetes for Java Developers
Kubernetes for Java Developers
 
Docker clusters on AWS with Amazon ECS and Kubernetes
Docker clusters on AWS with Amazon ECS and KubernetesDocker clusters on AWS with Amazon ECS and Kubernetes
Docker clusters on AWS with Amazon ECS and Kubernetes
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
 
Choosing PaaS: Cisco and Open Source Options: an overview
Choosing PaaS:  Cisco and Open Source Options: an overviewChoosing PaaS:  Cisco and Open Source Options: an overview
Choosing PaaS: Cisco and Open Source Options: an overview
 
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
 
Containerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with KubernetesContainerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with Kubernetes
 
Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.Docker, Atomic Host and Kubernetes.
Docker, Atomic Host and Kubernetes.
 
Docker and OpenStack Boston Meetup
Docker and OpenStack Boston MeetupDocker and OpenStack Boston Meetup
Docker and OpenStack Boston Meetup
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Implementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using KubelessImplementing FaaS on Kubernetes using Kubeless
Implementing FaaS on Kubernetes using Kubeless
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 
Oscon London 2016 - Docker from Development to Production
Oscon London 2016 - Docker from Development to ProductionOscon London 2016 - Docker from Development to Production
Oscon London 2016 - Docker from Development to Production
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
 
Mete Atamel
Mete AtamelMete Atamel
Mete Atamel
 
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
 
Docker open stack boston
Docker open stack bostonDocker open stack boston
Docker open stack boston
 
OpenStack Boston
OpenStack BostonOpenStack Boston
OpenStack Boston
 

More from Vishal Biyani

Gophercon 2018: Kubernetes api golang
Gophercon 2018: Kubernetes api golangGophercon 2018: Kubernetes api golang
Gophercon 2018: Kubernetes api golangVishal Biyani
 
Serverless Summit India 2017: Fission
Serverless Summit India 2017: FissionServerless Summit India 2017: Fission
Serverless Summit India 2017: FissionVishal Biyani
 
SaltStack Advanced Concepts
SaltStack Advanced ConceptsSaltStack Advanced Concepts
SaltStack Advanced ConceptsVishal Biyani
 
Serverless Pune meetup 3
Serverless Pune meetup 3Serverless Pune meetup 3
Serverless Pune meetup 3Vishal Biyani
 
Serverless Pune Meetup 1
Serverless Pune Meetup 1Serverless Pune Meetup 1
Serverless Pune Meetup 1Vishal Biyani
 
Setting up Kubernetes with tectonic
Setting up Kubernetes with tectonicSetting up Kubernetes with tectonic
Setting up Kubernetes with tectonicVishal Biyani
 
Learning puppet chapter 3
Learning puppet chapter 3Learning puppet chapter 3
Learning puppet chapter 3Vishal Biyani
 
Learning puppet chapter 2
Learning puppet chapter 2Learning puppet chapter 2
Learning puppet chapter 2Vishal Biyani
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1Vishal Biyani
 
Using CI for continuous delivery Part 3
Using CI for continuous delivery Part 3Using CI for continuous delivery Part 3
Using CI for continuous delivery Part 3Vishal Biyani
 
Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Vishal Biyani
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Vishal Biyani
 
Using CI for continuous delivery Part 4
Using CI for continuous delivery Part 4Using CI for continuous delivery Part 4
Using CI for continuous delivery Part 4Vishal Biyani
 

More from Vishal Biyani (15)

Gophercon 2018: Kubernetes api golang
Gophercon 2018: Kubernetes api golangGophercon 2018: Kubernetes api golang
Gophercon 2018: Kubernetes api golang
 
Serverless Summit India 2017: Fission
Serverless Summit India 2017: FissionServerless Summit India 2017: Fission
Serverless Summit India 2017: Fission
 
SaltStack Advanced Concepts
SaltStack Advanced ConceptsSaltStack Advanced Concepts
SaltStack Advanced Concepts
 
Serverless Pune meetup 3
Serverless Pune meetup 3Serverless Pune meetup 3
Serverless Pune meetup 3
 
Serverless Pune Meetup 1
Serverless Pune Meetup 1Serverless Pune Meetup 1
Serverless Pune Meetup 1
 
Setting up Kubernetes with tectonic
Setting up Kubernetes with tectonicSetting up Kubernetes with tectonic
Setting up Kubernetes with tectonic
 
Learning puppet chapter 3
Learning puppet chapter 3Learning puppet chapter 3
Learning puppet chapter 3
 
Learning puppet chapter 2
Learning puppet chapter 2Learning puppet chapter 2
Learning puppet chapter 2
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1
 
Mulesoft cloudhub
Mulesoft cloudhubMulesoft cloudhub
Mulesoft cloudhub
 
Dell boomi
Dell boomiDell boomi
Dell boomi
 
Using CI for continuous delivery Part 3
Using CI for continuous delivery Part 3Using CI for continuous delivery Part 3
Using CI for continuous delivery Part 3
 
Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
 
Using CI for continuous delivery Part 4
Using CI for continuous delivery Part 4Using CI for continuous delivery Part 4
Using CI for continuous delivery Part 4
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Kubernetes 101 Workshop

  • 1. KUBERNETES 101 HANDS ON WORKSHOP CONTAINER CAMP 22 MAY 2017
  • 2. VISHAL BIYANI CTO & Founder at infraCloud technologies (www.infracloud.io ) https://twitter.com/vishal_biyani https://www.vishalbiyani.com 1st Kubernetes partner India 2nd in APAC region Rancher partner - APAC
  • 3. InfraCloud has published a FREE eBook on “Scaling and deploying Kubernetes” http://info.rancher.com/deploying-scaling-kubernetes-ebook
  • 4. TIMELINES Time (Minutes - total 180) Agenda 00 - 15 Introduction & Setting up 15 - 45 Quick walkthrough of concepts 45 - 95 3 concepts, code & labs - 15 minute each 95 - 100 Break 100 - 150 3 concept, code & labs - 15 min each 150 - 180 Open House
  • 5. HAVE YOU? • You have worked with either of Puppet/Chef/Ansible/Salt? • You have used Docker • You have experience of one of: Kubernetes/Mesos/Swarm/Openshift?
  • 6. TABLE OF CONTAINERS.. .. • What is Kubernetes, exactly? • How to setup a Kubernetes Cluster? • Various ways to get started with a Kubernetes cluster • Kubernetes Architecture • Kubernetes Concepts • POD, Deployments, Services, Labels & Selectors etc. • Kubectl Usage • Deploying app with Helm
  • 7. KUBERNETES - THE BOOKISH DEFINITION • Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container- centric infrastructure (From http://kubernetes.io/docs/whatisk8s/) Open source project by Google Primarily targeted at containerized workloads Platform - automates deployment, scaling etc. Abstracts hosts and underlying infrastructure from you Portable - Run on public/private cloud, data center, your laptop - doesn’t matter Self - healing: It restarts, replaces, scales, monitors Containers Extensible - replace certain components if you want to. Extend with pluggable architecture
  • 8. KUBERNETES HAS COMMON PATTERNS/DESIGNS Need to run related processes together in a shared context Integrating with underlying storage (Block or Bucket based) Check health of applications and maintain certain number of instances. Scale instances based on triggers. Load balancing between multiple instances of a container Provide easy and scalable way to locate and reach services (Aka service discovery and naming) Monitoring and log management Tagging and searching instances dynamically to do certain operations (For example list all web servers across all applications) Rolling updates, Canary deployments Everything is API based- so can be integrated with external systems.
  • 9. SETTING UP KUBERNETES On Cloud & managed Google Container Engine StackpointCloud Tectonic from CoreOS Openshift SaaS DIY - any cloud/data center Kubeadm (official utility) DIY On steroids KOPS (Targeted to AWS) Kismatic from Apperanda Rancher - provides enterprise features, multi cluster support Redhat OpenShift - comes with complete lifecycle features Many more: http://kubernetes.io/docs/getting-started-guides Platform9
  • 10. KUBERNETES ARCHITECTURE Image Source: info.rancher.com/deploying-scaling-kubernetes-ebook
  • 11. Lab - Setup Kubernetes in GKE & laptop setup • GKE Cluster creation • Kubectl on Google Cloud Console • Checkout https://github.com/infracloudio/kubernetes-101
  • 12. POD • Related containers together • Share same IP, port space & storage etc. • It’s a single unit for all practical purposes Code & Demo: Pod - create and destroy Pod nginx monolith NFSiSCSIGCE 10.10.1.100
  • 14. HEALTHCHECK Hey, app v1... You alive? Kubelet Pod app v1
  • 16. DEPLOYMENT • Drive desired state • Maintain desired POD instances • Enable deployment mechanisms such as rolling deploy, Canary, pause/resume etc. Deployment ReplicaSet Pod
  • 18. ROLLING UPGRADE - DEPLOYMENT LAB
  • 19. SERVICES • Provide a fixed endpoint for PODs irrespective of deletion/movement/modification of POD • Expose services/endpoints to outside cluster or to world • Services utilize labels to target PODs to represent
  • 20. SERVICE TYPES ExternalName (Kubenretes 1.5 onwards) • Maps to a external provided CNAME like service.orgname.com ClusterIP (Default) • Exposes service only within cluster NodePort • Creates a ClusterIP + exposes the same port on every node/host. This is typically used if you want to use an external loadBalancer LoadBalancer • NodePort+Creates a LB in cloud provider (Such as ELB) and points to respective ports
  • 22. LABLES AND SELECTORS Lables: “relase”:”1.4” “environment”:”QA” “app”:”billing” Selectors: env = prod release in (1.3, 1.4) app != payment • Classification mechanism • Lables • Tag things • Think like “roles” • Selectors • Filters & conditions
  • 23. EXAMPLE Pod hello Pod hello labels: version: v1 track: stable labels: version: v1 track: test selector: “version=v1” selector: “track=stable” Pod hello Pod hello labels: version: v1 track: stable labels: version: v1 track: test
  • 24. SECRETS & CONFIG MAPS • Secrets • Deliver sensitive data to intended target • ConfigMap • Configuration properties
  • 25. NAMESPACES & NODES • Namespaces • Logically separate cluster • Nodes • Info about nodes
  • 26. MORE TYPES Volume types for handling persistent data. They interact with cloud provider's storage. StatefulSet - for maanging clusters with strong identity requirements (Kafka, Elastic, Zookeeper etc.) DaemonSet - things which need to run on a set or all nodes of cluster. For example logging agents or Job - ensures a certain number of PODs execute the process and upon completion terminates. (For batch jobs)
  • 27. HELM - PACKAGE MANAGER FOR KUBERNETES • Helm is a package manager for Kubernetes • Tiller - Repo Server • Chart - a package • Helm is the client for Tiller • Charts are in a repo (Typically some Git repo) • A chart - is set of manifests • The values can be defaulted to or overridden as input from user • A chart is released as a release so that it can be tracked.
  • 28. HELM ON MY MACHINE • Configure ~/.kube/config file - verify with kubectl • ‘helm init’ - initializes all directories and standard repo • helm search WordPress • helm install --name cc-release stable/wordpress
  • 30. RESOURCES • The workshop material & codelabs at https://github.com/GoogleCloudPlatform/kubernetes- workshops • http://kubernetesbyexample.com • info.rancher.com/deploying-scaling-kubernetes-ebook
  • 31. Scalable Microservices with Kubernetes https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615
  • 32. ধন্যবাদ! Dank je! Kiitos! આભાર! धन्यवाद! Grazie! Je vous remercie! ありがとうございました! ਤੁਹਾਡਾ ਧੰਨਵਾਦ! நன்றி! ధన్యవాదాలు! നന്ദി! THANK YOU!

Editor's Notes

  1. Docker is running on every host Node Components: Kublet: manages the containers on that node and their storage, images etc. Kube-proxy - A simple proxy which is running a load balancer. Does TCp/UDP forwarding in simple RoundRObin fashion. Master Components (Might be on same node or different based on HA setup etc.) Etcd: Config data storage and events for changes in dataKube API Server: API layer with different components/plugins Scheduler: Works on scheduling & rescheduling a container to a node Controller manager server: There are various controllers like node controller does node management, endpoint controller takes care of exposing endpoints etc.
  2. Co-located set of containers One or more containers which need to run together -context they share the same storage, and a shared They share the IP and port space and are reachable to each other via localhost. They are always scheduled and handled together. The scaling applies to all containers in a POD PODs must not be created directly even if you just need one - why? We will know in next one
  3. Liveness probe & readiness probe
  4. RC Manages lifecycles of PODs. Ensures “n” instances of POD are always running (If less, increase. If more, kill) If a POD gets deleted from a replicas=3, another one is created. Even is a host machine/node gets terminated, RC will ensure that the PODs are scheduled elsewhere Selects the PODs which should be part of replica based on labels ReplicaSet is next generation of ReplicationController with additional features Deployment type is the current preferred method, which also provides: Rolling Deployment Strategy & Canary releasing MaxSurge & MaxUnavailable parameters to control the rolling deployment
  5. kubectl set image deployment/hello hello=kelseyhightower/hello:2.0.0
  6. A way of tagging containers with information which may be useful for whole lifecycle Think of them as roles - these are all my databases and these are my billing apps Selector leverages lables to classify - which is leveraged by Service, ReplicationController and even for querying Some objects support set based selectors (ReplicaSet, Job etc.)
  7. Secrets Secrets are meant to handle sensitive data - passwords etc. Although at the moment only B64 encoding is supported. Once a secret is created, it can be used in one of three ways: As an environment variable inside a container. The referenced secret’s variable are set as environment variable. As a file mount inside the container - mounts the decoded data inside the container. As a ‘imagePullSecret’ - which is used to fetch image from a private image registry.
  8. Node Nodes (Earlier called minions) as such are not created by Kubernetes - they are only managed Node controller manages lifecycle and monitors health of node and talks to underlying cloud provider to take appropriate action NameSpace A logical space within same cluster. Default cluster is “default” Good for organizing multiple teams/projects/units within same cluster.DNS names are appended by namespace names
  9. If you want a more in-depth overview (plus extra goodies like interviews with the former Cloud Architect of Netflix, Adrian Cockcroft, and code walkthroughs from Google’s Kelsey Hightower), go check out Udacity and Google’s free Kubernetes course: Scalable Microservices with Kubernetes. (The trailer is embedded in the slide -- feel free to play it.)