SlideShare a Scribd company logo
Introduction to Kubernetes
2018-06-28 - Nardoz Berlin
Raffaele Di Fazio - @x0rg
Agenda
● What is Kubernetes?
● Architecture
● Main concepts with hands on examples
Pre-check: who doesn’t know what a container is?
● “Containers are an abstraction at the app layer that packages code and
dependencies together.”
● They don’t really exist…
○ CGroups
○ Namespaces
● Docker: nice UX on top of running isolated self contained applications
● Immutable artifacts
Kubernetes
● Open Source container orchestration system
● Inspired by Borg, Omega, Mesos
● Started at Google, donated to CNCF
The history so far
The OSS history so far
Kubernetes (April 2018)
Kubernetes (June 2018)
Kubernetes Architecture
Kubernetes architecture
API Server
Controller
manager
Scheduler
etcd
Worker Node (VM)
Worker Node (VM)
Kubelet
Kubelet
nginx
nginx
nginx
kube-proxy
kube-proxy
Kubernetes: running an application
API Server
Kubernetes: running an application
API Server
Deployment
yaml
Kubernetes: running an application
API Server
Deployment
yaml
Scheduler
Kubernetes: running an application
API Server
Kubelet
Deployment
yaml
Scheduler
Kubernetes: running an application
API Server
Kubelet
Deployment
yaml
Scheduler
Controller
manager
Kubernetes: running an application
https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
Main Concepts
Pod
● The “scheduling unit” of Kubernetes
● Doesn’t get restarted when terminates (can be one shot)
● Pods are collection of one or more containers
Pod in one picture
Instance (node 1)
Pod 1 Pod 2
Container 1
Container 2
Container 3
Container 4
Instance (node 2)
Pod 3 Pod 4
Container 5
Container 6
Container 7
Container 8
Pod
● Containers in the same pod are guaranteed to be on the same host
● Containers in the same pod can talk via localhost
● Every pod gets a dedicated virtual IP address in the “pod network”
● Analogy: your application instance in AWS
Pod
apiVersion: v1
kind: Pod
metadata:
name: pod-example
spec:
containers:
- name: ubuntu
image: ubuntu:trusty
command: ["echo"]
args: ["Hello World"]
Kubernetes patterns: reconciler
● Controllers in Kubernetes are built by implementing the reconciler pattern
○ GetCurrentState()
○ GetDesiredState()
○ Apply()
● Controller manager: enforces deployment replicas
Deployment
● Defines a single application in Kubernetes handled by the system
● Analogy: Autoscaling Group in AWS
○ You set the desired state, Kubernetes enforces it
Deployment
apiVersion: apps/v1beta1
kind: Deployment
metadata:
# Unique key of the Deploymentinstance
name: deployment-example
spec:
# 3 Pods should exist at all times.
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
# Run this image
image: nginx:1.10
Demo
Kubernetes’ overlay networking
● Every pod gets its own IP from a dedicated overlay network
○ Solves the problem of port mapping
○ No NAT needed
● Implemented via software solution (flannel, calico, weave, …)
● Iptables everywhere!
Service
● Defines how to to reach your app
● Internal Service: cluster valid IP + DNS
● Can use service as Service Discovery (DNS based)
● Label based selection of targets
Service
kind: Service
apiVersion: v1
metadata:
name: service-example
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: nginx
type: LoadBalancer
Demo
ConfigMap & Secrets
● Object containing a K/V storage for configuration purposes
● Can be “mounted”:
○ File
○ Environment variable
● Keep your configuration for the app generic and customize via ConfigMap
● Secret: like a ConfigMap with hidden fields :-)
DaemonSet
● Run one instance of the pod for each node of the cluster
● Useful mostly for cluster ops
● Ideal for “system agents”
Daemonset
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: daemonset-example
spec:
template:
metadata:
labels:
app: daemonset-example
spec:
containers:
- name: daemonset-example
image: ubuntu:trusty
command:
- /bin/sh
args:
- -c
- >-
while [ true ]; do
echo "DaemonSet running on $(hostname)" ; sleep 10 ;
done
Demo
A lot more to cover
● StatefulSets
● ServiceAccounts
● Namespaces
● Quotas
● ….
● Check out: https://kubernetes.io
If you want to know more
https://www.youtube.com/watch?v=WwBdNXt6wO4
If you want to know more
https://www.youtube.com/watch?v=9YYeE-bMWv8&list=PLvmPtYZtoXOENHJiAQc6HmV2jmuexKfrJ
If you want to know more
https://www.youtube.com/watch?v=w34txLmpEuM
Thank you!
Raffaele Di Fazio - @x0rg

More Related Content

What's hot (20)

PDF
An Introduction to Kubernetes
Imesh Gunaratne
 
PPTX
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
PDF
Kubernetes
erialc_w
 
PPTX
A brief study on Kubernetes and its components
Ramit Surana
 
PDF
Getting Started with Kubernetes
VMware Tanzu
 
PPTX
DevOps with Kubernetes
EastBanc Tachnologies
 
