SlideShare a Scribd company logo
KubernetesmeThisBatman
Or I how I quit worrying and learned to love
container clustering
Kubernetes Me This Batman
Kubernetes Me This Batman
Disclaimer:Idon’twork
forgoogle.Also,stillmad
aboutGoogleReader.RIP
sweetprince.
PresentationSchedule
● Part 0: What Does This Have to Do With Batman?
● Part 1: Kubernetes is very opinionated but I agree with
most of them.
● Part 2: All about drawings.
● Part 3: Demo Time!
Part0:WhatDoes
ThisHaveToDoWith
Batman?
IliketothinkthatIamBatman
✓ Does not have superpowers
✓ Relies on his intuition and
mental skills
✓ Has lots of cool gadgets
✓ Likes to surprise people
IliketoDevOpandlove
toplaywithnewtoolsto
fightcrimedowntime
onedayIstartedplayingwithcontainersbecauseeveryoneelsewas
doingitandthatneverwentpoorlysowhynot.(looksinviting)
AndthenIwasgonnalaunchallmycontainersinproductionand
wowallmyfriends(becausemywifedoesn’tgetwowedbycontainers).
Thiswastheresult.Itwasnotgood.No-onewaswowed.
AndthenIheardabout
thisKubernetesthing.And
wantedtolearnhowto
useit.
KuberneteswasliketheRiddlertome
✓ Likes to confuse people
✓ Is clever but not funny
✓ Does a lot of taunting
✓ Made me feel dumb
AfteraclassatOsconand
somegoodol’learnin,I
wasabletooutsmartthe
RiddlerKubernetes.
Part1:Kubernetesis
veryopinionated
butIagreewith
mostofthem.
Iwastoldmemesweregoodtohaveinapresentation.Hereisoneright
offthebat.
FromChapter4ofGettingRealby37Signals
The best software has a vision.
The best software takes sides.
When someone uses software,
they're not just looking for
features, they're looking for an
approach. They're looking for a
vision. Decide what your vision
is and run with it.
Runningandscheduling
containersisavery
opinionatedfield.
GooglehasanopinioncalledKubernetes.
● Pronounced /koo-ber-nay'-tace/. It’s actually a Greek
term for “ship master”.
● Developed at Google. The third iteration of container
management.
○ Daddy was Omega.
○ Grandaddy was Borg.
● Kubernetes is not a PaaS, but you can build one with it.
● Google says that Kubernetes is planet scale.
k8s
BTW, Google wants you to stop writing Kubernetes and use
this clever acronym instead. Although it technically should
be pronounced “Kates”.
ThisistheKuberneteslogo.Thelackofsymmetrybugsme.
Therearetwobigideasin
Kubernetes:labelsand
Pods.
Pods
● For the most part …
● Pods can contain one or more containers.
● The containers in a pod are scheduled on the same node.
● Everything in Kubernetes is some flavor of of pod or an
extension of the pod spec.
● Remember this for now, we’ll get back to it in a second.
Apodisacollectionofcontainers.
Podsareflatfiles.No,really.LikeYAMLorJSON(boo*).
apiVersion: v1
kind: Pod
metadata:
name: ""
labels:
name: ""
namespace: ""
annotations: []
generateName: ""
spec:
? "// See 'The spec schema' for
details."
: ~
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "",
"labels": {
"name": ""
},
"generateName": "",
"namespace": "",
"annotations": []
},
"spec": {
// See 'The spec schema' for details.
}
}
*Fontsize14vsfontsize10,YAMListheclearwinner.EspeciallyinthecontextofShannon’sInformationTheory.Thesamedensityofinformationcanbetransmittedinless
lineswithYAML.
Pods.Bothofthesearethesame.
apiVersion: v1
kind: Pod
metadata:
name: redis-django
labels:
app: web
spec:
containers:
- name: key-value-store
image: redis
ports:
- containerPort: 6379
- name: frontend
image: django
ports:
- containerPort: 8000
K8S Node 1
redis-django pod 1
redis
container
django
container
some-other pod
K8S Node 2
redis-django pod 2
redis
container
django
container
redis-django pod 3
redis
container
django
container
ThePodLifecycleinaCluster
Let’s say you want to fire up a pod. With kubectl you would:
1. Make a Pod request to the API server using a local pod
definition file.
2. The API server saves the info for the pod in ETCD.
3. The scheduler finds the unscheduled pod and schedules it
to a node.
4. Kubelet sees the pod scheduled and fires up docker.
5. Docker runs the container.
The entire lifecycle state of the pod is stored in ETCD.
Mostofthethingsin
Kubernetesarebuilton
topofPods.
Labels
Labelsandselectorsarethefairydustink8s.
● A label is a key-value pair that is assigned to objects
in k8s.
○ Pods, services, lots of things can have labels.
● A selector is a way to filter for labels that match a
certain criteria or logic.
○ There are two types of selectors:
■ Equality based
■ Set based
Anexampleofeach.
"labels": {
"environment" : "prod",
"type" : "nginx"
}
environment = prod
type != nginx
"labels": {
"environment" : "prod",
"type" : "redis"
}
environment = prod
type != nginx
No
Yes
"labels": {
"environment" : "prod",
"type" : "redis"
}
environment in (prod, qa)
type notin (nginx, mysql)
!partitionYes
Whenonethingink8s
needstofindanother
thingink8s,ituses
labels.
TheK8SCluster
Abasiccluster.
K8S Node 1
redis-django pod 1
redis
container
django
container
some-other pod
K8S Node 2
redis-django pod 2
redis
container
django
container
redis-django pod 3
redis
container
django
container
K8S Master
SkyDns
pod
ETCD pod
Kibana
pod
Grafana
pod
Elasticsearch
pod
Heapster
pod
basic-cluster-01
bonusstuff
● When you launch a
cluster, you get some
built in services.
● Each one of these has
their own endpoints and
/ or UIs.
● They run on the master
directly though you
could schedule them
across the cluster or
other masters.
● To find the endpoints
type: kubectl
cluster-info
Heapster
Namespaces.
AVirtualClusterinYourCluster
● A namespace as an isolated section of a cluster.
● It’s a virtual cluster in your cluster.
● Each cluster can have multiple namespaces.
● The root services have their own.
● Namespaces are in network isolation from each other and
can are (normally) used to house different environments
on the same cluster.
Part2:Allabout
drawings.
Let’slookataKubernetesclusterdiagram.
Thisdiagramisabitsmall,let’sbreakitdown.
Themaster
● Everything is done via
kubectl, which then
makes calls against the
kube-apiserver.
● The Controller Manager,
Scheduler Service, and
ETCD can be spread
across nodes based on
cluster size.
● All state about
everything is stored in
ETCD.
● Also, kubelet is
running here too (more
on that next slide).
TheNode
● The name of the agent
process is called
kubelet. Think “cubed
omelette”.
● The kubelet process
manages the Pods,
including containers &
volumes.
● The kube-proxy service
handles network routing
and service exposure.
Amasterisamaster
becauseithastheapi
servicesandscheduler.The
stateisallinetcd.
Kubernetesobjects.
Mymentalmodelofk8s
● I find it easiest to think of everything as a variation
of a Pod or another object.
● Google has done a very good job at extending base objects
to add flexibility or support new features.
● This also means that the Pod spec is relatively stable
given the massive list of features that is dropped every
release.
Whatk8slookslikeinmyhead.
Pod
Spec
Container
Replica Set
Pod
Spec
Container
Replication
Controller
Pod
Spec
Container
Daemon Set
Pod
Spec
Container
Pet Set
Pod
Spec
Container
Deployment
Replica Set
Pod
Spec
Container
Service
Pod
Service
Pod
Ingress
Service
Spec
Container
Job
Pod
Spec
Container
Orthis.
TheBaseThingsinContainersarecalledSpecs
(NotlikeDust,likeSpecification)
● The only required field is
containers.
○ And it requires two entries
■ name
■ image
● restartPolicy is for all
containers in a pod.
● volumes are volumes (duh) that
any container in a pod can
mount.
● The spec is very extensible by
design.
Spec
Container
Thenthereisthepod
● Specs don’t do anything by
themselves; for that you need a
pod.
● Pods are just collections of
containers that share a few
things:
○ Access to volumes.
○ Networking.
○ Are co-located.
● Pods can be run by themselves but
have no guarantee to restart or
stay running or scale or do
anything useful really.
Pod
Spec
Container
Services.
● Services point to a Pod.
● … or to an external source.
● With Pods a virtual endpoint is
created then routed to using the
kube-proxy.
● For non-pod services a virtual IP
in the cluster is used to route
externally.
Service
Pod
IngressService=AWSAPI
Gateway.
● An Ingress Controller sits at the
boundary of the cluster and routes
requests to Services.
● One Ingress Controller can handle
multiple domains.
● Each route can point to a
different Service.
● Relies on the creation of an
Ingress Controller in the cluster
(another service that is not
enabled by default).
Service
Pod
Ingress
Service
Daemonsets.Scary.
● Daemons is an object that ensures that a copy
of each Pod runs on each node.
● This is commonly used to make sure side-car
containers are running across the cluster.
● If new nodes come up they’ll get a copy of the
daemon set and will come up.
● Daemon sets don’t have scaling rules.
Daemon Set
Pod
Spec
Container
Petsets.Notsoscary.
● New in 1.3, Pet Sets allow you to create
complex microservices across the cluster.
● They have the ability to set dependency on
other containers.
● They require:
○ A stable hostname, available in DNS
○ An ordinal index
○ Stable storage: linked to the ordinal &
hostname
● It’s for launching a cluster in your cluster.
Pet Set
Pod
Spec
Container
ReplicationController(deprecated)
● A Replication Controller was the best way to
run Pods.
● You set a number of pods to run and the
Replication Controller made sure that the
number was running across the cluster.
● Rolling updates could be performed by starting
a new Replication Controller and scaling up.
Replication
Controller
Pod
Spec
Container
ReplciaSet.Thenewhotness.
● A Replica Set differs from the Replication
Controller because it can be updated.
● If you update the Replica Set template you can
fire and update and automatically roll
changes.
● Roll backs are also built in.
● These are not designed to use directly. For
that you need ...
Pod
Spec
Container
Replica Set
Deployments.Thekingofthehill.
● A Deployment controls the running state of
Pods and Replica Sets.
● In k8s 1.3 it is the primary object you should
be manipulating.
● Deployments have:
○ History.
○ Rolling updates.
○ Pausing updates.
○ Roll-backs.
Deployment
Replica Set
Pod
Spec
Container
There’smorestufftoo.
Otherstuff.
● Secrets:
○ K8s comes with a built-in secret store that is namespaced and uses
labels to control pod read access.
● Network Policies:
○ You can use labels to define whitelist rules between pods.
● Persistent Volumes:
○ These live outside of normal pod volumes and can be used for shared
storage for things like databases. Yes, databases in containers.
● Ubernetes:
○ A way to cluster your clusters.
Part3:DemoTime!
YouOnlyNeedaComputer,BTW
● Minikube
○ https://github.com/kubernetes/minikube
○ Runs a Kubernetes node on top of your favorite (probably Virtualbox)
VM.
○ Lots of involvement from the K8s community.
● Kube-solo
○ https://github.com/TheNewNormal/kube-solo-osx
○ Uses the Corectl app to run a Kube VM.
○ Also has a multi-node version.
OntoMinikube!
FIN
Contactme!
keybase.io/richardboydii
@richardboydii
richardboydii.com
countzer0.com

