SlideShare a Scribd company logo
Kubernetes -
introduction
Tomasz Piekarczyk
Kubernetes (k8s):
is an open-source system for automating
deployment, scaling, and management of
containerized applications
Why would you care?
The pitch:
“Kuberentes makes it easier to organize and schedule your application across a fleet of
machines”
Specifically by:
• Horizontal scaling
• Load distribution
• Service discovery
• Health monitoring
• Deploying new versions, rollbacks
• Handling hardware failure
High level architecture
Master - coordinates all activities in the cluster
Nodes:
• virtual or physical machines
• actual workers
• runs processes:
• kubelet
• container runtime
Basic building blocks
Containers
• Define single running process*
• Eg docker container
Pods
• the way of running containers in kubernetes
• basic deployable and scaling unit
• defines one or more containers
• containers are co-located on a node
• flat network structure
Nodes:
• physical worker machines
• can run multiple pods
• pods running within single node don’t know
about each other
Running things locally
Minikube:
• single node cluster
• running in a VM
• supports linux, windows and macOS
• mature project
https://kubernetes.io/docs/setup/minikube/
https://kubernetes.io/docs/tasks/tools/install-minikube/
https://docs.docker.com/docker-for-windows/kubernetes/
https://docs.docker.com/docker-for-mac/kubernetes/
Docker with built-in kubernetes:
• single node cluster
• running in a VM
• windows and macOS
• drag & drop installation
• bound to specific kubernetes version
• relatively new
More options listed in https://kubernetes.io
Managing cluster resources
Create resource from file
• kubectl create -f resource_file.yml
Change existing (or create) resource based on file
• kubectl apply -f resource_file.yml
Delete existing resource
• kubectl delete resource_type resource_name
List resources of type
• kubectl get resource_type
Edit resource on the server
• kubectl edit resource_type resource_name
Debugging cluster resources
Execute command on the container
• kubectl exec [-it] pod_name process_to_run
Get container logs
• kubectl logs pod_name [-c container_name]
Forward port from a pod
• kubectl port-forward pod_name local_port:remote_port
Print detailed description of a resource
• kubectl describe resource_type resource_name
Defining a pod
Main definition components
• api
• resource type
• metadata
• spec
Grouping pods - labels
• Each pod can have multiple labels
• Labels can be changed on a live pod
• Basic mechanism to execute commands on
multiple pods
Pod health - liveness probe
Out of the box (before the probe)
• Pod defines a restart policy
• Crashing process can be restarted by kubelet
Process can be alive but unhealthy eg:
• deadlocked
• stuck in a loop
Liveness probe is a way of telling kubelet that a process in no longer
healthy and needs restarting
3 ways of querying:
• http
• tcp
• exec
Limitations of liveness probe
Replica Sets
Replication Controller
Ensures desired number of pods exist by:
• scaling up or down
• running new pods when nodes fail
Definition consists of:
• label selector
• replica count
• pod template
Demo
Service
Define logical groups of pods - label selectors
Types:
• ClusterIP (default)
• LoadBalancer
• NodePort
• ExternalName
Service is constant:
• IP doesn’t change (except headless)
• each service gets a dns entry
Pod health - readiness probe
Similar to liveness probe:
• Defined in a pod
• 3 types supported
• similar parameters
When probe fails pod is marked as not ready
Not ready pods are removed from services
Service - LoadBalancer
• Allows automatic provisioning of load
balancers
• Needs to be supported by cloud provider
• Exposes external IP to the cluster
DEMO
Deployments
• Higher level resource
• Deals with updating the application
• Allows graceful rollback
• Can pause or abort a bad release
• Manages internally multiple replica sets
• Changing pod template triggers update
Deployments
Revision history:
• rolling back release
• switching between releases
• number of revisions can be specified
Update strategy:
• RollingUpdate
• Recreate
Detecting bad releases with minReadySeconds
Specifying update process
• MaxSurge
• MaxUnavailable
DEMO
Passing configuration
Pod definition can embed:
• environment variables
• command line parameters
This couples pod definition with environment:
• separate definitions for prod/test
• changing configuration requires changing pod
ConfigMap
• Lives as a separate resource
• Supports:
• environment variables:
• individual
• entire environment
• configuration files /directories
• Live reloading of config if supported by pod
• Missing ConfigMap prevents container from starting
ConfigMap - basic usage
Defining and passing single
environment variable
ConfigMap - mounting files
Secrets
• Similar to configMap
• Stored in memory on the nodes
(includes mounting files)
• Ability to store binary data -
base64 encoded
Where to go from here
Managing persistent storage:
• persistent volumes
• persistent volume claims
• storage class
Advanced routing - ingress controllers
Multiple replicas with own storage - stateful sets
Even more resources - deamon sets, jobs, cronjobs
Package management - Helm
Managing Kubernetes through API
Service mesh - Istio
Thank
you

