Kubernetes Overview Diagrams

Sep 11, 2021 | - views

Kubernetes Architecture
Kubernetes Architecture
reads from / 
writes to
reads from /...
API server

tracking state of all cluster components and managing interactions between them
API server...
watches for changes
watches for changes
Controller Manager

runs all built-in controllers, like Node or Replication Controller r r%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%26lt%3Bb%26gt%3BCluster%20DNS%26lt%3B%2Fb%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BlabelBorderColor%3Dnone%3BstrokeColor%3D%232875E2%3BstrokeWidth%3D2%3Bshadow%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22180%22%20y%3D%22570%22%20width%3D%22145%22%20height%3D%2290%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E runru
Controller Manager...
etcd

key value store for all cluster configuration data
etcd...
Scheduler

distributes unscheduled workloads across the available worker nodes
Scheduler...
  talks to
  talks to
watches for changes
watches for changes
Cloud Controller Manager*

runs cloud controller processes that take care of e.g. 
Load Balancer endpoint or Storage volume allocation
Cloud Controller Manager*...
watches for changes
watches for changes
Cluster DNS*

provides in-cluster DNS for Pods and Services, usually provided using CoreDNS' K8s plugin
Cluster DNS*...
Worker Node(s)



























Worker Node(s)...
kubelet

manages containers based on incoming Pod specifications
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%26lt%3Bb%26gt%3BCluster%20DNS%26lt%3B%2Fb%26gt%3B%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BlabelBorderColor%3Dnone%3BstrokeColor%3D%232875E2%3BstrokeWidth%3D2%3Bshadow%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22180%22%20y%3D%22570%22%20width%3D%22145%22%20height%3D%2290%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
kubelet...
kube-proxy

manages network connections to the node's Pods, e.g. using iptables rules
kube-proxy...
Container Runtime

runtime that implements the CRI, like CRI-O or containerd
Container Runtime...
uses
uses
watches for

changes
watches for...
Cloud provider API*

API to manage cloud (AWS, Azure, GCP, ...) resources
Cloud provider API*...
*
*
Optional Component
Optional Component
Control Plane
Control Plane
Viewer does not support full SVG 1.1
Pod

smallest K8s compute resource containing 1..n containers
Pod...
Deployment

creates a ReplicaSet and takes care of rollouts and rollbacks
Deployment...
ReplicaSet

creates the desired amount of Pod instances
ReplicaSet...
Job

creates short living Pods for one time executions
Job...
CronJob


creates Jobs based on a time schedule
CronJob...
StatefulSet

creates Pods while handling the needs of stateful applications
StatefulSet...
ReplicationController

predecessor of Deployment, don't use it anymore
ReplicationController...
Horizontal Pod Autoscaler

scales the number of Pods based on various metrics
Horizontal Pod Autosca...
DaemonSet


creates exactly one Pod per Node
DaemonSet...
Kubernetes Workload Objects
Kubernetes Workload Objects
Init Container

container executing startup tasks, like e.g. database migration
Init Container...
Container

container with main or sidecar application
Container...
contains
contai...
Viewer does not support full SVG 1.1
Pod

exposes ports and communicates with other internal or external entities
Pod...
distributes traffic to
distributes traffic to
Service

load balances traffic between a number of selected Pods
Service...
exposes
exposes
refers to
refers to
Ingress

makes a Service accessible from the outside of the cluster
Ingress...
Kubernetes Networking Objects
Kubernetes Networking Objects
Endpoint

holds information about IP addresses of Pods and open ports they expose
Endpoint...
Endpoint Slice

successor of Endpoint, provides functional and scalability improvements
Endpoint Slice...
Network Policy

allows to whitelist ingress and egress traffic from and to Pods based on IP addresses, namespaces and pods
Network Policy...
refers to
refers to
Ingress Class

allows to specify which Ingress controller should implement an Ingress
Ingress Class...
collects endpoints of
collects endpoints of
Ingress Controller

implements specifications of Ingress resources
Ingress Controller...
whitelists

traffic from / to
whitel...
Cluster IP

makes the Service accessible only from within the cluster
Cluster IP...
Node Port

exposes the Service at each node's IP at a static port
Node Port...
Load Balancer

exposes the Service using an external load balancer
Load Balancer...
External Name

