Kubernetes (K8s) 是最主流的 container orchestration 平台——它自动化了在机器集群中部署、扩展和管理容器化应用程序的过程。理解其核心概念(pods、deployments、services 等)对于大规模运行容器至关重要。
Kubernetes 的作用
text
Kubernetes manages containers across a CLUSTER of nodes (machines), providing:
→ SCHEDULING (place containers on nodes), SELF-HEALING (restart failed containers),
SCALING (up/down, auto), ROLLING UPDATES/rollbacks, SERVICE DISCOVERY,
LOAD BALANCING, CONFIG/SECRET management, STORAGE orchestration
→ DECLARATIVE: you describe the DESIRED STATE; K8s continuously makes reality match it.
核心概念
text
POD → the smallest deployable unit: one (or a few tightly-coupled) containers
sharing network/storage. K8s schedules pods (not bare containers).
DEPLOYMENT→ declares desired pods (replicas) for a stateless app; manages rollouts,
scaling, self-healing (recreates pods to match the desired count).
SERVICE → a stable network endpoint + load balancing for a set of pods (pods are
ephemeral with changing IPs; a Service gives a stable name/IP).
INGRESS → routes external HTTP(S) traffic to services (with rules, TLS).
CONFIGMAP / SECRET → inject configuration / sensitive data into pods.
NAMESPACE → virtual cluster partitioning (isolate environments/teams).
NODE → a worker machine; the CONTROL PLANE manages the cluster.