More Related Content

PDF
Kubernetes Basics
PDF
Introduction to Kubernetes Workshop
PPTX
Kubernetes PPT.pptx
PPTX
Introduction to kubernetes
PPTX
Kubernetes Introduction
PDF
Getting Started with Kubernetes
ODP
Kubernetes Architecture
PDF
Kubernetes Introduction
Kubernetes Basics
Introduction to Kubernetes Workshop
Kubernetes PPT.pptx
Introduction to kubernetes
Kubernetes Introduction
Getting Started with Kubernetes
Kubernetes Architecture
Kubernetes Introduction

What's hot (20)

PDF
Hands-On Introduction to Kubernetes at LISA17
PDF
Introduction to kubernetes
PPTX
01. Kubernetes-PPT.pptx
PDF
Kubernetes
PPTX
Kubernetes Basics
PDF
Kubernetes 101
PPTX
DevOps with Kubernetes
PDF
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
PDF
Open shift 4 infra deep dive
PDF
Kubernetes: A Short Introduction (2019)
PPTX
Kubernetes for Beginners: An Introductory Guide
PPTX
Kubernetes 101 for Beginners
PDF
An Introduction to Kubernetes
PDF
Kubernetes Application Deployment with Helm - A beginner Guide!
PDF
Introduction to kubernetes
PDF
An overview of the Kubernetes architecture
PDF
Deep dive into Kubernetes Networking
PDF
What Is Helm
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
PPTX
Docker and kubernetes_introduction
Hands-On Introduction to Kubernetes at LISA17
Introduction to kubernetes
01. Kubernetes-PPT.pptx
Kubernetes
Kubernetes Basics
Kubernetes 101
DevOps with Kubernetes
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Open shift 4 infra deep dive
Kubernetes: A Short Introduction (2019)
Kubernetes for Beginners: An Introductory Guide
Kubernetes 101 for Beginners
An Introduction to Kubernetes
Kubernetes Application Deployment with Helm - A beginner Guide!
Introduction to kubernetes
An overview of the Kubernetes architecture
Deep dive into Kubernetes Networking
What Is Helm
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Docker and kubernetes_introduction
Ad

Similar to Kubernetes - introduction (20)

PPTX
Kubernetes fundamentals
PPTX
Kubernetes Internals
PPTX
Kubernetes Introduction & Whats new in Kubernetes 1.6
PDF
Kubernetes Walk Through from Technical View
PDF
Kubernetes Basics - ICP Workshop Batch II
PDF
Kubernetes meetup - 2018-05-23
PDF
LISA2017 Kubernetes: Hit the Ground Running
PDF
Live Container Migration: OpenStack Summit Barcelona 2016
PDF
Kubernetes overview and Exploitation
PDF
DevOps in AWS with Kubernetes
PPTX
Kubernetes-Presentation-Syed-Murtaza-Hassan
PPTX
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
PDF
Evolving for Kubernetes
PPTX
PlovDev 2016: Оркестрация на контейнери с Kubernetes - Мартин Владев
PDF
An Introduction to Using PostgreSQL with Docker & Kubernetes
PDF
Using PostgreSQL With Docker & Kubernetes - July 2018
PPTX
Introduction to Kubernetes
PPTX
Kubernetes 101
PPTX
KuberneteSADASDSADASDASDASDASDASDAs Labs.pptx
Kubernetes fundamentals
Kubernetes Internals
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Walk Through from Technical View
Kubernetes Basics - ICP Workshop Batch II
Kubernetes meetup - 2018-05-23
LISA2017 Kubernetes: Hit the Ground Running
Live Container Migration: OpenStack Summit Barcelona 2016
Kubernetes overview and Exploitation
DevOps in AWS with Kubernetes
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Evolving for Kubernetes
PlovDev 2016: Оркестрация на контейнери с Kubernetes - Мартин Владев
An Introduction to Using PostgreSQL with Docker & Kubernetes
Using PostgreSQL With Docker & Kubernetes - July 2018
Introduction to Kubernetes
Kubernetes 101
KuberneteSADASDSADASDASDASDASDASDAs Labs.pptx
Ad

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced IT Governance
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Machine learning based COVID-19 study performance prediction
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
Advanced IT Governance
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Machine learning based COVID-19 study performance prediction
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I

