SlideShare a Scribd company logo
INTRODUCTION TO
KUBERNETES
KUBERNETES-PUNE MEETUP
HTTPS://WWW.MEETUP.COM/KUBERNETES-PUNE/
17 DEC 2016
VISHAL BIYANI
CTO & Founder at
infraCloud technologies (www.infracloud.io )
2004
Java, PLM, JSP,
Servlets
2004-2009
eMatrix PLM, J2EE,
Database, architecture, Shell
and what not
2010 - 2013: Spring,
Maven, Jenkins,
ElasticSearch, CloudFoundry,
Google App Engine, APIs, CI
2013: Puppet, Chef, Ansible,
CD/CI, DevOps Coach, Docker,
API Mgmt, Microservices, Infra
as code
Now:
Containers,
Kubernetes, Mesos,
Salt, Scale, Distributed
https://twitter.com/vishal_biyani
https://www.vishalbiyani.com
ANNOUNCEMENT TIME
This is first Kubernetes Pune meetup & we will host a
meetup every month.
We will cover advanced Kubernetes topics & other projects
from CNCF (Cloud Native Computing Foundation) such as
Prometheus, Opentracing, FluentD
For Feb 26 Meetup we have Ian Lewis - Developer
advocate Google cloud APAC conducting a session
infraCloud has published a FREE eBook on
“Scaling and deploying Kubernetes”
http://info.rancher.com/deploying-scaling-kubernetes-ebook
PLEASE RAISE HANDS
• You have worked with either of
Puppet/Chef/Ansible/Salt?
• You have used Docker
• You have experience of
Kubernetes/Mesos/Swarm/Openshift?
• You are using Go lang
TABLE OF CODE .. ..
• What is Kubernetes, exactly?
• How to setup a Kubernetes Cluster?
• Various ways to get started with a Kubernetes cluster
• Kubernetes Architecture
• API Server
• Kubernetes Concepts
• POD,
• Kubectl - quick overview
• Sample app deployment
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 PROVIDES COMMON NEEDS/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
Demo: Setup cluster with GCE & UI
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 1/2
Image Source: info.rancher.com/deploying-scaling-kubernetes-ebook
KUBERNETES ARCHITECTURE 2/2
• 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.
KUBERNETES CONEPTS
POD, REPLICATION CONTROLLER, SERVICES ETC.
PODS - FRIENDS WHO LIVE TOGETHER
• Co-located set of containers
• One or more containers which need to run together - they
share the same storage, and a shared context
• 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
Code & Demo: Pod - create and destroy
REPLICATION CONTROLLER - GODFATHER OF POD
• 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
Code & Demo: RC, create & delete pod
SERVICES - POD’S DAY OUT
• Provides a fixed endpoint for PODs irrespective of deletion/movement/modification of
POD & Replication Controller
• Also a way to expose services/endpoints to outside cluster or to world
• Can act as a endpoint for a service outside of Kubernetes too.
• Services utilize labels to target PODs which needs to be proxied by service
Service Discovery
Environment variable based DNS (Reccomended approach)
Kubernetes adds environment variables to
containers in a given format like:
REDIS_MASTER_SERVICE_HOST=10.0.0.11
REDIS_MASTER_SERVICE_PORT=6379
Sequence of startup needs to be maintained
A DNS server as a cluster add on. Watches for
changes in services and updates records
Services can then be accessed in format
<<NameSpaceName>>.<<ServiceName>>
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
Demo: Create a service and expose Nginx
LABLES AND SELECTORS: POWER TO YOU
Lables:
“relase”:”1.4”
“environment”:”QA”
“app”:”billing”
Selectors:
env = prod
release in (1.3, 1.4)
app != payment
• Classification mechanism
• Lables
• 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
• Selectors
• Selector leverages lables to classify - which is leveraged by
Service, ReplicationController and even for querying
• Some objects support set based selectors (ReplicaSet, Job
etc.)
NODE, NAMESPACES & SECRETS
Get Namespaces and nodes
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
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.
Secret creation & usage
MORE TYPES
Volume types for handling
persistent data. They
interact with cloud
provider's storage.
PetSet (Now renamed to
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)
DEMO
• Simple Guestbook code walkthrough and
creation
• K8Petstore app
ধন্যবাদ!
Dank je!
Kiitos!
આભાર!
धन्यवाद!
Grazie!
Je vous remercie!
ありがとうございました!
ਤੁਹਾਡਾ ਧੰਨਵਾਦ!
நன்றி!
ధన్యవాదాలు!
നന്ദി!
THANK YOU!
Special Thanks to
Demandshore for
hosting us
Thanks to Cloud
Native Computing
Foundation
Thanks a lot to you
the audience who
made this possible

