Please enable JavaScript.
Coggle requires JavaScript to display documents.
4.1 Lecture Kubernetes Fundamentals (Introduction) - Coggle Diagram
4.1 Lecture Kubernetes Fundamentals (Introduction)
Kubernetes (K8s)
Definition
Kubernetes is an Enterprise Container Orchestration Platform.
Orchestration means automatically managing containers instead of manually creating, stopping, restarting, updating, and monitoring them.
Kubernetes manages hundreds or thousands of containers across multiple Linux servers.
Kubernetes was originally developed by Google.
Kubernetes is now maintained by the Cloud Native Computing Foundation (CNCF).
Kubernetes is open source.
Kubernetes automates application deployment, scaling, networking, storage, recovery, monitoring, and updates.
Why Kubernetes Was Created
Traditional Applications
Installed directly on one physical server.
Difficult to scale.
Hardware failures caused application downtime.
Updating applications often required downtime.
Virtual Machines
Better isolation than physical servers.
Multiple operating systems on one physical server.
Each Virtual Machine requires its own operating system.
High memory usage.
Slow boot time.
Containers
Share the host Linux kernel.
Lightweight.
Fast startup.
Portable.
Easy to package applications.
Problem with Containers
Docker can run containers.
Docker cannot efficiently manage thousands of containers across many servers.
Manual management becomes impossible.
Kubernetes Solution
Automatically schedules containers.
Automatically restarts failed containers.
Automatically scales applications.
Automatically performs rolling updates.
Automatically balances network traffic.
Automatically manages storage.
Automatically replaces failed servers.
Meaning of Kubernetes
Greek Origin
Kubernetes means Helmsman.
Helmsman is the person steering a ship.
Kubernetes steers containerized applications.
Logo
Seven-spoke steering wheel.
Represents container orchestration.
Short Form
K8s
K
Eight omitted letters
S
Enterprise Problems Solved
High Availability
Application always remains available.
If one server fails another server continues serving users.
Auto Healing
Failed containers restart automatically.
Failed nodes replaced automatically.
Auto Scaling
Increase containers during high traffic.
Decrease containers during low traffic.
Load Balancing
Distributes traffic evenly.
Prevents server overload.
Rolling Updates
Upgrade application without downtime.
Rollback
Return to previous version if update fails.
Service Discovery
Applications communicate without knowing server IP addresses.
Storage Management
Persistent storage for databases.
Security
Authentication
Authorization
Encryption
Secrets Management
Enterprise Example
Company
Amazon
Google
Microsoft
Netflix
Uber
Banks
Airlines
Example Scenario
Web Server
100 Containers
API Server
50 Containers
Database
10 Containers
Kubernetes manages all automatically.
Container Orchestration
Definition
Automated management of containers across multiple Linux servers.
Tasks
Deploy containers.
Stop containers.
Restart failed containers.
Scale applications.
Load balance traffic.
Monitor health.
Schedule containers.
Manage storage.
Manage networking.
Perform rolling updates.
Kubernetes Cluster
Definition
Group of Linux servers working together.
Types
Control Plane Node
Controls the cluster.
Worker Nodes
Run applications.
Enterprise Example
Control Plane
controller01
Worker Nodes
worker01
worker02
worker03
Kubernetes Architecture
Control Plane
kube-apiserver
Definition
Main entry point.
All communication goes through API Server.
Responsibilities
Accept requests.
Validate requests.
Store configuration.
Authenticate users.
Default Port
6443
Binary
kube-apiserver
Linux Path
/etc/kubernetes/manifests/kube-apiserver.yaml
etcd
Definition
Distributed key-value database.
Stores
Cluster configuration.
Secrets.
Nodes.
Pods.
Services.
Configurations.
Default Port
2379
Data Directory
/var/lib/etcd
kube-scheduler
Definition
Chooses which worker node should run each Pod.
Scheduling Decision Based On
CPU
RAM
Node Labels
Affinity
Taints
Tolerations
Manifest
/etc/kubernetes/manifests/kube-scheduler.yaml
kube-controller-manager
Definition
Runs controllers.
Controllers
Node Controller
ReplicaSet Controller
Deployment Controller
Job Controller
Namespace Controller
Service Account Controller
Manifest
/etc/kubernetes/manifests/kube-controller-manager.yaml
Worker Node
kubelet
Definition
Kubernetes agent running on every worker node.
Responsibilities
Starts Pods.
Monitors Pods.
Reports status.
Service
systemctl status kubelet
kube-proxy
Definition
Handles networking.
Creates iptables or IPVS rules.
Load balances Service traffic.
Container Runtime
Definition
Software that actually runs containers.
Examples
containerd
CRI-O
Important Kubernetes Objects
Pod
Definition
Smallest deployable unit.
Contains one or more containers.
ReplicaSet
Definition
Maintains desired number of Pods.
Deployment
Definition
Manages ReplicaSets.
Rolling Updates.
Rollbacks.
Namespace
Definition
Logical isolation inside cluster.
Default Namespaces
default
kube-system
kube-public
kube-node-lease
Service
Definition
Stable network endpoint.
Types
ClusterIP
NodePort
LoadBalancer
ExternalName
ConfigMap
Definition
Stores non-sensitive configuration.
Secret
Definition
Stores sensitive information.
Passwords.
API Keys.
Certificates.
Volume
Definition
Persistent storage.
Persistent Volume
Definition
Cluster storage resource.
Persistent Volume Claim
Definition
Request for storage.
Ingress
Definition
HTTP and HTTPS traffic routing.
Kubernetes Networking
Every Pod gets unique IP.
Pods communicate directly.
Services provide stable IP.
DNS resolves Service names.
Network Plugins
Calico
Flannel
Cilium
Kubernetes Storage
EmptyDir
HostPath
NFS
iSCSI
Fibre Channel
Ceph
AWS EBS
Azure Disk
Google Persistent Disk
Kubernetes Security
Authentication
Authorization
RBAC
Role Based Access Control
Service Accounts
Secrets
Network Policies
Pod Security
TLS Certificates
Kubernetes Linux Directories
/etc/kubernetes
Cluster configuration.
/etc/kubernetes/manifests
Static Pod YAML files.
/var/lib/kubelet
kubelet data.
/var/lib/etcd
etcd database.
/etc/cni/net.d
Network plugin configuration.
/opt/cni/bin
CNI binaries.
/var/log
Logs.
Enterprise Linux Services
kubelet
Check Status
systemctl status kubelet
Start
systemctl start kubelet
Stop
systemctl stop kubelet
Restart
systemctl restart kubelet
Enable
systemctl enable kubelet
Enterprise Commands
Cluster Information
kubectl cluster-info
kubectl version
kubectl get nodes
kubectl get namespaces
kubectl get pods -A
kubectl get services -A
kubectl get deployments -A
Node Information
kubectl describe node worker01
kubectl top nodes
Pod Information
kubectl get pods
kubectl describe pod pod-name
kubectl logs pod-name
kubectl exec -it pod-name -- /bin/bash
Namespace Commands
kubectl get namespaces
kubectl create namespace production
kubectl delete namespace production
Deployment Commands
kubectl get deployments
kubectl describe deployment nginx
kubectl rollout status deployment nginx
kubectl rollout history deployment nginx
kubectl rollout undo deployment nginx
Service Commands
kubectl get svc
kubectl describe svc nginx
Events
kubectl get events
YAML Export
kubectl get pod nginx -o yaml
API Resources
kubectl api-resources
API Versions
kubectl api-versions
YAML
Definition
Human-readable configuration language used to define Kubernetes resources.
File Extension
.yaml
.yml
Apply Configuration
kubectl apply -f file.yaml
Delete Configuration
kubectl delete -f file.yaml
Enterprise Best Practices
Never run applications directly on Worker Nodes.
Use Deployments instead of standalone Pods.
Use Namespaces for environments.
Use RBAC.
Use Secrets for passwords.
Use ConfigMaps for configuration.
Monitor cluster health.
Backup etcd regularly.
Use High Availability Control Plane.
Use Infrastructure as Code.
Enable logging.
Enable monitoring.
Use resource limits.
Use network policies.
Regularly update Kubernetes.
Common Interview Questions
What is Kubernetes?
Why Kubernetes instead of Docker?
What is Container Orchestration?
What is a Cluster?
What is a Pod?
What is a Deployment?
What is a ReplicaSet?
What is a Namespace?
What is kubelet?
What is kube-proxy?
What is etcd?
What is kube-apiserver?
What is kube-scheduler?
What is kube-controller-manager?
What is ConfigMap?
What is Secret?
What is Persistent Volume?
What is RBAC?
What is Rolling Update?
What is Rollback?
What is Service Discovery?
What is High Availability?