Please enable JavaScript.
Coggle requires JavaScript to display documents.
4.3 Lecture Kubernetes Components (Enterprise Level) - Coggle Diagram
4.3 Lecture Kubernetes Components (Enterprise Level)
Kubernetes Control Plane
Definition
The Control Plane is the brain of the Kubernetes cluster.
It receives requests from users and automation tools.
It decides where applications should run.
It monitors the health of the cluster.
It maintains the desired state of the cluster.
Responsibilities
Schedule Pods
Monitor Nodes
Manage Cluster State
Store Configuration
Authenticate Users
Authorize Requests
Expose Kubernetes API
Recover Failed Workloads
Main Components
kube-apiserver
etcd
kube-scheduler
kube-controller-manager
cloud-controller-manager (Cloud Environment)
Kubernetes Worker Node
Definition
A Worker Node is the machine where containers actually run.
It executes workloads assigned by the Control Plane.
Components
kubelet
kube-proxy
Container Runtime
containerd
CRI-O
Responsibilities
Run Pods
Report Health
Pull Container Images
Mount Volumes
Execute Containers
Configure Networking
Kubernetes API Server (kube-apiserver)
Definition
The API Server is the front door of Kubernetes.
Every request goes through the API Server.
No component communicates directly with etcd.
All communication passes through the API Server.
Full Name
Kubernetes API Server
Purpose
Accept Requests
Validate Requests
Authenticate Users
Authorize Users
Admission Control
Store Data in etcd
Return Responses
Enterprise Importance
Central communication hub
Single source of truth
Secure API endpoint
Communication
kubectl
communicates with API Server
Scheduler
communicates with API Server
Controller Manager
communicates with API Server
Kubelet
communicates with API Server
Dashboard
communicates with API Server
CI/CD Pipelines
communicate with API Server
Default Secure Port
6443
Process
kube-apiserver
Binary Path
/usr/local/bin/kube-apiserver
Sometimes
/usr/bin/kube-apiserver
Static Pod Manifest
/etc/kubernetes/manifests/kube-apiserver.yaml
Certificates
/etc/kubernetes/pki/
Important Logs
journalctl -u kubelet
kubectl logs
Useful Commands
kubectl cluster-info
kubectl get componentstatuses
kubectl get --raw="/healthz"
kubectl get --raw="/readyz"
kubectl get --raw="/livez"
kubectl get pods -n kube-system
ps -ef | grep kube-apiserver
ss -tulpn | grep 6443
etcd
Definition
etcd is the distributed key-value database of Kubernetes.
It stores every object in the cluster.
Without etcd Kubernetes loses its state.
Full Name
Distributed Key Value Store
Stores
Pods
Deployments
Services
Secrets
ConfigMaps
Namespaces
Nodes
Roles
RoleBindings
Certificates
Enterprise Importance
Cluster database
Highly Available
Supports Backup and Restore
Default Port
2379 Client
2380 Peer
Binary
etcd
Manifest
/etc/kubernetes/manifests/etcd.yaml
Data Directory
/var/lib/etcd
Certificates
/etc/kubernetes/pki/etcd
Backup
etcdctl snapshot save backup.db
Restore
etcdctl snapshot restore backup.db
Useful Commands
kubectl get pods -n kube-system
ps -ef | grep etcd
ss -tulpn | grep 2379
ETCDCTL_API=3 etcdctl endpoint health
ETCDCTL_API=3 etcdctl member list
kube-scheduler
Definition
Scheduler decides which Worker Node should run a Pod.
It never creates Pods.
It only selects the best Node.
Responsibilities
Resource Calculation
CPU Check
Memory Check
Node Labels
Node Affinity
Taints
Tolerations
Pod Affinity
Pod Anti Affinity
Topology Spread
Scheduling Process
New Pod Created
API Server Stores Pod
Scheduler Detects Pending Pod
Scheduler Evaluates Nodes
Scheduler Chooses Best Node
API Server Updated
Kubelet Starts Pod
Binary
kube-scheduler
Manifest
/etc/kubernetes/manifests/kube-scheduler.yaml
Commands
kubectl get pods
kubectl describe pod
kubectl get events
ps -ef | grep scheduler
kube-controller-manager
Definition
Controller Manager continuously watches the cluster.
It compares the desired state with the actual state.
If they differ, it takes corrective action.
Controllers
Deployment Controller
ReplicaSet Controller
Node Controller
Job Controller
CronJob Controller
ServiceAccount Controller
Namespace Controller
Endpoint Controller
Persistent Volume Controller
Example
Desired Replicas
5
Running Replicas
3
Controller Creates
2 New Pods
Binary
kube-controller-manager
Manifest
/etc/kubernetes/manifests/kube-controller-manager.yaml
Commands
ps -ef | grep controller-manager
kubectl get deployment
kubectl get replicasets
kubectl get nodes
cloud-controller-manager
Definition
Connects Kubernetes with Cloud Providers.
Used In
AWS
Azure
Google Cloud
Oracle Cloud
Responsibilities
Load Balancers
Cloud Storage
Cloud Routes
Cloud Nodes
kubelet
Definition
kubelet is the primary agent running on every Worker Node.
It communicates with the API Server.
It ensures containers are running correctly.
Responsibilities
Register Node
Monitor Pods
Pull Images
Mount Volumes
Execute Containers
Restart Failed Containers
Report Status
Communication
API Server
Container Runtime
CSI Storage
CNI Network
Binary
kubelet
Configuration
/var/lib/kubelet/
Config File
/var/lib/kubelet/config.yaml
Certificates
/var/lib/kubelet/pki/
Service
systemctl status kubelet
Commands
systemctl status kubelet
journalctl -u kubelet
ps -ef | grep kubelet
kube-proxy
Definition
kube-proxy manages network traffic inside the cluster.
It allows Pods to communicate with each other.
It routes traffic to Services.
Responsibilities
Service Networking
Load Balancing
NAT Rules
iptables Management
IPVS Management
Networking Modes
iptables
IPVS
Configuration
ConfigMap
DaemonSet
Commands
kubectl get daemonset -n kube-system
iptables -L
ipvsadm -Ln
ps -ef | grep kube-proxy
Container Runtime
Definition
Software responsible for downloading container images and running containers.
Examples
containerd
CRI-O
Responsibilities
Pull Images
Start Containers
Stop Containers
Delete Containers
Commands
crictl ps
crictl images
crictl pods
ctr containers list
kubectl
Definition
Official Kubernetes command-line tool.
Configuration File
~/.kube/config
Common Commands
kubectl cluster-info
kubectl version
kubectl get nodes
kubectl get pods -A
kubectl describe node
kubectl describe pod
kubectl logs
kubectl exec
kubectl top nodes
kubectl top pods
Kubernetes PKI
Definition
Public Key Infrastructure used to secure communication.
Directory
/etc/kubernetes/pki/
Certificates
ca.crt
ca.key
apiserver.crt
apiserver.key
front-proxy-ca.crt
front-proxy-client.crt
etcd certificates
Static Pods
Definition
Pods managed directly by kubelet.
Used For
API Server
Scheduler
Controller Manager
etcd
Location
/etc/kubernetes/manifests/
Enterprise Communication Flow
User Executes
kubectl apply -f deployment.yaml
kubectl Sends Request
API Server
API Server
Authentication
Authorization
Admission Control
API Server
Stores Data
etcd
Scheduler
Detects Pending Pod
Scheduler
Selects Best Worker Node
API Server
Updates Pod Assignment
kubelet
Receives Assignment
Container Runtime
Pulls Image
Container Runtime
Starts Container
kubelet
Reports Status
Controller Manager
Monitors Desired State
kube-proxy
Routes Network Traffic
User
Accesses Application Through Service
Important Enterprise Linux Directories
/etc/kubernetes/
/etc/kubernetes/manifests/
/etc/kubernetes/pki/
/var/lib/kubelet/
/var/lib/etcd/
~/.kube/config
/etc/cni/net.d/
/opt/cni/bin/
Important Linux Services
systemctl status kubelet
systemctl restart kubelet
journalctl -u kubelet
ps -ef | grep kube
ss -tulpn
crictl ps
crictl images
kubectl get all -A
kubectl get nodes
kubectl get pods -A
kubectl describe node
kubectl describe pod
kubectl logs
kubectl exec
Enterprise Troubleshooting
API Server Down
Check kubelet
Check Static Pod
Check Port 6443
Check Certificates
Check Logs
etcd Failure
Check Health
Verify Data Directory
Restore Snapshot
Scheduler Failure
Pending Pods
Check Events
Check Resources
Controller Failure
Desired State Not Reconciled
Check Controller Logs
kubelet Failure
Node NotReady
Check Service
Check Logs
Check Certificates
kube-proxy Failure
Services Not Reachable
Check iptables
Check IPVS
Check DaemonSet