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
Kubernetes 101
Crevise Technologies
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PPTX
Kubernetes Introduction
Martin Danielsson
 
PDF
Kubernetes
erialc_w
 
PPTX
Kubernetes 101 for Beginners
Oktay Esgul
 
PPTX
DevOps with Kubernetes
EastBanc Tachnologies
 
PPTX
Kubernetes Basics
Rishabh Kumar
 
PDF
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Michael O'Sullivan
 
PDF
Kubernetes Introduction
Peng Xiao
 
PDF
Introduction to kubernetes
Gabriel Carro
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
ODP
Kubernetes Architecture
Knoldus Inc.
 
PPTX
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
PPTX
Introduction to kubernetes
Michal Cwienczek
 
PPTX
Kubernetes Introduction
Eric Gustafson
 
PDF
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
PDF
An overview of the Kubernetes architecture
Igor Sfiligoi
 
PPTX
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
PDF
Getting Started with Kubernetes
VMware Tanzu
 
PPTX
Kubernetes Workshop
loodse
 
Kubernetes 101
Crevise Technologies
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Kubernetes Introduction
Martin Danielsson
 
Kubernetes
erialc_w
 
Kubernetes 101 for Beginners
Oktay Esgul
 
DevOps with Kubernetes
EastBanc Tachnologies
 
Kubernetes Basics
Rishabh Kumar
 
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Michael O'Sullivan
 
Kubernetes Introduction
Peng Xiao
 
Introduction to kubernetes
Gabriel Carro
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes Architecture
Knoldus Inc.
 
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
Introduction to kubernetes
Michal Cwienczek
 
Kubernetes Introduction
Eric Gustafson
 
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
An overview of the Kubernetes architecture
Igor Sfiligoi
 
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
Getting Started with Kubernetes
VMware Tanzu
 
Kubernetes Workshop
loodse
 

Similar to Introduction to kubernetes (20)

PPTX
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
PPTX
Introduction kubernetes 2017_12_24
Sam Zheng
 
PPTX
Kubernetes Introduction
Miloš Zubal
 
PDF
Kubernetes for Beginners
DigitalOcean
 
PDF
Kubernetes Nedir?
AnkaraCloud
 
PDF
Kubernetes - how to orchestrate containers
inovex GmbH
 
PPTX
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
PPTX
First steps with kubernetes
Vinícius Kroth
 
PPTX
Kubernetes
Lhouceine OUHAMZA
 
PDF
Introduction to Kubernetes
Ross Kukulinski
 
PPTX
An Introduction to Kubernetes and Continuous Delivery Fundamentals
All Things Open
 
PDF
Kubernetes meetup 101
Jakir Patel
 
PDF
Quick introduction to Kubernetes
Eduardo Garcia Moyano
 
PPTX
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
PDF
Intro to Kubernetes
Joonathan Mägi
 
PPTX
Kubernetes 101
Huy Vo
 
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
PPTX
Introduction: Basic About Kubernetes Cluster
OpikTaufiq1
 
PDF
prodops.io k8s presentation
Prodops.io
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 
Introduction kubernetes 2017_12_24
Sam Zheng
 
Kubernetes Introduction
Miloš Zubal
 
Kubernetes for Beginners
DigitalOcean
 
Kubernetes Nedir?
AnkaraCloud
 
Kubernetes - how to orchestrate containers
inovex GmbH
 
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
First steps with kubernetes
Vinícius Kroth
 
Kubernetes
Lhouceine OUHAMZA
 
Introduction to Kubernetes
Ross Kukulinski
 
An Introduction to Kubernetes and Continuous Delivery Fundamentals
All Things Open
 
Kubernetes meetup 101
Jakir Patel
 
Quick introduction to Kubernetes
Eduardo Garcia Moyano
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
Intro to Kubernetes
Joonathan Mägi
 
Kubernetes 101
Huy Vo
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
Introduction: Basic About Kubernetes Cluster
OpikTaufiq1
 
prodops.io k8s presentation
Prodops.io
 
Ad

Recently uploaded (20)

PDF
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
PPTX
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
PPTX
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PPTX
原版一样(LHU毕业证书)英国利物浦希望大学毕业证办理方法
Taqyea
 
PPTX
美国电子毕业证帕克大学电子版成绩单UMCP学费发票办理学历认证
Taqyea
 
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
PDF
The Hidden Benefits of Outsourcing IT Hardware Procurement for Small Businesses
Carley Cramer
 
PPTX
Academic Debate: Creation vs Evolution.pptx
JOHNPATRICKMARTINEZ5
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
PPTX
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
PPTX
原版一样(毕业证书)法国蒙彼利埃大学毕业证文凭复刻
Taqyea
 
PPTX
西班牙巴利阿里群岛大学电子版毕业证{UIBLetterUIB文凭证书}文凭复刻
Taqyea
 
PDF
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
原版一样(LHU毕业证书)英国利物浦希望大学毕业证办理方法
Taqyea
 
美国电子毕业证帕克大学电子版成绩单UMCP学费发票办理学历认证
Taqyea
 
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
The Hidden Benefits of Outsourcing IT Hardware Procurement for Small Businesses
Carley Cramer
 
Academic Debate: Creation vs Evolution.pptx
JOHNPATRICKMARTINEZ5
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
原版一样(毕业证书)法国蒙彼利埃大学毕业证文凭复刻
Taqyea
 
西班牙巴利阿里群岛大学电子版毕业证{UIBLetterUIB文凭证书}文凭复刻
Taqyea
 
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Ad

Introduction to kubernetes