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 should have 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 是運行在每個節(jié)點上的一個關鍵組件,它負責管理該節(jié)點上的 Pods 和容器。kubelet 通過 Kubernetes API 與控制平面進行通信,獲取調度到該節(jié)點的 Pods 的信息,報告節(jié)點和 Pods 的狀態(tài),以及執(zhí)行控制平面發(fā)出的各種操作,如啟動和停止 Pods。
Kubernetes API 是控制平面對外暴露的接口,它定義了一組 RESTful API,用于管理和操作 Kubernetes 集群的各種資源,如 Nodes、Pods、Services 等。除了 kubelet 和其他節(jié)點級別的組件,終端用戶也可以直接使用 Kubernetes API 來與集群進行交互。例如,當你使用 kubectl 命令行工具時,kubectl 實際上是在后臺調用 Kubernetes API 來執(zhí)行你的命令。
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 集群中創(chuàng)建或更新資源,如 Pods、Services、Deployments 等。
文章來源:http://www.zghlxwxcb.cn/news/detail-851205.html
Minikube 是一個輕量級的 Kubernetes 實現,它在你的本地機器上創(chuàng)建一個虛擬機,并在其中部署一個只包含一個節(jié)點的簡單集群。Minikube 支持 Linux、macOS 和 Windows 系統(tǒng)。Minikube 的命令行接口提供了一些基本的引導操作,用于操作你的集群,包括啟動(start)、停止(stop)、查看狀態(tài)(status)和刪除(delete)。文章來源地址http://www.zghlxwxcb.cn/news/detail-851205.html
到了這里,關于K8S哲學 - cluster的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!