More Related Content

What's hot (20)

PDF
Kubernetes 101
Winton Winton
 
PDF
Designing a complete ci cd pipeline using argo events, workflow and cd products
Julian Mazzitelli
 
PDF
Hands-on Helm
Docker, Inc.
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PDF
Room 1 - 4 - Phạm Tường Chiến & Trần Văn Thắng - Deliver managed Kubernetes C...
Vietnam Open Infrastructure User Group
 
PDF
Kubernetes
erialc_w
 
PDF
Kubernetes - introduction
Sparkbit
 
PPTX
Introduction to kubernetes
Rishabh Indoria
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PPTX
Introduction to kubernetes
Michal Cwienczek
 
PDF
Kubernetes Security Best Practices - With tips for the CKS exam
Ahmed AbouZaid
 
PPTX
Introduction to Docker - 2017
Docker, Inc.
 
PDF
Kubernetes 101
Crevise Technologies
 
PDF
Kubernetes a comprehensive overview
Gabriel Carro
 
PDF
Achieving CI/CD with Kubernetes
Ramit Surana
 
PDF
Deep dive into Kubernetes Networking
Sreenivas Makam
 
PPTX
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
PPTX
Introduction to Kubernetes
Paris Apostolopoulos
 
PDF
Introduction to kubernetes
Gabriel Carro
 
PDF
Rootless Containers & Unresolved issues
Akihiro Suda
 
Kubernetes 101
Winton Winton
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Julian Mazzitelli
 
Hands-on Helm
Docker, Inc.
 
Introduction to Kubernetes Workshop
Bob Killen
 
Room 1 - 4 - Phạm Tường Chiến & Trần Văn Thắng - Deliver managed Kubernetes C...
Vietnam Open Infrastructure User Group
 
Kubernetes
erialc_w
 
Kubernetes - introduction
Sparkbit
 
Introduction to kubernetes
Rishabh Indoria
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Introduction to kubernetes
Michal Cwienczek
 
Kubernetes Security Best Practices - With tips for the CKS exam
Ahmed AbouZaid
 
Introduction to Docker - 2017
Docker, Inc.
 
Kubernetes 101
Crevise Technologies
 
Kubernetes a comprehensive overview
Gabriel Carro
 
Achieving CI/CD with Kubernetes
Ramit Surana
 
Deep dive into Kubernetes Networking
Sreenivas Makam
 
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
Introduction to Kubernetes
Paris Apostolopoulos
 
Introduction to kubernetes
Gabriel Carro
 
Rootless Containers & Unresolved issues
Akihiro Suda
 

Viewers also liked (9)

PPTX
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
CoreOS
 
PPTX
Tectonic Summit 2016: Networking for Kubernetes
CoreOS
 
PDF
Kubernetes Introduction
Peng Xiao
 
PDF
Kubernetes Networking - Giragadurai Vallirajan
Neependra Khare
 
PPTX
Introduction to Kubernetes
rajdeep
 
PPTX
Serverless Pune Meetup 1
Vishal Biyani
 
PDF
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Stefan Schimanski
 
PDF
Kubernetes Networking
CJ Cullen
 
PDF
Robot Framework Dos And Don'ts
Pekka Klärck
 
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
CoreOS
 
Tectonic Summit 2016: Networking for Kubernetes
CoreOS
 
Kubernetes Introduction
Peng Xiao
 
Kubernetes Networking - Giragadurai Vallirajan
Neependra Khare
 
Introduction to Kubernetes
rajdeep
 
Serverless Pune Meetup 1
Vishal Biyani
 
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Stefan Schimanski
 
Kubernetes Networking
CJ Cullen
 
Robot Framework Dos And Don'ts
Pekka Klärck
 
Ad

Similar to Introduction to Kubernetes (20)

PDF
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
PPTX
Kubernetes PPT.pptx
ssuser0cc9131
 
PDF
Kubernetes Basics - ICP Workshop Batch II
PT Datacomm Diangraha
 
PPTX
A brief study on Kubernetes and its components
Ramit Surana
 
PDF
Intro to Kubernetes
Joonathan Mägi
 
PDF
Kubernetes From Scratch .pdf
ssuser9b44c7
 
