SlideShare a Scribd company logo
Kubernetes
Antonio Ojea
aojeagarcia@suse.com
Who am I
Computing Evolution
Application Deployment Evolution
Continuous Integration
Continuous Deployment
Feature
Development
Continuous
Integration
Continuous
Deployment
Digital Transformation
Developers
● Continuous Deployment
● SaaS
● Open Source
Sysadmins
● Automated Infrastructure
○ On Premises
○ Cloud Providers
● Virtual vs Real
● SRE: SLAs, SLOs, ...
DEVO
PS
CLO
UD
INFRA
Devops
What’s a container
The “Kubernetes” Phenomenon
● Created by Google engineers based on the internal Google's Borg system
● Kubernetes v1.0 was released on July 21, 2015, donated by Google to the
Cloud Native Computing Foundation (Linux Foundation)
KubeCon + CloudNativeCon Attendance
Kubernetes is ...
Kubernetes is ...
A platform for automating:
● deployment,
● scaling, and
● management
of containerized
applications.
It “just” provides the
building blocks.
Kubernetes is not a
platform as a service
(PaaS).
Kubernetes is not an
infrastructure as a service
(IaaS).
It doesn't dictate many of
the important aspects of
your desired system
“Traditional Deployments”
● Automation with “configuration
management” frameworks or
custom scripts
○ Additional code to maintain
● Packages as main artifacts
○ Dependency nightmare: OS,
libraries, language versions, ...
● Developers not involved in
deployments
“Kubernetes Deployments”
● Declarative deployment
○ Yaml file
○ It can be imperative too
● Containers as main artifacts
○ Self contained
○ Reproducible builds
● Developer directly to production
Kubernetes Architecture
“The entire system can now be described as an
unbounded number of independent asynchronous
control loops reading and writing from/to a
schematized resource store as the source of truth.
This model has proven to be very resilient, evolvable,
and extensible.”
- Brian Grant, co-chair emeritus, SIG-Architecture
Kubernetes Components
Pods
Smallest “unit of work”
Represent processes running on
the cluster
Ephemeral
Pods share:
● One or more container
● Volumes
● Namespaces
● Unique network IP
● Running directives
Key Pod Container Attributes
● name - The name of the container
● image - The container image
● ports - array of ports to expose. Can
be granted a friendly name and
protocol may be specified
● env - array of environment variables
● command - Entrypoint array (equiv
to Docker ENTRYPOINT)
● args - Arguments to pass to the
command (equiv to Docker CMD)
Container
name: nginx
image: nginx:stable-alpine
ports:
- containerPort: 80
name: http
protocol: TCP
env:
- name: MYVAR
value: isAwesome
command: [“/bin/sh”, “-c”]
args: [“echo ${MYVAR}”]
Kubernetes Intro
Drive current state → desired state
Observed state is truth
● Open World -- anything can happen
Act independently
● event-driven rather than centralized
orchestration
● But level-based for fault tolerance
observe
diff
act
Control loops
Workloads
● A Deployment provides declarative updates for Pods and ReplicaSets.
● A ReplicaSet’s purpose is to maintain a stable set of replica Pods running.
● Satefulsets: Manages the deployment and scaling of a set of Pods and
provides guarantees about the ordering and uniqueness of these Pods.
● A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
● A Job creates one or more Pods and ensures that a specified number of
them successfully terminate.
Networking
Pod networking
● Pods can communicate with all other containers without NAT.
● Nodes can communicate with all Pods without NAT, and vice-versa.
● The IP that a Pod sees itself as is the same IP that others see it as.
Services, Load Balancers and Networking
Services are an abstract way to
expose an application running
on a set of Pods.
● ClusterIP
● NodePort
● LoadBalancer
● Ingress
Services
Ingress – Name Based Routing
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: name-virtual-host-ingress
spec:
rules:
- host: first.bar.com
http:
paths:
- backend:
serviceName: service1
servicePort: 80
- host: second.foo.com
http:
paths:
- backend:
serviceName: service2
servicePort: 80
- http:
paths:
- backend:
serviceName: service3
servicePort: 80
● An API object that manages
external access to the services
in a cluster
● Provides load balancing, SSL
termination and
name/path-based virtual
hosting
● Gives services
externally-reachable URLs
Ingress
Namespaces
Namespaces are a logical cluster or environment, and are
the primary method of partitioning a cluster or scoping
access.
apiVersion: v1
kind: Namespace
metadata:
name: prod
labels:
app: MyBigWebApp
Labels and Selectors
Labels are key/value pairs
that are attached to objects,
such as pods.
Selectors use labels to filter
or select objects, and are
used throughout Kubernetes.
apiVersion: v1
kind: Pod
metadata:
name: pod-label-example
labels:
app: nginx
env: prod
spec:
containers:
- name: nginx
image: nginx:stable-alpine
ports:
- containerPort: 80
nodeSelector:
gpu: nvidia
Configuration
Kubernetes allow to separate your configurations from your
Pods and components using ConfigMaps and Secrets.
● ConfigMaps are useful for storing and sharing non-sensitive, unencrypted
configuration information
● Secrets, ideal for username/passwords, certificates or other sensitive
information that should not be stored in a container.
Storage
Pods by themselves are useful, but many workloads require
exchanging data between containers, or persisting some
form of data. For this we have:
● Volumes
● PersistentVolumes
● PersistentVolumeClaims
● StorageClasses
Volumes
● Storage that is tied to the Pod’s Lifecycle.
● A pod can have one or more types of volumes attached
to it.
● Can be consumed by any of the containers within the
pod.
● Survive Pod restarts; however their durability beyond
that is dependent on the Volume Type.
Persistent Volumes
● A PersistentVolume (PV) represents a storage resource.
● PVs are a cluster wide resource linked to a backing
storage provider: NFS, GCEPersistentDisk, RBD etc.
● Their lifecycle is handled independently from a pod
● CANNOT be attached to a Pod directly. Relies on a
PersistentVolumeClaim
PersistentVolumeClaims
● A PersistentVolumeClaim (PVC) is a namespaced
request for storage.
● Satisfies a set of requirements instead of mapping to a
storage resource directly.
● Ensures that an application’s ‘claim’ for storage is
portable across numerous backends or providers.
Example: 3 Tier Application
MySQLWordpressnginx
Demo: https://github.com/aojea/kubernetes-labs/tree/master/nginx-wordpress-mysql
https://asciinema.org/a/307833
Kubernetes Ecosystem and CNCF
Contact
Q&A

