【Kubernetes】Pod、Container、Node、Cluster

Kubernetes是一个开源平台,用于管理和协调容器,由节点(Node)和控制平面(ControlPlane)组成。Pod是基本执行单元,通过API实现负载均衡和故障转移,副本集合(ReplicaSet)确保服务的高可用性,整个集群(Cluster)包含所有节点及控制中心。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

K8s 基础》系列,共包含以下几篇文章:

😊 如果您觉得这篇文章有用 ✔️ 的话,请给博主一个一键三连 🚀🚀🚀 吧 (点赞 🧡、关注 💛、收藏 💚)!!!您的支持 💖💖💖 将激励 🔥 博主输出更多优质内容!!!

Pod、Container、Node、Cluster

Kubernetes 是一个开源容器编排平台,管理着一系列的 主机 或者 服务器,它们被称作是 节点Node)。

在这里插入图片描述

每一个节点运行了若干个相互独立的 Pod

在这里插入图片描述

Pod 是 Kubernetes 中可以部署的 最小执行单元,说白了它就是 一个或者多个容器的集合。其中运行了我们应用的某一部分核心组件,比如数据库、Web 服务器等等。

但这么多 Pod,它们需要相互协调才能做到负载均衡或者故障的转移。这就需要一台中心计算机来集中管理,这个中心计算机被称作 控制平面Control Plane)。

控制平面通过专有的 API 与各个节点进行通信,它会实时监测节点的网络状态来平衡服务器的负载,或者临时下发指令来应对突发的状况。

在这里插入图片描述

比如 Kubernetes 发现某个容器或者 Pod 挂掉了,它会立刻启用在后台预先准备好的、随时待命的备用容器来替换它。

在这里插入图片描述

在这里插入图片描述

这些容器被称作 副本集合Replica Set)。

而以上讲到的所有节点,连同控制平面,一起被称作一个 集群Cluster)。集群代表了 Kubernetes 所管理的全部主机节点。

在这里插入图片描述

### Kubernetes Static Pod Documentation and Usage Static Pods are managed directly by the kubelet daemon on a specific node, without the need for the API server to manage them. These pods are always tied to the node where they reside and cannot be controlled via standard Kubernetes controllers like Deployments or ReplicaSets. To define a static pod, one must place its manifest file into a directory watched by the `kubelet`. By default, this is `/etc/kubernetes/manifests` on most systems[^4]. When the `kubelet` detects changes in any of these files (addition, modification, deletion), it will adjust the set of running containers accordingly. For example, consider creating a simple nginx static pod: ```yaml apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx ``` Save this configuration as `/etc/kubernetes/manifests/nginx.yaml`, after which the `kubelet` service should automatically start an instance of the specified container on that particular machine. Unlike regular pods created through the API server, there's no direct way to interact with static pods using `kubectl apply` commands because they do not exist within etcd database nor have corresponding objects inside the cluster state maintained by apiserver. However, once started, users can still inspect logs, describe status, delete manually from filesystem level but all operations related specifically to managing lifecycle such as scaling up/down replicas aren't applicable here since those features rely heavily upon higher-level abstractions provided by other components outside just the local node itself.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

G皮T

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值