- Published on
Những câu hỏi phỏng vấn Kubernetes nâng cao
- Authors
- Name
- Bạch Đăng Tuấn
- Occupation
- Kỹ sư công nghệ thông tin
- Zalo: 0934.01.07.04
Những câu hỏi phỏng vấn Kubernetes nâng cao
📑 Mục Lục
🚀 Những câu hỏi phỏng vấn Kubernetes nâng cao
Kiến trúc control plane của Kubernetes gồm những thành phần nào?
→ Gồm:kube-apiserver
,etcd
,controller-manager
,scheduler
. Các thành phần này chịu trách nhiệm quản lý và điều phối cluster.Etcd là gì? Làm sao để backup và restore etcd?
→ Etcd là key-value store lưu trạng thái cluster. Dùngetcdctl snapshot save
để backup,etcdctl snapshot restore
để phục hồi.RBAC trong Kubernetes hoạt động như thế nào?
→ RBAC (Role-Based Access Control) kiểm soát truy cập tài nguyên qua các đối tượng: Role, ClusterRole, RoleBinding, ClusterRoleBinding.NetworkPolicy dùng để làm gì?
→ NetworkPolicy kiểm soát luồng traffic giữa các pod. Dựa vào label selector và rule cho phép/khóa traffic ingress/egress.PodSecurityPolicy (PSP) là gì? Thay thế PSP hiện tại là gì?
→ PSP kiểm soát quyền bảo mật pod (user, volume, hostPID…). PSP bị deprecated, thay thế bằng PodSecurity Admission (PSA) hoặc OPA/Gatekeeper.Cluster Autoscaler và HPA khác nhau như thế nào?
→ Cluster Autoscaler scale số lượng node trong cluster. HPA scale số lượng pod theo CPU/memory hoặc custom metric.Làm sao để triển khai multi-tenant trong Kubernetes?
→ Sử dụng namespace isolation, NetworkPolicy, ResourceQuota, RBAC riêng biệt cho từng tenant.Khi nào nên dùng StatefulSet thay vì Deployment?
→ Khi cần định danh cố định, volume gắn liền với pod và đảm bảo thứ tự khởi động (VD: DB, Kafka, Zookeeper).Sidecar pattern là gì? Có ví dụ thực tế không?
→ Sidecar là container chạy cùng pod để hỗ trợ container chính (VD: envoy proxy, file sync, log collector).Admission Controller là gì? Các loại phổ biến?
→ Là thành phần kiểm tra/ghi đè request trước khi ghi vào etcd. Phổ biến: ValidatingWebhook, MutatingWebhook, PodSecurity, ResourceQuota.Kubernetes Scheduler hoạt động như thế nào?
→ Scheduler chọn node phù hợp cho pod dựa trên filter (node selector, taint, affinity) và scoring (resource availability, spread).SecurityContext trong Pod dùng để làm gì?
→ Dùng để xác định quyền của container như: user ID, chạy dưới quyền root, readOnlyRootFilesystem, allowPrivilegeEscalation,…Container Runtime Interface (CRI) là gì? Kubernetes hỗ trợ những runtime nào?
→ CRI là giao diện giữa kubelet và container runtime. Hỗ trợ: containerd, CRI-O, Docker (deprecated từ 1.24).Bạn xử lý như thế nào nếu pod bị CrashLoopBackOff?
→ Xem log (kubectl logs
), mô tả pod (describe
), kiểm tra readiness/liveness probe, volume mount, cấu hình env,…Cách bạn triển khai CI/CD tích hợp Kubernetes như thế nào?
→ Dùng các công cụ như ArgoCD, GitLab CI/CD, Jenkins, Tekton để build → push image → deploy YAML/Helm → monitor rollout.