K8S哲学 - cluster

A Kubernetes cluster consists of two types of resources:

  • The Control Plane coordinates the cluster
  • Nodes are the workers that run applications
    The Control Plane is responsible for managing the cluster. The Control Plane coordinates all activities in your cluster, such as scheduling applications, maintaining applications' desired state, scaling applications, and rolling out new updates
    A node is a VM or a physical computer that serves as a worker machine in a Kubernetes cluster. Each node has a Kubelet, which is an agent for managing the node and communicating with the Kubernetes control plane. The node should also have tools for handling container operations, such as containerd or CRI-O. A Kubernetes cluster that handles production traffic shouldhave a minimum of three nodes because if one node goes down, both an etcd member and a control plane instance are lost, and redundancy is compromised. You can mitigate this risk by adding more control plane nodes.

在 Kubernetes 中,kubelet 是运行在每个节点上的一个关键组件,它负责管理该节点上的 Pods 和容器。kubelet 通过 Kubernetes API 与控制平面进行通信,获取调度到该节点的 Pods 的信息,报告节点和 Pods 的状态,以及执行控制平面发出的各种操作,如启动和停止 Pods。

Kubernetes API 是控制平面对外暴露的接口,它定义了一组 RESTful API,用于管理和操作 Kubernetes 集群的各种资源,如 Nodes、Pods、Services 等。除了 kubelet 和其他节点级别的组件,终端用户也可以直接使用 Kubernetes API 来与集群进行交互。例如,当你使用 kubectl 命令行工具时,kubectl 实际上是在后台调用 Kubernetes API 来执行你的命令。

kubelet vs kubectl

Node-level components, such as the kubelet, communicate with the control plane using the Kubernetes API, which the control plane exposes. End users can also use the Kubernetes API directly to interact with the cluster

kubectl apply

kubectl apply 命令用于应用或更新 Kubernetes 资源。它并不是用来启动集群的,而是用来在已经运行的 Kubernetes 集群中创建或更新资源,如 Pods、Services、Deployments 等。

Minikube 是一个轻量级的 Kubernetes 实现,它在你的本地机器上创建一个虚拟机,并在其中部署一个只包含一个节点的简单集群。Minikube 支持 Linux、macOS 和 Windows 系统。Minikube 的命令行接口提供了一些基本的引导操作,用于操作你的集群,包括启动(start)、停止(stop)、查看状态(status)和删除(delete)。

相关推荐
阿里云云原生14 小时前
11月14日杭州见丨COSCon’26 第十一届中国开源年会,阿里云四场 Agent 技术分享
云原生
阿里云云原生15 小时前
关于 DeepSeek 的 SuperAgent,以及我们的实践
云原生·agent
mengge.cloud16 小时前
prometheus+k8s+弹性伸缩,综合项目
云原生·容器·kubernetes·prometheus
Z21-X18 小时前
云原生运维学习笔记:ECShop全链路容器化部署与Docker底层资源隔离深度剖析
运维·笔记·学习·云原生
xbzb21 小时前
从零容器化部署 ECShop:Harbor 私有仓库 + 自定义 PHP 镜像 + LNMP 三容器
容器·php·harbor·镜像·仓库·ecshop
那明眸似水21 小时前
云原生项目三:Docker秒级启动NextCloud个人网盘存储办公系统
linux·运维·docker·云原生·容器
腾飞开源21 小时前
03_Kubernetes 核心概念拆解:从 Spec/Status 收敛到工作负载控制器的设计逻辑
云原生·容器·kubernetes
知已难寻1 天前
Docker 入门:容器技术与 Docker 基础
java·运维·服务器·docker·云原生·容器
xbzb2 天前
镜像到底存在哪:/var/lib/docker 的四级映射与 daemon.json 配置
docker·容器·json·镜像·daemon.json·四级
阿里云云原生2 天前
生产更可信,订阅更耐用丨Higress 社区进展报告
云原生