简体   繁体   English

kubernetes部署中当前和可用pod复制品之间有什么区别?

[英]What is the difference between current and available pod replicas in kubernetes deployment?

I am trying to get my hands dirty on Kubernetes. 我想在Kubernetes上弄脏手。 I am firing following command: 我正在按照命令触发:

kubectl get deployment

and I get the following headers in the output: 我在输出中得到以下标题:

kubectll获得部署

I can't find the difference between current and available columns in the following output? 我在以下输出中找不到current列和available列之间的区别?

I know that official documentation gives a small description each of these fields, but it doesn't answer my following questions: 我知道官方文档给出了每个字段的小描述,但它没有回答我的以下问题:

  1. Is Current <= Desired true? Current <= Desired真的吗?
  2. Is Up-to-Date <= Current true? Up-to-Date <= Current真的吗?
  3. Is Up-to-Date > Current and Up-to-Date <= Desired true? Up-to-Date > CurrentUp-to-Date <= Desired真的吗?
  4. Is Available always <= Current OR it can be > Available ? 是否Available <= Current或它可以> Available

In short, what is the relation between all these fields? 简而言之,所有这些领域之间的关系是什么?

The Deployment object specifies the desired state of your Deployment, and the Deployment Controller drives the current state of the system towards the desired state. Deployment对象指定部署的所需状态,Deployment Controller将系统的当前状态驱动到所需状态。

The Desired field specifies the number of replicas you asked for, while the Current field specifies the number of replicas that are currently running in the system. Desired字段指定您要求的副本数,而Current字段指定当前在系统中运行的副本数。 The Up-To-Date field indicates the number of replicas that are up to date with the desired state. Up-To-Date字段指示具有所需状态的最新副本数。 The Available field shows the number of replicas that are passing readiness probes (if defined). Available字段显示通过就绪探针(如果已定义)的副本数。

  1. Is Current always <= Desired ? Current总是<= Desired No, current can be greater than desired during a deployment update. 不,在部署更新期间,当前可能大于期望值。

  2. Is Up-to-date always <= Current ? Up-to-date总是<= Current I believe the answer here is yes. 我相信这里的答案是肯定的。

  3. Is Up-to-date > Current ? Up-to-date > Current No, up-to-date should be the same as current, or less than current during a deployment update. 不,最新应与部署更新期间的当前或小于当前相同。

  4. Is Available always <= Current ? Available <= Current Yes. 是。

I encourage you to go through a deployment update and scale out/in while using watch to monitor these fields as the controller converges current state to desired state. 我鼓励您在使用watch监视这些字段时进行部署更新和扩展/输入,因为控制器会将当前状态收敛到所需状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM