SlideShare a Scribd company logo
Logical Kubernetes Architecture
API Server
Kube Scheduler
K8s Master
Controller
Manager
Etcd
Kubelet
Kube-proxy
K8s Worker
Pod
Pod
Pod
K8s Worker
Pod
Pod
Pod
K8s Worker
Pod
Pod
Pod
CNI CNI CNI
Docker
Kubelet
Kube-proxy
Docker
Kubelet
Kube-proxy
Docker
RESOURCES
POD
Container
Container
Pod
Pod
one or more application containers that are tightly
coupled, sharing network and storage.
Example: a web front-end Pod that consists of an NGINX
container and a PHP-FPM container with a shared unix socket
and a “init” container to transform their config files based on
environment variables.
Container
Container
Pod
ReplicaSet
Extends Pod resource to run and maintain a specific
number of copies of a pod.
Container
Container
Pod
ReplicaSet
Container
Container
Pod
Deployment
a controller that ensures a set number of replicas of
a Pod is running and provides update and upgrade
workflows for your Pods.
Example: cloud native Node app that scales horizontally and
upgrades 2 pods at a time.
Container
Container
Pod
ReplicaSet
Deployment
Container
Container
Pod
statefulset
a controller that manages stateful application
Deployments by providing sticky identity for pods
and strict ordering and uniqueness.
Example: Cassandra database. First pod is ‘cassandra-0’ thus
all other pods in the set can be told to cluster to ‘cassandra-0’
and it will form a ring, plus the storage will survive pod
restarts.
Container
Container
Pod
ReplicaSet
Deployment
Statefulset
Volume
Container
Container
Pod
Volume
Is [effectively] a Directory, possibly with data in it,
available to all containers in a Pod.
Usually Shares lifecycle of a Pod (Created when Pod
is created, destroyed when Pod is destroyed).
Persistent Volumes outlive Pods.
Can be mounted from local disk, or from a network
storage device such as a EBS volume, iscsi, NFS, etc.
Service
Service
track Pods based on metadata and provides
connectivity and service discovery (DNS, Env
variables) for them.
Type
ClusterIP (default) exposes service on a cluster-
internal IP.
Container
Container
Pod
app=bacon
Container
Container
Pod
app=bacon
Service
app=bacon 10.3.55.7
Service
track Pods based on metadata and provides
connectivity and service discovery (DNS, Env
variables) for them.
Type
NodePort extends ClusterIP to expose services on
each node’s IP via a static port.
Container
Container
Pod
app=bacon
Container
Container
Pod
app=bacon
Service
app=bacon 10.3.55.7
192.168.0.5:4530
K8s Worker K8s Worker
192.168.0.6:4530
Service
track Pods based on metadata and provides
connectivity and service discovery (DNS, Env
variables) for them.
Type
LoadBalancer extends NodePort to configure a cloud
provider’s load balancer using the cloud-controller-
manager.
Container
Container
Pod
app=bacon
Container
Container
Pod
app=bacon
Service
app=bacon 10.3.55.7
192.168.0.5:4530
K8s Worker K8s Worker
192.168.0.6:4530
Load Balancer
33.6.5.22:80
Ingress
a controller that manages an external entity to provide
load balancing, SSL termination and name-based
virtual hosting to services based on a set of rules.
Ingress
Service
app=bacon
https://example.com
Service
app=eggs
/bacon eggs
Config Map / Secret
Provides key-value pairs to be injected into a pod much like user-data is injected into a Virtual
Machine in the cloud.
Allows you to do last minute configuration of applications running on Kubernetes such as
setting a database host, or a admin password.
ConfigMaps store values as strings, Secrets store them as byte arrays (serialized as base64
encoded strings).
Secrets are [currently] not encrypted by default. This is likely to change.
Can be injected as files in a Volume, or as Environment Variables.
ConfigMaps/Secrets (user-data)
Controller
Controllers are effectively a infinite loop that interacts with the
kubernetes API to ensure the actual state of a resource matches
the declared state.
#!/bin/bash
while true; do
count=$(kubectl get pods | grep nginx | wc -l)
if $count < 5; then
kubectl run --image=nginx nginx
fi
sleep 120
done
Operator
Introduction to Kubernetes
Kubernetes Manifest
apiVersion:
kind:
metadata:
spec:
Kubernetes Manifest
apiVersion: v1
kind: Service
metadata:
name: hello-svc
spec:
ports:
- port: 80
protocol: TCP
targetPort:
8080
selector:
app: hello-
world
type: NodePort
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
app: hello-world
name: hello-app
spec:
replicas: 2
template:
metadata:
labels:
app: hello-world
spec:
containers:
- image: paulczar/hello-
world
name: hello-world
hello-app Pod
app=hello-world
hello-app Pod
app=hello-world
hello-svc Service
app=hello-world
http
80
http 8080 - load balanced
Kubernetes Manifest
https://url
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hello-goodbye
spec:
rules:
- http:
paths:
- path: /hello
backend:
serviceName: hello-svc
servicePort: 80
- http:
paths:
- path: /goodbye
backend:
serviceName: goodbye-svc
servicePort: 81
ingress-nginx
app=hello-world
hello-app Pod
app=hello-world
hello-svc Service
app=hello-world
http 8080
hello-app Pod
app=goodbye-world
goodbye-svc
Service
app=goodbye-world
http 8080
http://url/hello http://url/goodbye
$ kubectl apply -f manifests/
deployment "hello-app" created
service "hello-svc" created
deployment "goodbye-app" created
service "goodbye-svc" created
ingress "hello-goodbye" created
$ curl -k https://$(minikube ip)/hello
Hello World!
$ curl -k https://$(minikube ip)/goodbye
Goodbye Cruel world!
DEMO
Just Enough Modernization for Kubernetes (JEMFORK)
I. Codebase — One codebase tracked in revision control, many deploys
II. Dependencies — Explicitly declare and isolate dependencies
III. Config — Store config in the environment
IV. Backing Services — Treat backing services as attached resources
V. Build, release, run — Strictly separate build and run stages
VI. Processes — Execute the app as one or more stateless processes
Just Enough Modernization for Kubernetes (JEMFORK)
VII. Port binding — Export services via port binding
VIII. Concurrency — Scale out via the process model
IX. Disposability — Maximize robustness with fast startup and graceful shutdown
X. Dev/prod parity — Keep development, staging, and production as similar as possible
XI. Logs — Treat logs as event streams
XII. Admin processes — Run admin/management tasks as one-off processes
Just Enough Modernization for Kubernetes (JEMFORK)
III. Config — Store config in the environment
Just Enough Modernization for Kubernetes (JEMFORK)
Environment Variables
Just Enough Modernization for Kubernetes (JEMFORK)
Environment Variables
https://scoutapark.com
ingress-nginx
scout-nginx Pod
app=scout-nginx
scout-nginx
Service
app=scout-nginx
http 8080
wordpress Pod
app=wordpress
wordpress Service
app=wordpress
http 8080
http://scoutapark.com/ http://scoutapark.com/blog
scout-php Service
app=scout-php
tcp 9000
mysql Service
app=mysql
mysql Pod
app=mysql
tcp 3306
scout-php Pod
app=scout-php
<INSERT DEMO HERE>

More Related Content

PDF
Kubernetes for the PHP developer
PPTX
Kubernetes day 2 Operations
PPTX
Application Modernization with PKS / Kubernetes
PDF
A DevOps guide to Kubernetes
PPSX
Docker Kubernetes Istio
PPTX
Kubernetes and Istio
PDF
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
PDF
Kubernetes extensibility
Kubernetes for the PHP developer
Kubernetes day 2 Operations
Application Modernization with PKS / Kubernetes
A DevOps guide to Kubernetes
Docker Kubernetes Istio
Kubernetes and Istio
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
Kubernetes extensibility

What's hot (20)

PDF
KubeCon EU 2016: ITNW (If This Now What): Orchestrating an Enterprise
PDF
Kubernetes automation in production
PDF
Kubernetes Ingress 101
PDF
Devops - Microservice and Kubernetes
PDF
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
PPTX
Why kubernetes matters
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PDF
From Code to Kubernetes
PDF
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
PDF
Helm - Package Manager for Kubernetes
PPTX
Introduction to Kubernetes
PDF
Container orchestration from theory to practice
ODP
Enabling ceph-mgr to control Ceph services via Kubernetes
PPTX
OpenShift Enterprise 3.1 vs kubernetes
PDF
Introduction to kubernetes
PDF
Kubernetes Architecture - beyond a black box - Part 2
PPTX
Kubernetes 101 VMworld 2019 workshop slides
PDF
Social Connections 14 - Kubernetes Basics for Connections Admins
PDF
Kubernetes 101 and Fun
PDF
Orchestrating Microservices with Kubernetes
KubeCon EU 2016: ITNW (If This Now What): Orchestrating an Enterprise
Kubernetes automation in production
Kubernetes Ingress 101
Devops - Microservice and Kubernetes
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
Why kubernetes matters
K8s in 3h - Kubernetes Fundamentals Training
From Code to Kubernetes
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
Helm - Package Manager for Kubernetes
Introduction to Kubernetes
Container orchestration from theory to practice
Enabling ceph-mgr to control Ceph services via Kubernetes
OpenShift Enterprise 3.1 vs kubernetes
Introduction to kubernetes
Kubernetes Architecture - beyond a black box - Part 2
Kubernetes 101 VMworld 2019 workshop slides
Social Connections 14 - Kubernetes Basics for Connections Admins
Kubernetes 101 and Fun
Orchestrating Microservices with Kubernetes
Ad