More Related Content

PDF
Kubernetes in 20 minutes - HDE Monthly Technical Session 24
PPTX
Alternative cryptocurrencies
PDF
How to debug the pod which is hard to debug (디버그 하기 어려운 POD 디버그 하기)
PDF
Demystifying kubernetes
PDF
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
PPTX
Mining pools and attacks
ODP
Fredericksburg LUG Bitcoin slides
PDF
Immutable kubernetes architecture by linuxkit
Kubernetes in 20 minutes - HDE Monthly Technical Session 24
Alternative cryptocurrencies
How to debug the pod which is hard to debug (디버그 하기 어려운 POD 디버그 하기)
Demystifying kubernetes
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
Mining pools and attacks
Fredericksburg LUG Bitcoin slides
Immutable kubernetes architecture by linuxkit

What's hot (19)

PDF
Containers @ Google
PDF
Introduction and Deep Dive Into Containerd
PDF
Kubernetes networking
PDF
SCALE 2011 Deploying OpenStack with Chef
PDF
[FOSDEM 2020] Lazy distribution of container images
PDF
[KubeCon NA 2020] containerd: Rootless Containers 2020
PDF
Rootless Containers & Unresolved issues
PDF
Introduction to kubernetes
PPTX
Qt Framework Events Signals Threads
PDF
[KubeCon EU 2020] containerd Deep Dive
PDF
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
PDF
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
PDF
Lightweight Virtualization: LXC containers & AUFS
KEY
Openstack grizzley puppet_talk
PDF
LXC, Docker, and the future of software delivery | LinuxCon 2013
PPT
Building your own NSQL store
PDF
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
PDF
Portable TeX Documents (PTD): PackagingCon 2021
PPTX
Java applications containerized and deployed
Containers @ Google
Introduction and Deep Dive Into Containerd
Kubernetes networking
SCALE 2011 Deploying OpenStack with Chef
[FOSDEM 2020] Lazy distribution of container images
[KubeCon NA 2020] containerd: Rootless Containers 2020
Rootless Containers & Unresolved issues
Introduction to kubernetes
Qt Framework Events Signals Threads
[KubeCon EU 2020] containerd Deep Dive
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Lightweight Virtualization: LXC containers & AUFS
Openstack grizzley puppet_talk
LXC, Docker, and the future of software delivery | LinuxCon 2013
Building your own NSQL store
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
Portable TeX Documents (PTD): PackagingCon 2021
Java applications containerized and deployed
Ad

