"Pods"和"Pods"之间的区别是什么和“静态包"在kubernetes中以及何时选择“静态广告连播"在普通豆荚上 [英] Whats the difference between "Pods" and "Static Pods" in kubernetes and when to choose "static pods" over regular pods
问题描述
对于kubernetes来说是新手,并且希望了解有关使用不同kubernetes对象的最佳实践,并且很难理解在功能上"Pods"和"Static Pods"之间的主要区别是什么(如果有)?
New to kubernetes and looking to understand the best practice around using different kubernetes objects and have difficulty understanding what is a major difference between "Pods" and "Static Pods" functionally if there is any ?
主要问题如下:
问题1:"Pods"和"Static Pods"在功能上有何主要区别?
Question 1: What is a major difference between "Pods" and "Static Pods" functionally if there is any ?
问题2:何时在常规吊舱上选择静态吊舱".
Question 2: When to choose "static pods" over regular pods.
推荐答案
静态Pod是由kubelet守护程序在特定节点上创建和管理的Pod,API服务器未对其进行观察.如果静态容器崩溃,则kubelet会重新启动它们.控制平面不参与静态Pod的生命周期. Kubelet还会尝试在kubernetes api服务器上为每个静态Pod创建一个镜像Pod,以便可见静态Pod,例如,当您执行kubectl get pod
时,静态Pod的镜像对象也会被列出.
Static pods are pods created and managed by kubelet daemon on a specific node without API server observing them. If the static pod crashes, kubelet restarts them. Control plane is not involved in lifecycle of static pod. Kubelet also tries to create a mirror pod on the kubernetes api server for each static pod so that the static pods are visible i.e., when you do kubectl get pod
for example, the mirror object of static pod is also listed.
几乎不需要处理静态Pod.静态Pod通常由软件引导kubernetes本身使用.例如,kubeadm
使用静态容器将kubernetes控制平面组件(如api-server,controller-manager)作为静态容器调出. kubelet
可以监视主机文件系统上的目录(使用kubelet的--pod-manifest-path
参数配置)或定期从Web URL同步pod清单(使用kubelet的--manifest-url
参数配置).当kubeadm
启动kubernetes控制平面时,它会在kubelet正在监视的目录中为api-server,controller-manager生成pod清单.然后,kubelet将这些控制平面组件显示为静态吊舱.
You almost never have to deal with static pods. Static pods are usually used by software bootstrapping kubernetes itself. For example, kubeadm
uses static pods to bringup kubernetes control plane components like api-server, controller-manager as static pods. kubelet
can watch a directory on the host file system (configured using --pod-manifest-path
argument to kubelet) or sync pod manifests from a web url periodically (configured using --manifest-url
argument to kubelet). When kubeadm
is bringing up kubernetes control plane, it generates pod manifests for api-server, controller-manager in a directory which kubelet is monitoring. Then kubelet brings up these control plane components as static pods.
这篇关于"Pods"和"Pods"之间的区别是什么和“静态包"在kubernetes中以及何时选择“静态广告连播"在普通豆荚上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!