惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
爱范儿
爱范儿
The Cloudflare Blog
Y
Y Combinator Blog
B
Blog RSS Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - 叶小钗
G
Google Developers Blog
J
Java Code Geeks
P
Proofpoint News Feed
美团技术团队
Engineering at Meta
Engineering at Meta
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
有赞技术团队
有赞技术团队
L
LangChain Blog
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】

Sealos Blog

Build a Full-Stack App with Claude Code + InsForge — Zero Backend Code | Sealos Blog InsForge vs Supabase: Which Backend for AI-Powered Development? | Sealos Blog Kubernetes NodePort Exhaustion: SSH Gateway Solution | Sealos Blog Claude Code Metrics Dashboard: Grafana Setup (2026) | Sealos Blog What Is RustFS? Apache 2.0 MinIO Alternative (2026) | Sealos Blog Claude Code Mobile: iPhone, Android & SSH (2026) | Sealos Blog Eaglercraft Server Hosting: Fast Setup (2026) | Sealos Blog An Honest Review: Migrating a Complex Microservice App from Heroku to Sealos | Sealos Blog The Ultimate Guide to Kubernetes Audit Logging for Security and Compliance | Sealos Blog Cost Optimization Shootout: Sealos Autonomous FinOps vs. Kubecost Manual Reports | Sealos Blog For CTOs: How to Cut Your Cloud Bill by 50% Without Sacrificing Performance | Sealos Blog Building Resilient Systems: A Deep Dive into Sealos High-Availability and Auto-Failover | Sealos Blog Building a Scalable Event-Driven Architecture with Sealos Managed Kafka | Sealos Blog Beyond kubectl apply: 5 GitOps Best Practices for Production-Ready CI/CD on Sealos | Sealos Blog Advanced RAG Pipelines: Why Your Choice of Vector Database (like Milvus) Matters | Sealos Blog Advanced MLOps: How to Monitor and Evaluate LLM Applications in Production | Sealos Blog A Developer's Guide to Kubernetes RBAC: Securing Your Cluster the Easy Way with Sealos | Sealos Blog A CISO's Guide to Cloud Development: Securing the CI/CD Pipeline with Sealos DevBox | Sealos Blog What is Kubernetes Multi-Tenancy? A Guide for Platform Engineers | Sealos Blog What is Infrastructure from Code (IfC)? The Next Step After Infrastructure as Code (IaC) | Sealos Blog What is GitOps? A Beginner's Guide to "Push-to-Deploy" Workflows | Sealos Blog What is eBPF? The Future of Kubernetes Networking and Security | Sealos Blog What is an "AI-Native" Platform? (And Why You Need One for MLOps) | Sealos Blog What is an Agentic Workflow? Building the Next Generation of AI Apps | Sealos Blog What is a Kubernetes Chargeback Model (And How Does it Save You Money?) | Sealos Blog What is a "Headless" Development Environment? (And How it Works with VS Code) | Sealos Blog What is a Graph-Based Vector Database? (And When to Use It Over Milvus) | Sealos Blog What is a "Cloud Operating System"? The Next Evolution of PaaS Explained | Sealos Blog The Real Cost of EKS: How Sealos Delivers a Simpler, Cheaper Kubernetes Experience | Sealos Blog The 3 Types of Kubernetes Autoscaling (HPA, VPA, CA) and How Sealos Manages Them for You | Sealos Blog
The Illustrated Guide to the Kubernetes Control Plane | S...
Sealos · 2025-09-17 · via Sealos Blog

Kubernetes gets labeled as “the operating system for the cloud,” but it’s the control plane that makes Kubernetes feel alive. It schedules your apps, keeps them healthy, enforces policies, and presents a single source of truth for the current and desired state of your cluster. If you’ve ever wondered why deleting a Pod causes another one to magically appear, or how your cluster decides where to run things, you’re in the right place.

This illustrated guide walks you through the what, why, and how of the Kubernetes control plane. We’ll demystify the components, trace real request paths, show practical commands and YAML, and share tips for operating and troubleshooting a production-grade control plane—whether you’re running it yourself, on a managed service, or with platforms like Sealos that make Kubernetes clusters easy to provision and manage.


The control plane is the “brain” of your Kubernetes cluster. It’s a set of components that:

  • Provide an API for everything in the cluster
  • Store and replicate the cluster’s state
  • Decide what should run, where, and when
  • Continuously reconcile actual state to match desired state