Similar to Introduction to Kubernetes (20)

PPTX
Kubernetes
PDF
Intro to Kubernetes
PPTX
Kubernetes
PPTX
Introduction to kubernetes
PPTX
Introduction kubernetes 2017_12_24
PDF
Kubernetes From Scratch .pdf
PDF
Introduction to Kubernetes Workshop
PDF
DevJam 2019 - Introduction to Kubernetes
PDF
Scaling Microservices with Kubernetes
PDF
Scaling docker with kubernetes
PDF
Meetup 2023 - Gateway API.pdf
PPTX
08 - kubernetes.pptx
PDF
(Draft) Kubernetes - A Comprehensive Overview
PPTX
Introduction+to+Kubernetes-Details-D.pptx
PDF
Kubernetes - A Comprehensive Overview
PDF
Kubernetes acomprehensiveoverview
PPTX
Kubernetes PPT.pptx
PDF
Kubernetes
PDF
Kubernetes a comprehensive overview
PPTX
Kubernetes Workshop
Kubernetes
Intro to Kubernetes
Kubernetes
Introduction to kubernetes
Introduction kubernetes 2017_12_24
Kubernetes From Scratch .pdf
Introduction to Kubernetes Workshop
DevJam 2019 - Introduction to Kubernetes
Scaling Microservices with Kubernetes
Scaling docker with kubernetes
Meetup 2023 - Gateway API.pdf
08 - kubernetes.pptx
(Draft) Kubernetes - A Comprehensive Overview
Introduction+to+Kubernetes-Details-D.pptx
Kubernetes - A Comprehensive Overview
Kubernetes acomprehensiveoverview
Kubernetes PPT.pptx
Kubernetes
Kubernetes a comprehensive overview
Kubernetes Workshop
Ad

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Cloud computing and distributed systems.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
The AUB Centre for AI in Media Proposal.docx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Electronic commerce courselecture one. Pdf
Cloud computing and distributed systems.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Monthly Chronicles - July 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf

Introduction to Kubernetes

  • 1. Logical Kubernetes Architecture API Server Kube Scheduler K8s Master Controller Manager Etcd Kubelet Kube-proxy K8s Worker Pod Pod Pod K8s Worker Pod Pod Pod K8s Worker Pod Pod Pod CNI CNI CNI Docker Kubelet Kube-proxy Docker Kubelet Kube-proxy Docker
  • 3. POD
  • 4. Container Container Pod Pod one or more application containers that are tightly coupled, sharing network and storage. Example: a web front-end Pod that consists of an NGINX container and a PHP-FPM container with a shared unix socket and a “init” container to transform their config files based on environment variables.
  • 5. Container Container Pod ReplicaSet Extends Pod resource to run and maintain a specific number of copies of a pod. Container Container Pod ReplicaSet
  • 6. Container Container Pod Deployment a controller that ensures a set number of replicas of a Pod is running and provides update and upgrade workflows for your Pods. Example: cloud native Node app that scales horizontally and upgrades 2 pods at a time. Container Container Pod ReplicaSet Deployment
  • 7. Container Container Pod statefulset a controller that manages stateful application Deployments by providing sticky identity for pods and strict ordering and uniqueness. Example: Cassandra database. First pod is ‘cassandra-0’ thus all other pods in the set can be told to cluster to ‘cassandra-0’ and it will form a ring, plus the storage will survive pod restarts. Container Container Pod ReplicaSet Deployment Statefulset
  • 9. Container Container Pod Volume Is [effectively] a Directory, possibly with data in it, available to all containers in a Pod. Usually Shares lifecycle of a Pod (Created when Pod is created, destroyed when Pod is destroyed). Persistent Volumes outlive Pods. Can be mounted from local disk, or from a network storage device such as a EBS volume, iscsi, NFS, etc.
  • 11. Service track Pods based on metadata and provides connectivity and service discovery (DNS, Env variables) for them. Type ClusterIP (default) exposes service on a cluster- internal IP. Container Container Pod app=bacon Container Container Pod app=bacon Service app=bacon 10.3.55.7
  • 12. Service track Pods based on metadata and provides connectivity and service discovery (DNS, Env variables) for them. Type NodePort extends ClusterIP to expose services on each node’s IP via a static port. Container Container Pod app=bacon Container Container Pod app=bacon Service app=bacon 10.3.55.7 192.168.0.5:4530 K8s Worker K8s Worker 192.168.0.6:4530
  • 13. Service track Pods based on metadata and provides connectivity and service discovery (DNS, Env variables) for them. Type LoadBalancer extends NodePort to configure a cloud provider’s load balancer using the cloud-controller- manager. Container Container Pod app=bacon Container Container Pod app=bacon Service app=bacon 10.3.55.7 192.168.0.5:4530 K8s Worker K8s Worker 192.168.0.6:4530 Load Balancer 33.6.5.22:80
  • 14. Ingress a controller that manages an external entity to provide load balancing, SSL termination and name-based virtual hosting to services based on a set of rules. Ingress Service app=bacon https://example.com Service app=eggs /bacon eggs
  • 15. Config Map / Secret
  • 16. Provides key-value pairs to be injected into a pod much like user-data is injected into a Virtual Machine in the cloud. Allows you to do last minute configuration of applications running on Kubernetes such as setting a database host, or a admin password. ConfigMaps store values as strings, Secrets store them as byte arrays (serialized as base64 encoded strings). Secrets are [currently] not encrypted by default. This is likely to change. Can be injected as files in a Volume, or as Environment Variables. ConfigMaps/Secrets (user-data)
  • 18. Controllers are effectively a infinite loop that interacts with the kubernetes API to ensure the actual state of a resource matches the declared state. #!/bin/bash while true; do count=$(kubectl get pods | grep nginx | wc -l) if $count < 5; then kubectl run --image=nginx nginx fi sleep 120 done
  • 22. Kubernetes Manifest apiVersion: v1 kind: Service metadata: name: hello-svc spec: ports: - port: 80 protocol: TCP targetPort: 8080 selector: app: hello- world type: NodePort apiVersion: apps/v1beta1 kind: Deployment metadata: labels: app: hello-world name: hello-app spec: replicas: 2 template: metadata: labels: app: hello-world spec: containers: - image: paulczar/hello- world name: hello-world hello-app Pod app=hello-world hello-app Pod app=hello-world hello-svc Service app=hello-world http 80 http 8080 - load balanced
  • 23. Kubernetes Manifest https://url apiVersion: extensions/v1beta1 kind: Ingress metadata: name: hello-goodbye spec: rules: - http: paths: - path: /hello backend: serviceName: hello-svc servicePort: 80 - http: paths: - path: /goodbye backend: serviceName: goodbye-svc servicePort: 81 ingress-nginx app=hello-world hello-app Pod app=hello-world hello-svc Service app=hello-world http 8080 hello-app Pod app=goodbye-world goodbye-svc Service app=goodbye-world http 8080 http://url/hello http://url/goodbye
  • 24. $ kubectl apply -f manifests/ deployment "hello-app" created service "hello-svc" created deployment "goodbye-app" created service "goodbye-svc" created ingress "hello-goodbye" created $ curl -k https://$(minikube ip)/hello Hello World! $ curl -k https://$(minikube ip)/goodbye Goodbye Cruel world!
  • 25. DEMO
  • 26. Just Enough Modernization for Kubernetes (JEMFORK) I. Codebase — One codebase tracked in revision control, many deploys II. Dependencies — Explicitly declare and isolate dependencies III. Config — Store config in the environment IV. Backing Services — Treat backing services as attached resources V. Build, release, run — Strictly separate build and run stages VI. Processes — Execute the app as one or more stateless processes
  • 27. Just Enough Modernization for Kubernetes (JEMFORK) VII. Port binding — Export services via port binding VIII. Concurrency — Scale out via the process model IX. Disposability — Maximize robustness with fast startup and graceful shutdown X. Dev/prod parity — Keep development, staging, and production as similar as possible XI. Logs — Treat logs as event streams XII. Admin processes — Run admin/management tasks as one-off processes
  • 28. Just Enough Modernization for Kubernetes (JEMFORK) III. Config — Store config in the environment
  • 29. Just Enough Modernization for Kubernetes (JEMFORK) Environment Variables
  • 30. Just Enough Modernization for Kubernetes (JEMFORK) Environment Variables
  • 31. https://scoutapark.com ingress-nginx scout-nginx Pod app=scout-nginx scout-nginx Service app=scout-nginx http 8080 wordpress Pod app=wordpress wordpress Service app=wordpress http 8080 http://scoutapark.com/ http://scoutapark.com/blog scout-php Service app=scout-php tcp 9000 mysql Service app=mysql mysql Pod app=mysql tcp 3306 scout-php Pod app=scout-php