More Related Content

PDF
Kubernetes Basics
PDF
Kubernetes Introduction
PDF
Kubernetes
PDF
Kubernetes: A Short Introduction (2019)
PDF
Kubernetes 101 - an Introduction to Containers, Kubernetes, and OpenShift
PDF
Kubernetes 101
PDF
Introduction to Kubernetes Workshop
PPTX
Introduction to kubernetes
Kubernetes Basics
Kubernetes Introduction
Kubernetes
Kubernetes: A Short Introduction (2019)
Kubernetes 101 - an Introduction to Containers, Kubernetes, and OpenShift
Kubernetes 101
Introduction to Kubernetes Workshop
Introduction to kubernetes

What's hot (20)

PPTX
Kubernetes for Beginners: An Introductory Guide
PPTX
Monitoring, Logging and Tracing on Kubernetes
PPTX
Kubernetes PPT.pptx
PDF
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
PDF
Introduction to Red Hat OpenShift 4
PDF
Deploying your first application with Kubernetes
PPTX
Kubernetes Introduction
PPT
Containers 101
PPTX
Kubernetes
ODP
Kubernetes Architecture
PPTX
Kubernetes 101 for Beginners
PDF
An intro to Kubernetes operators
PDF
Hands-On Introduction to Kubernetes at LISA17
PDF
Introduction to kubernetes
PDF
Kubernetes
PDF
An overview of the Kubernetes architecture
PPTX
Introduction to Kubernetes
PDF
[KubeCon EU 2022] Running containerd and k3s on macOS
ODP
Openshift Container Platform
PDF
(Draft) Kubernetes - A Comprehensive Overview
Kubernetes for Beginners: An Introductory Guide
Monitoring, Logging and Tracing on Kubernetes
Kubernetes PPT.pptx
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Introduction to Red Hat OpenShift 4
Deploying your first application with Kubernetes
Kubernetes Introduction
Containers 101
Kubernetes
Kubernetes Architecture
Kubernetes 101 for Beginners
An intro to Kubernetes operators
Hands-On Introduction to Kubernetes at LISA17
Introduction to kubernetes
Kubernetes
An overview of the Kubernetes architecture
Introduction to Kubernetes
[KubeCon EU 2022] Running containerd and k3s on macOS
Openshift Container Platform
(Draft) Kubernetes - A Comprehensive Overview
Ad