maps the service to an existing DNS FQDN
External Name...
uses one of
uses one of
Viewer does not support full SVG 1.1
mounts
mounts
Pod

compute unit that reads/writes from/to the filesystem
Pod...
refers to
refers to
Storage Class

configuration for different types of storage, e.g Local, NFS, GlusterFs, ...
Storage Class...
refers to
refers to
Persistent Volume

abstraction of a storage container including size and capabilities
Persistent Volume...
Kubernetes Storage Objects
Kubernetes Storage Objects
can be initialized from
can be initialized from
creates
creates
Volume Snapshot Content

a snapshot containing existing PVC
or pre-provisioned data
Volume Snapshot Content...
refers to
refers to
refers to
refers to
Volume Snapshot

requests to create a snapshot from a PVC with the given VSC
Volume Snapshot...
Volume Snapshot Class

same as Storage Class but for Volume Snapshots
Volume Snapshot Class...
requests part of
requests part of
Persistent Volume Claim

requests storage from a PV including required amount and access mode
Persistent Volume Claim...
Storage Class Provisioner

service that creates PVs for a certain SC
Storage Class Provisi...
mounts
mounts
emptyDir

acts as a temporary local storage during the lifespan of a Pod
emptyDir...
ConfigMap / Secret

contains data that can be read-only mounted to a filesystem
ConfigMap / Secret...
Generic Ephemeral Volumes

creates temporary PVCs using already existing Storage Classes
Generic Ephemeral Volum...
Viewer does not support full SVG 1.1
(Aggregated) Cluster Role

a collection of cluster global rules
(Aggregated) Cluster...
Kubernetes RBAC Objects
Kubernetes RBAC Objects
contains
contains
Role

a collection of namespace scoped rules
Role...
collects rules from
collects rules from
Cluster Role Binding

attaches rules from one Cluster Role to Users, Groups or SAs
Cluster Role Binding...
assigns rules to
assigns rules to
assigns rules to
assigns rules to
collects rules from
collects rules from
Role Binding

attaches rules from one Role or Cluster Role to Users, Groups or SAs
Role Binding...
Group

a collection of Users
Group...
can be part of 1..x
can be part of 1..x
User

a User that authenticates against the Kubernetes API server
User...
uses credentials of
uses credentials of
Pod

compute unit that can interact with the Kubernetes API server
Pod...
Service Account

namespaced Kubernetes managed user that is intended to be used by in-cluster processes
Service Account...
Rule









Rule...
Verb(s)

Get, List, ...
Verb(s)...
Resource(s)

Pod, Service, ...
Resource(s)...
Viewer does not support full SVG 1.1
Kubernetes Resource Requests and Limits
Kubernetes Resource Requests and Lim...
4000m
(=4 cores)
CPU
4000m...
Total node capacity
Total node capacity
Allocatable capacity
Allocatable capacity
3700m
3700m
8000Mi
(= 8GB)
RAM
8000Mi...
7400Mi
7400Mi
150m
150m
300Mi
300Mi
150m
150m
300Mi
300Mi
kube reserved
kube reserved
reserv. for sshd, init system, etc.
reserv. for sshd, init...
system reserved
system reserved
reserv. for kubelet, container runtime
reserv. for kubelet, co...
800m
800m
2900Mi
2900Mi
Requests
Requests
Limits
Limits
2100Mi
2100Mi
1500m
1500m
1600Mi
1600Mi
800m
800m
800Mi
800Mi
600m
600m
Pod B
Pod B
Pod A
Pod A
Pod C
Pod C
Leftover
Leftover
1000m
1000m
3000Mi
3000Mi
3000Mi
3000Mi
1800m
1800m
1700Mi
1700Mi
1100m
1100m
Pod B
Pod B
Pod A
Pod A
Pod C
Pod C
Overcom-mitment
Overcom-mit...
- pods' requests are being guaranteed
- overcommitment is not possible
- values used for pod scheduling
- pods' requests a...
- pods will get killed / throttled when reaching limit
- on overcommitment this may occur even before that
- pods will get kill...
- kubelet determines the node's CPU and memory capacity
- kubelet determines...
- kubelet retains memory and CPU reservations
- kubelet retains me...
Viewer does not support full SVG 1.1