In short: you tell the control plane what you want; it figures out how to make it true and keep it true.

Core Control Plane Components

  • kube-apiserver: Front door to the cluster. Validates requests, persists state, and serves all client traffic (kubectl, controllers, webhooks).
  • etcd: Strongly consistent key–value store holding the source of truth for cluster state.
  • kube-scheduler: Assigns Pods to Nodes based on resource availability, constraints, and policies.
  • kube-controller-manager: Runs the built-in controllers (Deployment, ReplicaSet, Node, Job, etc.) that ensure desired state.
  • cloud-controller-manager (optional): Integrates with your cloud provider for load balancers, volumes, and node lifecycle.

Supporting components (not strictly part of the control plane):

  • kubelet (node agent): Runs on each node, starts/stops containers based on PodSpecs.
  • kube-proxy or CNI proxy: Implements Service networking rules.

Big-Picture Diagram

Below is a simplified view of how components interact to reconcile state:


The control plane underpins everything you do on Kubernetes. Its characteristics directly impact:

  • Reliability: Self-healing and reconciliation loops ensure apps recover from failures.
  • Security: Authentication, authorization, admission policies, and auditing are enforced at the API server.
  • Scalability: Efficient watches, caches, and scheduling enable large clusters to perform well.
  • Consistency: etcd provides strongly consistent state; controllers converge the world to match it.
  • Extensibility: Webhooks and custom controllers let you add new behaviors and APIs without forking Kubernetes.

If the control plane is healthy, your cluster can withstand node failures, pod crashes, and deploys gone wrong. If it’s not, everything else becomes brittle.


Let’s follow a typical flow: deploying a new app to your cluster.

Step 1: You Declare Desired State

You apply a Deployment manifest:

You run:

The kube-apiserver receives the request, authenticates and authorizes it, runs admission plugins, then persists the Deployment object into etcd.

Step 2: Controllers Reconcile

The Deployment controller watches for Deployments. When it sees your new Deployment:

  • It creates a ReplicaSet with the desired template and replicas.
  • The ReplicaSet controller sees the new ReplicaSet and creates three Pods.

Step 3: Scheduling

The scheduler watches for unscheduled Pods (Pods without a nodeName). For each Pod, it:

  • Scores candidate nodes based on filters (taints/tolerations, affinities, resource availability).
  • Picks the best node and binds the Pod to it by updating the Pod’s spec.nodeName through the API.

Step 4: Nodes Act

The kubelet running on the chosen node watches for Pods assigned to it. It:

  • Pulls the container images (if needed).
  • Starts containers via the container runtime (containerd, CRI-O).
  • Reports status back to the API server.

At any point, if a Pod crashes, the controller notices and creates a replacement; if a node goes NotReady, controllers reschedule Pods elsewhere according to policy.

The Reconciliation Pattern

Every controller in Kubernetes follows a simple control loop:

This “eventually consistent via reconciliation” model is what makes Kubernetes robust.


Every interaction goes through kube-apiserver. Understanding its pipeline helps with both development and operations.

Request Pipeline

  1. Transport Security (TLS): All connections are encrypted.
  2. Authentication: Client certs, bearer tokens, OIDC, or webhook auth.
  3. Authorization: RBAC, ABAC, or webhook authorization decide if the action is allowed.
  4. Admission Control:
    • Mutating admission webhooks and built-in mutators may modify the object (e.g., defaulting).
    • Validating admission webhooks and built-ins can reject noncompliant requests.
  5. Persistence: The object is validated and stored in etcd via the API server’s storage layer.
  6. Response: The API server returns status to the client.

You can explore the API with:

Access Control Example (RBAC)

Define a role that permits listing Pods in a namespace:

Admission Control in Practice

To enforce resource requests and limits for Pods in a namespace:

You can also use validating/mutating webhooks or tools like Gatekeeper to enforce more complex policies.


etcd is a distributed, strongly consistent key–value store. The API server stores Kubernetes objects as JSON in etcd, under paths like /registry/pods//.

Key characteristics:

  • Consistency and Quorum: Writes require a majority of etcd members to agree. A 3-node etcd cluster tolerates 1 failure; 5 nodes tolerate 2.
  • Compaction and Defragmentation: etcd stores revisions—over time, cleanup is necessary to maintain performance.
  • Snapshots: Periodic backups are essential for disaster recovery.