Similar to Kubernetes Intro (20)

PDF
Kubernetes for Beginners
PDF
A DevOps guide to Kubernetes
PDF
DevOps in AWS with Kubernetes
PPTX
Introduction to Kubernetes
PDF
Kubernetes for the PHP developer
PPTX
Kubernetes: від знайомства до використання у CI/CD
PPTX
DevOps with Kubernetes
PDF
Intro to Kubernetes
PDF
Kubernetes From Scratch .pdf
PPTX
Kubernetes-Presentation-Syed-Murtaza-Hassan
PPTX
Kubernetes
PDF
Kubernetes Basics - ICP Workshop Batch II
PDF
DevJam 2019 - Introduction to Kubernetes
PPTX
Kubernetes overview 101
PDF
Quick introduction to Kubernetes
PDF
prodops.io k8s presentation
PDF
Kubernetes: My BFF
PDF
Docker Madison, Introduction to Kubernetes
PPTX
Kubernetes Internals
PDF
Cluster management with Kubernetes
Kubernetes for Beginners
A DevOps guide to Kubernetes
DevOps in AWS with Kubernetes
Introduction to Kubernetes
Kubernetes for the PHP developer
Kubernetes: від знайомства до використання у CI/CD
DevOps with Kubernetes
Intro to Kubernetes
Kubernetes From Scratch .pdf
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes
Kubernetes Basics - ICP Workshop Batch II
DevJam 2019 - Introduction to Kubernetes
Kubernetes overview 101
Quick introduction to Kubernetes
prodops.io k8s presentation
Kubernetes: My BFF
Docker Madison, Introduction to Kubernetes
Kubernetes Internals
Cluster management with Kubernetes
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Machine Learning_overview_presentation.pptx
PDF
Mushroom cultivation and it's methods.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Approach and Philosophy of On baking technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
August Patch Tuesday
PDF
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TLE Review Electricity (Electricity).pptx
1. Introduction to Computer Programming.pptx
Tartificialntelligence_presentation.pptx
Heart disease approach using modified random forest and particle swarm optimi...
A comparative analysis of optical character recognition models for extracting...
Machine Learning_overview_presentation.pptx
Mushroom cultivation and it's methods.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Spectral efficient network and resource selection model in 5G networks
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cloud_computing_Infrastucture_as_cloud_p
August Patch Tuesday
Unlocking AI with Model Context Protocol (MCP)