Kubernetes - introduction

  • 2. Kubernetes (k8s): is an open-source system for automating deployment, scaling, and management of containerized applications
  • 3. Why would you care? The pitch: “Kuberentes makes it easier to organize and schedule your application across a fleet of machines” Specifically by: • Horizontal scaling • Load distribution • Service discovery • Health monitoring • Deploying new versions, rollbacks • Handling hardware failure
  • 4. High level architecture Master - coordinates all activities in the cluster Nodes: • virtual or physical machines • actual workers • runs processes: • kubelet • container runtime
  • 5. Basic building blocks Containers • Define single running process* • Eg docker container Pods • the way of running containers in kubernetes • basic deployable and scaling unit • defines one or more containers • containers are co-located on a node • flat network structure Nodes: • physical worker machines • can run multiple pods • pods running within single node don’t know about each other
  • 6. Running things locally Minikube: • single node cluster • running in a VM • supports linux, windows and macOS • mature project https://kubernetes.io/docs/setup/minikube/ https://kubernetes.io/docs/tasks/tools/install-minikube/ https://docs.docker.com/docker-for-windows/kubernetes/ https://docs.docker.com/docker-for-mac/kubernetes/ Docker with built-in kubernetes: • single node cluster • running in a VM • windows and macOS • drag & drop installation • bound to specific kubernetes version • relatively new More options listed in https://kubernetes.io
  • 7. Managing cluster resources Create resource from file • kubectl create -f resource_file.yml Change existing (or create) resource based on file • kubectl apply -f resource_file.yml Delete existing resource • kubectl delete resource_type resource_name List resources of type • kubectl get resource_type Edit resource on the server • kubectl edit resource_type resource_name
  • 8. Debugging cluster resources Execute command on the container • kubectl exec [-it] pod_name process_to_run Get container logs • kubectl logs pod_name [-c container_name] Forward port from a pod • kubectl port-forward pod_name local_port:remote_port Print detailed description of a resource • kubectl describe resource_type resource_name
  • 9. Defining a pod Main definition components • api • resource type • metadata • spec
  • 10. Grouping pods - labels • Each pod can have multiple labels • Labels can be changed on a live pod • Basic mechanism to execute commands on multiple pods
  • 11. Pod health - liveness probe Out of the box (before the probe) • Pod defines a restart policy • Crashing process can be restarted by kubelet Process can be alive but unhealthy eg: • deadlocked • stuck in a loop Liveness probe is a way of telling kubelet that a process in no longer healthy and needs restarting 3 ways of querying: • http • tcp • exec Limitations of liveness probe
  • 12. Replica Sets Replication Controller Ensures desired number of pods exist by: • scaling up or down • running new pods when nodes fail Definition consists of: • label selector • replica count • pod template
  • 13. Demo
  • 14. Service Define logical groups of pods - label selectors Types: • ClusterIP (default) • LoadBalancer • NodePort • ExternalName Service is constant: • IP doesn’t change (except headless) • each service gets a dns entry
  • 15. Pod health - readiness probe Similar to liveness probe: • Defined in a pod • 3 types supported • similar parameters When probe fails pod is marked as not ready Not ready pods are removed from services
  • 16. Service - LoadBalancer • Allows automatic provisioning of load balancers • Needs to be supported by cloud provider • Exposes external IP to the cluster
  • 17. DEMO
  • 18. Deployments • Higher level resource • Deals with updating the application • Allows graceful rollback • Can pause or abort a bad release • Manages internally multiple replica sets • Changing pod template triggers update
  • 19. Deployments Revision history: • rolling back release • switching between releases • number of revisions can be specified Update strategy: • RollingUpdate • Recreate Detecting bad releases with minReadySeconds Specifying update process • MaxSurge • MaxUnavailable
  • 20. DEMO
  • 21. Passing configuration Pod definition can embed: • environment variables • command line parameters This couples pod definition with environment: • separate definitions for prod/test • changing configuration requires changing pod
  • 22. ConfigMap • Lives as a separate resource • Supports: • environment variables: • individual • entire environment • configuration files /directories • Live reloading of config if supported by pod • Missing ConfigMap prevents container from starting
  • 23. ConfigMap - basic usage Defining and passing single environment variable
  • 25. Secrets • Similar to configMap • Stored in memory on the nodes (includes mounting files) • Ability to store binary data - base64 encoded
  • 26. Where to go from here Managing persistent storage: • persistent volumes • persistent volume claims • storage class Advanced routing - ingress controllers Multiple replicas with own storage - stateful sets Even more resources - deamon sets, jobs, cronjobs Package management - Helm Managing Kubernetes through API Service mesh - Istio