Operational tips:

  • Co-locate etcd with control plane nodes on fast SSDs/NVMe.
  • Keep network latency between members very low.
  • Monitor etcd metrics: leader changes, proposal latency, fsync duration.

For snapshot/restore:


The scheduler decides which node should run each Pod, considering:

  • Resource requests/limits and node capacity
  • Node selectors, affinities/anti-affinities
  • Taints and tolerations
  • Topology spread constraints
  • Custom plugins via the scheduling framework

Example: Force a workload onto SSD nodes with a toleration and node affinity:

You can debug scheduling with:

  • kubectl describe pod to see scheduling events
  • kubectl get events --sort-by=.metadata.creationTimestamp
  • Scheduler logs (if you manage your own control plane)

Controllers encode the logic to maintain Kubernetes abstractions. Examples:

  • Deployment controller: Ensures the number of Pods matches replicas; orchestrates rollouts/rollbacks.
  • Node controller: Marks nodes NotReady; evicts Pods on dead nodes.
  • Service controller: In cloud environments, provisions load balancers.
  • Job/CronJob controllers: Manage run-to-completion workloads.
  • HorizontalPodAutoscaler controller: Scales based on metrics.

These controllers run inside kube-controller-manager (and cloud-controller-manager for cloud-specific controllers), each with leader election to prevent duplicate work.

You can see leader elections via Leases:


Interacting with the Control Plane

  • Configure kubeconfig for contexts, users, and clusters:
  • Verify health endpoints (often enabled by default):
    • API server: /livez, /readyz
    • Scheduler and controller-manager: /metrics, /healthz

Observability and Metrics

  • Scrape control plane metrics with Prometheus. Key signals:
    • apiserver_request_total, apiserver_request_duration_seconds
    • etcd_request_duration_seconds, etcd_server_leader_changes_seen_total
    • scheduler_pod_scheduling_duration_seconds
    • workqueue metrics for controllers (workqueue_depth, workqueue_adds_total)
  • Enable and rotate audit logs to track changes and access patterns.

Scaling and High Availability

To run a highly available control plane:

  • Multiple API servers behind a load balancer.
  • An odd number of etcd members (3 or 5) to maintain quorum.
  • Fast, reliable storage and network.
  • Spread components across failure domains (zones).

Version skew policy:

  • kube-apiserver must be the newest; controllers and kubelets can lag by one minor version.
  • Upgrade order: etcd (if separate version), API server, controllers, scheduler, then kubelets.

Backup and Disaster Recovery

  • Regular etcd snapshots stored off-cluster (and test restores).
  • Infrastructure-as-code for control plane manifests and configuration (kubeadm, kube-spray, or platform tooling).
  • Documented recovery runbooks (e.g., replacing a failed control plane node, restoring etcd, rejoining nodes).

Security Essentials

  • TLS everywhere; rotate certificates before expiration.
  • Strong RBAC defaults; least-privilege for service accounts.
  • Admission policies:
    • Disallow privileged containers where possible.
    • Enforce image provenance and signing (e.g., with Cosign, Kyverno policies).
    • Restrict hostPath, NET_ADMIN, and hostNetwork use.
  • Network policies to limit traffic between namespaces and services.
  • Enable audit logging at an appropriate level.

Example: Deny privileged Pods with a validating policy (Kyverno example):

Resource Governance

Use resource quotas and priority classes to protect the control plane and critical workloads:

Define a high-priority class for system add-ons:


API Server Feels Slow or Unavailable

Symptoms:

  • kubectl commands hang or time out
  • apiserver_request_duration_seconds high percentiles
  • etcd latency spikes

Checklist:

  • Check API server /readyz and logs for etcd timeouts.
  • Inspect etcd leader stability and disk IO; defragment if database is bloated.
  • Ensure webhooks are healthy—unreachable webhooks can block writes. Use failurePolicy: Ignore for non-critical webhooks.
  • Review admission and audit policies for excessive overhead.

Pods Pending with “0/… nodes available”

Investigate with:

Look for:

  • Insufficient CPU/memory (set realistic requests).
  • Taints/tolerations mismatches.
  • Node affinity/anti-affinity conflicts.
  • Blocked by Pod topology spread constraints.

Consider temporarily relaxing constraints or adding capacity.

Controllers Not Reconciling

  • Check kube-controller-manager health and leader lease.
  • Inspect workqueue metrics; if depth is high, something is stuck or under-resourced.
  • Ensure RBAC permits controllers to update the resources they manage.

