Kubernetes部署中当前和可用的Pod副本之间有什么区别? [英] What is the difference between current and available pod replicas in kubernetes deployment?

查看:321
本文介绍了Kubernetes部署中当前和可用的Pod副本之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力弄清Kubernetes.我正在执行以下命令:

I am trying to get my hands dirty on Kubernetes. I am firing following command:

kubectl get deployment

我在输出中得到以下标题:

and I get the following headers in the output:

在以下输出中找不到currentavailable列之间的区别吗?

I can't find the difference between current and available columns in the following output?

我知道官方文档对每个字段都有一个简短的描述,但是并不能回答我的以下问题:

I know that official documentation gives a small description each of these fields, but it doesn't answer my following questions:

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

简而言之,所有这些字段之间是什么关系?

In short, what is the relation between all these fields?

推荐答案

Deployment对象指定部署的所需状态,Deployment Controller将系统的当前状态驱动到所需状态.

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.

Desired字段指定所需的副本数,而Current字段指定系统中当前正在运行的副本数. Up-To-Date字段指示具有所需状态的最新副本数. Available字段显示通过就绪探针(如果已定义)的副本数量.

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. The Up-To-Date field indicates the number of replicas that are up to date with the desired state. The Available field shows the number of replicas that are passing readiness probes (if defined).

  1. Current是否总是< = Desired?否,当前可能会比部署更新期间的电流大.

  1. Is Current always <= Desired? No, current can be greater than desired during a deployment update.

Up-to-date是否总是< = Current?我相信答案是肯定的.

Is Up-to-date always <= Current? I believe the answer here is yes.

Up-to-date> Current是吗?否,最新版本应与当前版本相同,或小于部署更新期间的最新版本.

Is Up-to-date > Current? No, up-to-date should be the same as current, or less than current during a deployment update.

Available是否总是< = Current?是的.

Is Available always <= Current? Yes.

我建议您在控制器将当前状态收敛到所需状态时使用watch监视这些字段时进行部署更新并进行横向扩展/纵向扩展.

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.

这篇关于Kubernetes部署中当前和可用的Pod副本之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