Kubernetes Intro

  • 6. Digital Transformation Developers ● Continuous Deployment ● SaaS ● Open Source Sysadmins ● Automated Infrastructure ○ On Premises ○ Cloud Providers ● Virtual vs Real ● SRE: SLAs, SLOs, ... DEVO PS CLO UD INFRA
  • 9. The “Kubernetes” Phenomenon ● Created by Google engineers based on the internal Google's Borg system ● Kubernetes v1.0 was released on July 21, 2015, donated by Google to the Cloud Native Computing Foundation (Linux Foundation)
  • 12. Kubernetes is ... A platform for automating: ● deployment, ● scaling, and ● management of containerized applications. It “just” provides the building blocks. Kubernetes is not a platform as a service (PaaS). Kubernetes is not an infrastructure as a service (IaaS). It doesn't dictate many of the important aspects of your desired system
  • 13. “Traditional Deployments” ● Automation with “configuration management” frameworks or custom scripts ○ Additional code to maintain ● Packages as main artifacts ○ Dependency nightmare: OS, libraries, language versions, ... ● Developers not involved in deployments “Kubernetes Deployments” ● Declarative deployment ○ Yaml file ○ It can be imperative too ● Containers as main artifacts ○ Self contained ○ Reproducible builds ● Developer directly to production
  • 14. Kubernetes Architecture “The entire system can now be described as an unbounded number of independent asynchronous control loops reading and writing from/to a schematized resource store as the source of truth. This model has proven to be very resilient, evolvable, and extensible.” - Brian Grant, co-chair emeritus, SIG-Architecture
  • 16. Pods Smallest “unit of work” Represent processes running on the cluster Ephemeral Pods share: ● One or more container ● Volumes ● Namespaces ● Unique network IP ● Running directives
  • 17. Key Pod Container Attributes ● name - The name of the container ● image - The container image ● ports - array of ports to expose. Can be granted a friendly name and protocol may be specified ● env - array of environment variables ● command - Entrypoint array (equiv to Docker ENTRYPOINT) ● args - Arguments to pass to the command (equiv to Docker CMD) Container name: nginx image: nginx:stable-alpine ports: - containerPort: 80 name: http protocol: TCP env: - name: MYVAR value: isAwesome command: [“/bin/sh”, “-c”] args: [“echo ${MYVAR}”]
  • 19. Drive current state → desired state Observed state is truth ● Open World -- anything can happen Act independently ● event-driven rather than centralized orchestration ● But level-based for fault tolerance observe diff act Control loops
  • 20. Workloads ● A Deployment provides declarative updates for Pods and ReplicaSets. ● A ReplicaSet’s purpose is to maintain a stable set of replica Pods running. ● Satefulsets: Manages the deployment and scaling of a set of Pods and provides guarantees about the ordering and uniqueness of these Pods. ● A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. ● A Job creates one or more Pods and ensures that a specified number of them successfully terminate.
  • 21. Networking Pod networking ● Pods can communicate with all other containers without NAT. ● Nodes can communicate with all Pods without NAT, and vice-versa. ● The IP that a Pod sees itself as is the same IP that others see it as.
  • 22. Services, Load Balancers and Networking Services are an abstract way to expose an application running on a set of Pods. ● ClusterIP ● NodePort ● LoadBalancer ● Ingress
  • 24. Ingress – Name Based Routing apiVersion: extensions/v1beta1 kind: Ingress metadata: name: name-virtual-host-ingress spec: rules: - host: first.bar.com http: paths: - backend: serviceName: service1 servicePort: 80 - host: second.foo.com http: paths: - backend: serviceName: service2 servicePort: 80 - http: paths: - backend: serviceName: service3 servicePort: 80 ● An API object that manages external access to the services in a cluster ● Provides load balancing, SSL termination and name/path-based virtual hosting ● Gives services externally-reachable URLs
  • 26. Namespaces Namespaces are a logical cluster or environment, and are the primary method of partitioning a cluster or scoping access. apiVersion: v1 kind: Namespace metadata: name: prod labels: app: MyBigWebApp
  • 27. Labels and Selectors Labels are key/value pairs that are attached to objects, such as pods. Selectors use labels to filter or select objects, and are used throughout Kubernetes. apiVersion: v1 kind: Pod metadata: name: pod-label-example labels: app: nginx env: prod spec: containers: - name: nginx image: nginx:stable-alpine ports: - containerPort: 80 nodeSelector: gpu: nvidia
  • 28. Configuration Kubernetes allow to separate your configurations from your Pods and components using ConfigMaps and Secrets. ● ConfigMaps are useful for storing and sharing non-sensitive, unencrypted configuration information ● Secrets, ideal for username/passwords, certificates or other sensitive information that should not be stored in a container.
  • 29. Storage Pods by themselves are useful, but many workloads require exchanging data between containers, or persisting some form of data. For this we have: ● Volumes ● PersistentVolumes ● PersistentVolumeClaims ● StorageClasses
  • 30. Volumes ● Storage that is tied to the Pod’s Lifecycle. ● A pod can have one or more types of volumes attached to it. ● Can be consumed by any of the containers within the pod. ● Survive Pod restarts; however their durability beyond that is dependent on the Volume Type.
  • 31. Persistent Volumes ● A PersistentVolume (PV) represents a storage resource. ● PVs are a cluster wide resource linked to a backing storage provider: NFS, GCEPersistentDisk, RBD etc. ● Their lifecycle is handled independently from a pod ● CANNOT be attached to a Pod directly. Relies on a PersistentVolumeClaim
  • 32. PersistentVolumeClaims ● A PersistentVolumeClaim (PVC) is a namespaced request for storage. ● Satisfies a set of requirements instead of mapping to a storage resource directly. ● Ensures that an application’s ‘claim’ for storage is portable across numerous backends or providers.
  • 33. Example: 3 Tier Application MySQLWordpressnginx
  • 37. Q&A