PDF
DevOps in AWS with Kubernetes
Oleg Chunikhin
 
PDF
Getting started with kubernetes
Bob Killen
 
PPTX
Kubernetes
Lhouceine OUHAMZA
 
PPTX
08 - kubernetes.pptx
RanjithM61
 
PDF
Kubernetes acomprehensiveoverview
Ankit Shukla
 
PDF
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
Kubernetes: My BFF
Jonathan Yu
 
PPTX
Kubernetes Introduction
Miloš Zubal
 
PDF
Kubernetes Intro
Antonio Ojea Garcia
 
PDF
Kubernetes - A Rising Hero
Huynh Thai Bao
 
PPTX
Introduction+to+Kubernetes-Details-D.pptx
SantoshPandey160
 
PDF
Kubernetes
Linjith Kunnon
 
PPTX
Container Orchestration using kubernetes
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Kubernetes presentation
GauranG Bajpai
 
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
Kubernetes PPT.pptx
ssuser0cc9131
 
Kubernetes Basics - ICP Workshop Batch II
PT Datacomm Diangraha
 
A brief study on Kubernetes and its components
Ramit Surana
 
Intro to Kubernetes
Joonathan Mägi
 
Kubernetes From Scratch .pdf
ssuser9b44c7
 
DevOps in AWS with Kubernetes
Oleg Chunikhin
 
Getting started with kubernetes
Bob Killen
 
Kubernetes
Lhouceine OUHAMZA
 
08 - kubernetes.pptx
RanjithM61
 
Kubernetes acomprehensiveoverview
Ankit Shukla
 
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes: My BFF
Jonathan Yu
 
Kubernetes Introduction
Miloš Zubal
 
Kubernetes Intro
Antonio Ojea Garcia
 
Kubernetes - A Rising Hero
Huynh Thai Bao
 
Introduction+to+Kubernetes-Details-D.pptx
SantoshPandey160
 
Kubernetes
Linjith Kunnon
 
Container Orchestration using kubernetes
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Kubernetes presentation
GauranG Bajpai
 
Ad

More from Vishal Biyani (16)

PDF
Gophercon 2018: Kubernetes api golang
Vishal Biyani
 
PPTX
Serverless Summit India 2017: Fission
Vishal Biyani
 
PPTX
SaltStack Advanced Concepts
Vishal Biyani
 
PPTX
Kubernetes 101 Workshop
Vishal Biyani
 
PPTX
Serverless Pune meetup 3
Vishal Biyani
 
PPTX
Container Conf 2017: Rancher Kubernetes
Vishal Biyani
 
PPTX
Setting up Kubernetes with tectonic
Vishal Biyani
 
PDF
Learning puppet chapter 3
Vishal Biyani
 
PDF
Learning puppet chapter 2
Vishal Biyani
 
PDF
Learning Puppet Chapter 1
Vishal Biyani
 
PDF
Mulesoft cloudhub
Vishal Biyani
 
PDF
Dell boomi
Vishal Biyani
 
PDF
Using CI for continuous delivery Part 3
Vishal Biyani
 
PDF
Using CI for continuous delivery Part 2
Vishal Biyani
 
PDF
Using CI for continuous delivery Part 1
Vishal Biyani
 
PDF
Using CI for continuous delivery Part 4
Vishal Biyani
 
Gophercon 2018: Kubernetes api golang
Vishal Biyani
 
Serverless Summit India 2017: Fission
Vishal Biyani
 
SaltStack Advanced Concepts
Vishal Biyani
 
Kubernetes 101 Workshop
Vishal Biyani
 
Serverless Pune meetup 3
Vishal Biyani
 
Container Conf 2017: Rancher Kubernetes
Vishal Biyani
 
Setting up Kubernetes with tectonic
Vishal Biyani
 
Learning puppet chapter 3
Vishal Biyani
 
Learning puppet chapter 2
Vishal Biyani
 
Learning Puppet Chapter 1
Vishal Biyani
 
Mulesoft cloudhub
Vishal Biyani
 
Dell boomi
Vishal Biyani
 
Using CI for continuous delivery Part 3
Vishal Biyani
 
Using CI for continuous delivery Part 2
Vishal Biyani
 
Using CI for continuous delivery Part 1
Vishal Biyani
 
Using CI for continuous delivery Part 4
Vishal Biyani
 

Recently uploaded (20)

PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
July Patch Tuesday
Ivanti
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Python basic programing language for automation
DanialHabibi2
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 