PDF
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
PPTX
Kubernetes Basics
Rishabh Kumar
 
PDF
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
Edureka!
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PDF
Introduction to kubernetes
Gabriel Carro
 
PDF
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Edureka!
 
PPTX
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
PDF
Kubernetes dealing with storage and persistence
Janakiram MSV
 
PDF
Kubernetes Basics
Eueung Mulyana
 
PPTX
Docker 101 - Nov 2016
Docker, Inc.
 
PDF
Kubernetes 101
Crevise Technologies
 
PDF
Kubernetes a comprehensive overview
Gabriel Carro
 
PPTX
Monitoring, Logging and Tracing on Kubernetes
Martin Etmajer
 
PDF
Autoscaling Kubernetes
craigbox
 
An Introduction to Kubernetes
Imesh Gunaratne
 
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
Kubernetes
erialc_w
 
A brief study on Kubernetes and its components
Ramit Surana
 
Getting Started with Kubernetes
VMware Tanzu
 
DevOps with Kubernetes
EastBanc Tachnologies
 
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Kubernetes Basics
Rishabh Kumar
 
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
Edureka!
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Introduction to kubernetes
Gabriel Carro
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Edureka!
 
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
Kubernetes dealing with storage and persistence
Janakiram MSV
 
Kubernetes Basics
Eueung Mulyana
 
Docker 101 - Nov 2016
Docker, Inc.
 
Kubernetes 101
Crevise Technologies
 
Kubernetes a comprehensive overview
Gabriel Carro
 
Monitoring, Logging and Tracing on Kubernetes
Martin Etmajer
 
Autoscaling Kubernetes
craigbox
 

Similar to Introduction to kubernetes (20)

PPTX
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
PDF
Making your app soar without a container manifest
LibbySchulze
 
PDF
Kubernetes for Beginners
DigitalOcean
 
PPTX
From development to production: Deploying Java and Scala apps to kubernetes
Olanga Ochieng'
 
PDF
[Global logic] container runtimes and kubernetes
GlobalLogic Ukraine
 
PDF
Getting started with kubernetes
Bob Killen
 
PDF
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Bitnami
 
PDF
DCEU 18: Docker Containers in a Serverless World
Docker, Inc.
 
PDF
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
FIWARE
 
PDF
Kubernetes Intro
Antonio Ojea Garcia
 
PPTX
Kubernetes #1 intro
Terry Cho
 
PDF
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
PDF
Kubernetes basics and hands on exercise
Cloud Technology Experts
 
PDF
Netflix and Containers: Not A Stranger Thing
aspyker
 
PDF
Netflix and Containers: Not Stranger Things
All Things Open
 
PDF
kubernetesssssssssssssssssssssssssss.pdf
bchiriamina2
 
PPTX
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
PPTX
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
PPTX
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Patrick Chanezon
 
PDF
Velocity NYC 2016 - Containers @ Netflix
aspyker
 
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
Making your app soar without a container manifest
LibbySchulze
 
Kubernetes for Beginners
DigitalOcean
 
From development to production: Deploying Java and Scala apps to kubernetes
Olanga Ochieng'
 
[Global logic] container runtimes and kubernetes
GlobalLogic Ukraine
 
Getting started with kubernetes
Bob Killen
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Bitnami
 
DCEU 18: Docker Containers in a Serverless World
Docker, Inc.
 
FIWARE Global Summit - Leveraging Kubernetes for FIWARE Components Automations
FIWARE
 
Kubernetes Intro
Antonio Ojea Garcia
 
Kubernetes #1 intro
Terry Cho
 
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
Kubernetes basics and hands on exercise
Cloud Technology Experts
 
Netflix and Containers: Not A Stranger Thing
aspyker
 
Netflix and Containers: Not Stranger Things
All Things Open
 
kubernetesssssssssssssssssssssssssss.pdf
bchiriamina2
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Patrick Chanezon
 
Velocity NYC 2016 - Containers @ Netflix
aspyker
 
Ad

Recently uploaded (20)

PPTX
INTEGRATION OF ICT IN LEARNING AND INCORPORATIING TECHNOLOGY
kvshardwork1235
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
PPT
introduction to networking with basics coverage
RamananMuthukrishnan
 
PPTX
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PDF
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
PPTX
本科硕士学历佛罗里达大学毕业证(UF毕业证书)24小时在线办理
Taqyea
 
PPTX
internet básico presentacion es una red global
70965857
 
PPTX
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
PDF
DevOps Design for different deployment options
henrymails
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PDF
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
INTEGRATION OF ICT IN LEARNING AND INCORPORATIING TECHNOLOGY
kvshardwork1235
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
introduction to networking with basics coverage
RamananMuthukrishnan
 
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
本科硕士学历佛罗里达大学毕业证(UF毕业证书)24小时在线办理
Taqyea
 
internet básico presentacion es una red global
70965857
 
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
DevOps Design for different deployment options
henrymails
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
Ad

Introduction to kubernetes