etcd Alarms or Data Growth

  • Run compaction and defrag during off-peak hours.
  • Reduce unnecessary object churn (e.g., excessive ConfigMap updates).
  • Check for controllers spamming updates due to improper spec (e.g., changing defaulted fields every loop).

ComponentRole in the Control PlaneKey Interfaces
kube-apiserverAuthN/Z, admission, API, persistenceTLS, REST, webhooks, etcd client
etcdDurable, consistent storagegRPC between etcd members
kube-schedulerBinds Pods to NodesKubernetes API (watch/bind)
kube-controller-managerReconciliation loops for core controllersKubernetes API (watch/update)
cloud-controller-managerCloud resource integrationCloud APIs, Kubernetes API

Note: kubelet and networking components are not part of the control plane, but they act on decisions the control plane makes.


Let’s tie the concepts together with an end-to-end example.

  1. CI pushes an image and updates a Deployment manifest.
  2. CD applies the manifest with kubectl or the Kubernetes API.
  3. The API server authenticates the request via OIDC and authorizes via RBAC.
  4. A mutating webhook injects a sidecar (e.g., for logging).
  5. A validating webhook checks Pod security context; request passes.
  6. The API server writes the Deployment to etcd.
  7. The Deployment controller creates/updates a ReplicaSet; ReplicaSet creates Pods.
  8. The scheduler picks nodes and binds Pods.
  9. Kubelets pull images, start containers, and report status.
  10. A Service routes traffic to the Pod IPs; kube-proxy or your CNI configures routing.
  11. HPA scales replicas up during load; Deployment controller updates the ReplicaSet.
  12. A failing node triggers the Node controller to mark NotReady; Pods get rescheduled.

You can watch parts of this in real time:


  • Keep the API server stateless; scale horizontally behind a highly available load balancer.
  • Use an odd number of etcd members; keep them dedicated and on the fastest disks you can.
  • Separate traffic planes if possible: client traffic vs control-plane-to-etcd traffic.
  • Lock down admission webhooks and ensure they are highly available; set failure policies carefully.
  • Leverage Pod Priority and preemption to ensure control plane and critical add-ons always have resources.
  • Keep version skew within supported limits and perform graceful, rolling upgrades.
  • Automate backups and practice recovery with game days.

Platforms like Sealos can streamline much of this: automate control plane node provisioning, TLS certificate management, and HA topologies; provide a web console to observe and manage clusters; and offer app catalogs to add observability and policy controllers with a click. If you’re building internal platforms, Sealos can help you bootstrap and operate robust control planes without starting from scratch. Learn more at https://sealos.io.


  • API Aggregation Layer: Extension APIs that register under your API server (e.g., metrics.k8s.io).
  • Custom Resource Definitions (CRDs) and Custom Controllers: Extend Kubernetes with your own types and reconciliation logic.
  • Server-Side Apply: Declarative field ownership and conflict detection for safer automation.
  • Admission Webhook Patterns: Idempotent mutations, versioned schemas, and performance strategies.
  • Scheduling Framework Plugins: Custom scoring/filters to tailor scheduling for niche workloads.
  • Multi-cluster Control Planes: Fleet management, cluster API (CAPI), and control plane per cluster vs shared control plane trade-offs.

Check which admission plugins are enabled:

Quickly view API discovery:

Find stuck webhooks:

Trace a pending Pod:


The Kubernetes control plane is both simple and profound. At its core are a handful of components—a front-door API server, a consistent store (etcd), a scheduler, and a set of controllers—that together implement a powerful closed-loop system. You declare desired state; the control plane makes it happen and keeps it that way.

Key takeaways:

  • kube-apiserver is the gatekeeper: it authenticates, authorizes, admits, and persists every change.
  • etcd is the single source of truth—healthy etcd equals a healthy cluster.
  • Controllers and the scheduler continuously reconcile and place workloads according to your policies.
  • Robust operations require HA design, careful upgrades, strong security, and observability.
  • Practical tooling—RBAC, LimitRanges, admission webhooks, quotas—help you encode org and security policies.
  • Platforms like Sealos can reduce the toil of provisioning and operating resilient control planes, letting your team focus on applications and policies.

With a mental model of the request flow, reconciliation loops, and the interplay among components, you can confidently build, scale, and secure your Kubernetes platforms. Whether you run the control plane yourself or through a managed solution, understanding it is the difference between hope-driven operations and engineering with intent.