Introduction to Kubernetes

  • 2. VISHAL BIYANI CTO & Founder at infraCloud technologies (www.infracloud.io ) 2004 Java, PLM, JSP, Servlets 2004-2009 eMatrix PLM, J2EE, Database, architecture, Shell and what not 2010 - 2013: Spring, Maven, Jenkins, ElasticSearch, CloudFoundry, Google App Engine, APIs, CI 2013: Puppet, Chef, Ansible, CD/CI, DevOps Coach, Docker, API Mgmt, Microservices, Infra as code Now: Containers, Kubernetes, Mesos, Salt, Scale, Distributed https://twitter.com/vishal_biyani https://www.vishalbiyani.com
  • 3. ANNOUNCEMENT TIME This is first Kubernetes Pune meetup & we will host a meetup every month. We will cover advanced Kubernetes topics & other projects from CNCF (Cloud Native Computing Foundation) such as Prometheus, Opentracing, FluentD For Feb 26 Meetup we have Ian Lewis - Developer advocate Google cloud APAC conducting a session
  • 4. infraCloud has published a FREE eBook on “Scaling and deploying Kubernetes” http://info.rancher.com/deploying-scaling-kubernetes-ebook
  • 5. PLEASE RAISE HANDS • You have worked with either of Puppet/Chef/Ansible/Salt? • You have used Docker • You have experience of Kubernetes/Mesos/Swarm/Openshift? • You are using Go lang
  • 6. TABLE OF CODE .. .. • What is Kubernetes, exactly? • How to setup a Kubernetes Cluster? • Various ways to get started with a Kubernetes cluster • Kubernetes Architecture • API Server • Kubernetes Concepts • POD, • Kubectl - quick overview • Sample app deployment
  • 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 PROVIDES COMMON NEEDS/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 Demo: Setup cluster with GCE & UI 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 1/2 Image Source: info.rancher.com/deploying-scaling-kubernetes-ebook
  • 11. KUBERNETES ARCHITECTURE 2/2 • 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.
  • 12. KUBERNETES CONEPTS POD, REPLICATION CONTROLLER, SERVICES ETC.
  • 13. PODS - FRIENDS WHO LIVE TOGETHER • Co-located set of containers • One or more containers which need to run together - they share the same storage, and a shared context • 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 Code & Demo: Pod - create and destroy
  • 14. REPLICATION CONTROLLER - GODFATHER OF POD • 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 Code & Demo: RC, create & delete pod
  • 15. SERVICES - POD’S DAY OUT • Provides a fixed endpoint for PODs irrespective of deletion/movement/modification of POD & Replication Controller • Also a way to expose services/endpoints to outside cluster or to world • Can act as a endpoint for a service outside of Kubernetes too. • Services utilize labels to target PODs which needs to be proxied by service Service Discovery Environment variable based DNS (Reccomended approach) Kubernetes adds environment variables to containers in a given format like: REDIS_MASTER_SERVICE_HOST=10.0.0.11 REDIS_MASTER_SERVICE_PORT=6379 Sequence of startup needs to be maintained A DNS server as a cluster add on. Watches for changes in services and updates records Services can then be accessed in format <<NameSpaceName>>.<<ServiceName>>
  • 16. 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 Demo: Create a service and expose Nginx
  • 17. LABLES AND SELECTORS: POWER TO YOU Lables: “relase”:”1.4” “environment”:”QA” “app”:”billing” Selectors: env = prod release in (1.3, 1.4) app != payment • Classification mechanism • Lables • 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 • Selectors • Selector leverages lables to classify - which is leveraged by Service, ReplicationController and even for querying • Some objects support set based selectors (ReplicaSet, Job etc.)
  • 18. NODE, NAMESPACES & SECRETS Get Namespaces and nodes 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 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. Secret creation & usage
  • 19. MORE TYPES Volume types for handling persistent data. They interact with cloud provider's storage. PetSet (Now renamed to 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)
  • 20. DEMO • Simple Guestbook code walkthrough and creation • K8Petstore app
  • 21. ধন্যবাদ! Dank je! Kiitos! આભાર! धन्यवाद! Grazie! Je vous remercie! ありがとうございました! ਤੁਹਾਡਾ ਧੰਨਵਾਦ! நன்றி! ధన్యవాదాలు! നന്ദി! THANK YOU! Special Thanks to Demandshore for hosting us Thanks to Cloud Native Computing Foundation Thanks a lot to you the audience who made this possible