Yêu cầu đầu vào:
- Kiến thức cơ bản về Linux
- Hiểu biết về Docker và containerization
- Kiến thức về networking cơ bản
🎯 MỤC TIÊU KHÓA HỌC
Sau khi hoàn thành khóa học, học viên sẽ:
- Hiểu kiến trúc và các thành phần của Kubernetes
- Triển khai và quản lý Kubernetes cluster
- Deploy và quản lý ứng dụng trên Kubernetes
- Thực hiện monitoring, logging và troubleshooting
- Áp dụng best practices về security và high availability
📚 NỘI DUNG KHÓA HỌC
MODULE 1: GIỚI THIỆU VÀ CƠ BẢN
Chương 1.1: Container Orchestration và Kubernetes
- Container orchestration là gì?
- Tại sao cần Kubernetes?
- So sánh Kubernetes với Docker Swarm, Mesos
- Lịch sử và cộng đồng Kubernetes
- Kubernetes ecosystem
Chương 1.2: Kiến trúc Kubernetes
- Control Plane components:
- kube-apiserver
- etcd
- kube-scheduler
- kube-controller-manager
- cloud-controller-manager
- Node components:
- kubelet
- kube-proxy
- Container runtime
- Add-ons và plugins
Chương 1.3: Cài đặt môi trường
- Các phương pháp cài đặt Kubernetes
- Cài đặt Minikube (local development)
- Cài đặt kind (Kubernetes in Docker)
- Cài đặt kubectl
- Cấu hình kubeconfig
- Giới thiệu về k9s, lens
Bài thực hành 1:
- Cài đặt Minikube trên máy local
- Khởi động cluster đầu tiên
- Chạy lệnh kubectl cơ bản
- Explore Kubernetes dashboard
MODULE 2: KUBERNETES OBJECTS CƠ BẢN
Chương 2.1: Pods
- Pod là gì và tại sao cần Pod?
- Pod lifecycle
- Multi-container Pods
- Init containers
- Ephemeral containers
- Pod templates
- Static Pods
Chương 2.2: ReplicaSets và Deployments
- ReplicaSet: quản lý số lượng Pod replicas
- Deployment: declarative updates
- Rolling updates và rollbacks
- Deployment strategies:
- Recreate
- RollingUpdate
- Blue/Green
- Canary
- Scaling applications
Chương 2.3: Services
- Service discovery trong Kubernetes
- Service types:
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
- Endpoints và EndpointSlices
- Headless Services
- Service mesh concepts
Chương 2.4: Namespaces
- Tổ chức resources với Namespaces
- Resource quotas
- Limit ranges
- Network policies với Namespaces
- Best practices
Bài thực hành 2:
- Deploy ứng dụng web đơn giản
- Tạo Deployment với multiple replicas
- Expose service với các types khác nhau
- Thực hiện rolling update và rollback
- Cấu hình resource limits
MODULE 3: CONFIGURATION VÀ STORAGE
Chương 3.1: ConfigMaps và Secrets
- Quản lý configuration với ConfigMaps
- Tạo và sử dụng ConfigMaps
- Secrets: quản lý sensitive data
- Các loại Secrets
- Mounting ConfigMaps và Secrets
- Immutable ConfigMaps và Secrets
Chương 3.2: Persistent Storage
- Volumes trong Kubernetes
- Volume types: emptyDir, hostPath, nfs...
- PersistentVolumes (PV)
- PersistentVolumeClaims (PVC)
- StorageClasses
- Dynamic provisioning
- Volume snapshots
Chương 3.3: StatefulSets
- StatefulSets vs Deployments
- Stable network identities
- Ordered deployment và scaling
- Persistent storage với StatefulSets
- Headless services
- Use cases: databases, distributed systems
Bài thực hành 3:
- Deploy ứng dụng với ConfigMaps và Secrets
- Cấu hình persistent storage
- Deploy MongoDB/PostgreSQL với StatefulSet
- Thực hiện backup và restore volumes
MODULE 4: NETWORKING NÂNG CAO
Chương 4.1: Kubernetes Networking Model
- Container-to-Container networking
- Pod-to-Pod networking
- Pod-to-Service networking
- External-to-Service networking
- CNI (Container Network Interface)
- Network plugins: Calico, Flannel, Weave
Chương 4.2: Ingress
- Ingress là gì?
- Ingress Controllers: Nginx, Traefik, HAProxy
- Ingress rules và paths
- TLS/SSL termination
- Name-based virtual hosting
- Annotations và customization
Chương 4.3: Network Policies
- Network isolation
- Pod selectors
- Ingress rules
- Egress rules
- Best practices cho security
Bài thực hành 4:
- Cài đặt Nginx Ingress Controller
- Cấu hình Ingress cho multiple services
- Setup SSL/TLS certificates
- Implement Network Policies
- Troubleshoot networking issues
MODULE 5: WORKLOAD MANAGEMENT
Chương 5.1: Jobs và CronJobs
- Batch processing với Jobs
- Job patterns: single, parallel, work queue
- Job backoff và retries
- CronJobs: scheduled tasks
- Timezone và schedule syntax
Chương 5.2: DaemonSets
- DaemonSet use cases
- Node selection
- Updating DaemonSets
- Common scenarios: logging, monitoring
Chương 5.3: HorizontalPodAutoscaler (HPA)
- Autoscaling concepts
- Metrics-based scaling
- CPU và memory-based scaling
- Custom metrics
- VerticalPodAutoscaler (VPA)
Bài thực hành 5:
- Tạo batch jobs để process data
- Setup CronJob cho backup tasks
- Deploy monitoring với DaemonSet
- Cấu hình HPA cho web application
- Load testing và observe autoscaling
MODULE 6: SECURITY
Chương 6.1: Authentication và Authorization
- User authentication
- ServiceAccounts
- RBAC (Role-Based Access Control):
- Roles và ClusterRoles
- RoleBindings và ClusterRoleBindings
- Admission Controllers
- Pod Security Standards
Chương 6.2: Security Best Practices
- Container image security
- Running as non-root
- Read-only filesystems
- SecurityContext
- Pod Security Admission
- Network Policies for isolation
- Secrets encryption at rest
Chương 6.3: Security Tools
- Kube-bench: CIS benchmarks
- Trivy: vulnerability scanning
- Falco: runtime security
- OPA/Gatekeeper: policy enforcement
Bài thực hành 6:
- Tạo ServiceAccounts và RBAC policies
- Implement least privilege access
- Scan images với Trivy
- Configure Pod Security Standards
- Audit và compliance checking
MODULE 7: MONITORING VÀ LOGGING
Chương 7.1: Monitoring
- Kubernetes metrics
- Metrics Server
- Prometheus operator
- Grafana dashboards
- AlertManager
- Resource monitoring
- Application monitoring
Chương 7.2: Logging
- Container logs
- Centralized logging architecture
- EFK Stack (Elasticsearch, Fluentd, Kibana)
- Loki và Grafana
- Log aggregation patterns
- Structured logging
Chương 7.3: Debugging và Troubleshooting
- kubectl debugging commands
- Pod debugging strategies
- Node issues
- Network debugging
- Performance troubleshooting
- Common issues và solutions
Bài thực hành 7:
- Deploy Prometheus và Grafana
- Tạo custom dashboards
- Setup alerting rules
- Implement EFK stack
- Debug failing applications
- Analyze resource usage
MODULE 8: ADVANCED TOPICS
Chương 8.1: Helm Package Manager
- Helm architecture
- Charts structure
- Installing charts
- Creating custom charts
- Chart repositories
- Helm hooks và tests
- Helmfile
Chương 8.2: Operators và Custom Resources
- Operator pattern
- Custom Resource Definitions (CRDs)
- Custom Controllers
- Operator SDK
- Common operators: Prometheus, MySQL, PostgreSQL
Chương 8.3: Service Mesh
- Service mesh concepts
- Istio introduction
- Traffic management
- Security policies
- Observability
- Linkerd comparison
Chương 8.4: GitOps
- GitOps principles
- ArgoCD
- Flux
- Continuous Deployment pipelines
- Best practices
Bài thực hành 8:
- Create và deploy Helm charts
- Build a simple Operator
- Deploy Istio service mesh
- Setup GitOps với ArgoCD
- Implement CI/CD pipeline
MODULE 9: CLUSTER MANAGEMENT
Chương 9.1: Production Cluster Setup
- kubeadm installation
- High Availability setup
- Multi-master architecture
- Load balancing
- Cluster upgrades
- Backup và disaster recovery
Chương 9.2: Node Management
- Adding/removing nodes
- Node maintenance
- Taints và Tolerations
- Node affinity và anti-affinity
- Pod priority và preemption
Chương 9.3: Resource Management
- Resource requests và limits
- Quality of Service (QoS) classes
- LimitRanges
- ResourceQuotas
- Pod Disruption Budgets (PDB)
Bài thực hành 9:
- Setup 3-node cluster với kubeadm
- Configure HA control plane
- Perform cluster upgrade
- Implement backup strategy
- Practice disaster recovery
MODULE 10: CLOUD PLATFORMS VÀ BEST PRACTICES
Chương 10.1: Managed Kubernetes Services
- Amazon EKS
- Google GKE
- Azure AKS
- DigitalOcean Kubernetes
- So sánh và lựa chọn
Chương 10.2: Best Practices
- Cluster setup best practices
- Application deployment patterns
- Security hardening
- Cost optimization
- Performance tuning
- Scalability considerations
Chương 10.3: Real-world Architecture
- Microservices trên Kubernetes
- Multi-tenancy
- Hybrid và multi-cloud
- Edge computing với K3s
- Case studies
Bài thực hành 10:
- Deploy trên cloud platform (GKE/EKS/AKS)
- Implement complete microservices application
- Cost analysis và optimization
- Performance benchmarking
- Final project: Production-ready deployment
📖 TÀI LIỆU THAM KHẢO
Tài liệu chính thức
- Kubernetes Official Documentation: https://kubernetes.io/docs/
- Kubernetes Blog: https://kubernetes.io/blog/
- CNCF Projects: https://www.cncf.io/projects/
Sách
- "Kubernetes Up & Running" - Kelsey Hightower
- "The Kubernetes Book" - Nigel Poulton
- "Kubernetes Patterns" - Bilgin Ibryam
- "Production Kubernetes" - Josh Rosso
Khóa học online
- Linux Foundation Kubernetes courses
- Certified Kubernetes Administrator (CKA)
- Certified Kubernetes Application Developer (CKAD)
Labs và Practice
- Katacoda Kubernetes scenarios
- Play with Kubernetes
- KillerCoda
- Kubernetes the Hard Way
Community
- Kubernetes Slack
- Kubernetes GitHub
- Local Kubernetes meetups
- KubeCon conferences
🔧 CÔNG CỤ CẦN THIẾT
Essential Tools
- kubectl
- kubeadm
- Minikube/kind
- Docker
- VS Code với Kubernetes extension
Recommended Tools
- k9s (terminal UI)
- Lens (IDE)
- kubectx/kubens
- stern (multi-pod logging)
- Helm
- kustomize
Monitoring & Debugging
- Prometheus
- Grafana
- ELK Stack
- Jaeger (tracing)
🎊 KẾT LUẬN
Kubernetes là một hệ thống phức tạp nhưng powerful. Khóa học này cung cấp nền tảng vững chắc từ cơ bản đến nâng cao. Quan trọng nhất là thực hành thường xuyên và không ngừng học hỏi từ cộng đồng.
Lưu ý: Khóa học này được thiết kế dựa trên Kubernetes version 1.28+. Một số tính năng có thể thay đổi ở các versions khác.