Viewers also liked (12)

PDF
Antropologia esquecida
PPTX
Alimentación del bailarín
PPSX
Administracion
PDF
PPTX
Ppt reading
PDF
Aec1. presentaciones digitales. yaiza fernandez (2)
PPTX
domestic violence
PDF
Teliko programma greek and english version
PDF
Containers, orchestration and security, oh my!
PPTX
Juan José Gárate ,pintor:LA PECERA 1918
PPTX
Shira Weinberg
PPT
Iso 9001 and 14001
Antropologia esquecida
Alimentación del bailarín
Administracion
Ppt reading
Aec1. presentaciones digitales. yaiza fernandez (2)
domestic violence
Teliko programma greek and english version
Containers, orchestration and security, oh my!
Juan José Gárate ,pintor:LA PECERA 1918
Shira Weinberg
Iso 9001 and 14001
Ad

Similar to Kubernetes Me This Batman (20)

PPTX
Kubernetes 101
PPTX
Kubernetes - Why It's Cool & Why It Maaters
PDF
Kubernetes and CoreOS @ Athens Docker meetup
PDF
A Python Petting Zoo
PDF
Containers > VMs
PDF
Scale out, with Kubernetes (k8s)
PDF
Containerizing MongoDB with kubernetes
PDF
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
PDF
A guide of PostgreSQL on Kubernetes
PDF
Perspectives on Docker
PPTX
Introduction to Kubernetes
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
PDF
Kubernetes111111111111111111122233334334
PDF
Kubernetes Basis: Pods, Deployments, and Services
PDF
Real-World Docker: 10 Things We've Learned
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PDF
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
PDF
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
PDF
Mete Atamel "Resilient microservices with kubernetes"
PPTX
Production Grade Kubernetes Applications
Kubernetes 101
Kubernetes - Why It's Cool & Why It Maaters
Kubernetes and CoreOS @ Athens Docker meetup
A Python Petting Zoo
Containers > VMs
Scale out, with Kubernetes (k8s)
Containerizing MongoDB with kubernetes
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
A guide of PostgreSQL on Kubernetes
Perspectives on Docker
Introduction to Kubernetes
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Kubernetes111111111111111111122233334334
Kubernetes Basis: Pods, Deployments, and Services
Real-World Docker: 10 Things We've Learned
K8s in 3h - Kubernetes Fundamentals Training
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
Mete Atamel "Resilient microservices with kubernetes"
Production Grade Kubernetes Applications

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Introduction to Artificial Intelligence
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
System and Network Administration Chapter 2
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
top salesforce developer skills in 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Digital Strategies for Manufacturing Companies
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
AI in Product Development-omnex systems
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
medical staffing services at VALiNTRY
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
The Five Best AI Cover Tools in 2025.docx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Transform Your Business with a Software ERP System
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction to Artificial Intelligence
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
System and Network Administration Chapter 2
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms II-SECS-1021-03
top salesforce developer skills in 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Digital Strategies for Manufacturing Companies
Design an Analysis of Algorithms I-SECS-1021-03
AI in Product Development-omnex systems
Understanding Forklifts - TECH EHS Solution
Lecture 3: Operating Systems Introduction to Computer Hardware Systems

Kubernetes Me This Batman