Kubernetes部署中当前和可用的Pod副本之间有什么区别? [英] What is the difference between current and available pod replicas in kubernetes deployment?
问题描述
我正在努力弄清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:
在以下输出中找不到current
和available
列之间的区别吗?
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:
-
Current
< =Desired
是真的吗? -
Up-to-Date
< =Current
是真的吗? -
Up-to-Date
>Current
和Up-to-Date
< =Desired
是真的吗? -
Available
总是< =Current
还是可以是>Available
?
- Is
Current
<=Desired
true? - Is
Up-to-Date
<=Current
true? - Is
Up-to-Date
>Current
andUp-to-Date
<=Desired
true? - 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).
-
Current
是否总是< =Desired
?否,当前可能会比部署更新期间的电流大.
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屋!