📦 What is Kubernetes?
Kubernetes is a powerful open-source platform that automates the deployment, scaling, and management of containerized applications. It has become the gold standard for container orchestration, and the Certified Kubernetes Administrator (CKA) exam is your gateway to proving your expertise.
⚙️ Cluster Architecture
🔹 Master Node Components:
- API Server: The control center, validates and configures all cluster data.
- Scheduler: Assigns newly created pods to nodes.
- Controller Manager: Reconciles the cluster state.
- etcd: Stores all cluster configuration and state.
- Cloud Controller Manager: Interacts with cloud provider APIs.
🔸 Worker Node Components:
- Kubelet: Ensures containers are running properly.
- Kube-Proxy: Handles networking rules and service communication.
- Container Runtime: Runs the containers (e.g., containerd, CRI-O).
🚀 Core Workloads
- Pods: The smallest deployable unit.
- ReplicaSet: Maintains desired number of pod replicas.
- Deployments: Manages updates and rollbacks.
- StatefulSets: Ideal for stateful applications.
- DaemonSets: Ensures a pod runs on all (or some) nodes.
- Jobs & CronJobs: One-time and scheduled workloads.
🧩 Configuration Management
🛠 ConfigMap & Secrets
- ConfigMap: Store non-sensitive config as key-value pairs.
- Secret: Stores sensitive info like passwords or tokens securely.
🌐 Services & Networking
🧭 Types of Services:
- NodePort: Exposes services on static ports (30000–32767).
- ClusterIP: Internal-only access (default).
- LoadBalancer: External access using cloud LB.
- ExternalName: Maps to an external DNS.
🌍 Ingress & Ingress Controller:
- Routes external traffic to internal services.
- Supports SSL termination, path- and host-based routing.
🧪 Health Checks
- Liveness Probe: Restarts containers that fail.
- Readiness Probe: Controls service routing.
- Startup Probe: Ensures slow apps don’t get killed early.
📊 Resource Management
- Requests & Limits: Control how much CPU/memory a container gets.
- CPU/Memory Units:
m(millicores),Mi,Gi, etc. - Prevents noisy neighbor issues and enables fair resource sharing.
📈 Autoscaling
- Horizontal Pod Autoscaler (HPA): Scales pods based on CPU/memory.
- Vertical Pod Autoscaler (VPA): Adjusts resource requests/limits.
🔐 RBAC: Role-Based Access Control
- Role/RoleBinding: Namespace-scoped access control.
- ClusterRole/ClusterRoleBinding: Cluster-wide permissions.
- ServiceAccounts: Used by pods for authentication.
📦 Storage in Kubernetes
- StorageClass: Defines provisioner and reclaim policy.
- PersistentVolume (PV): A cluster-wide storage resource.
- PersistentVolumeClaim (PVC): A request for PV.
- Access Modes: RWO, ROX, RWX, RWOP.
- Reclaim Policies: Retain, Delete.
🧬 Scheduling & Affinity
- Taints & Tolerations: Node-centric control.
- NodeSelector: Simple label-based placement.
- NodeAffinity: Complex rules for pod placement.
📦 KIND: Kubernetes in Docker
- Use KIND to create test clusters for local development.
- Supports single- and multi-node clusters in WSL.
📡 DNS & Service Discovery
- CoreDNS: Default DNS provider.
- Headless Services: Direct pod discovery.
🧰 Logging & Monitoring
- Logs: Pod logs, cluster logs.
- Centralized Logging: ELK, Fluentd, Loki.
- Metrics Server: CPU/Memory usage.
- Prometheus & Grafana: Advanced observability.
🧯 Troubleshooting
- Common issues:
ImagePullBackoff,CrashLoopBackOff, pod scheduling failures. - Use
kubectl describe,logs, and event watching to investigate issues.
📈 Advanced Kubectl & JSONPath
- Master advanced
kubectltechniques: dry-run, patch, label selectors. - JSONPath helps extract specific info from output.
🎓 Final Words
This guide is your launchpad to ace the CKA exam in 2025 and master the art of container orchestration with Kubernetes. Practice labs, real-world issues, and hands-on YAML writing are your keys to success. 🚀