术语“可用"的意思是“可用".和“不可用"在kubectl中描述部署 [英] Meaning of "available" and "unavailable" in kubectl describe deployment

查看:161
本文介绍了术语“可用"的意思是“可用".和“不可用"在kubectl中描述部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

准备就绪探针成功与否决定了吊舱准备就绪或未就绪.如果我设置 .spec.minReadySeconds = 60 且Readiness探针成功( .readinessProbe.initialDelaySeconds = 1 ),那么当我们创建部署时要少1秒超过60秒,广告连播进入就绪状态,但是部署的状态"如下所示:

Readiness probe success or not determine the pod ready or not ready. If I set the .spec.minReadySeconds = 60 and the Readiness probe is success(.readinessProbe.initialDelaySeconds = 1), so when we created the deployment more than 1 second less than 60 seconds the pod enter the ready status but the deployment's 'status' like below:

kubectl describe deployment readiness-minreadyseconds
Name:           readiness-minreadyseconds
Namespace:      default
CreationTimestamp:  Wed, 21 Sep 2016 10:34:42 +0800
Labels:         add=readiness-minreadyseconds
Selector:       name=readiness-minreadyseconds
Replicas:       2 updated | 2 total | 0 available | 2 unavailable
StrategyType:       RollingUpdate
MinReadySeconds:    45
RollingUpdateStrategy:  1 max unavailable, 1 max surge
OldReplicaSets:     <none>
NewReplicaSet:      readiness-minreadyseconds-536553145 (2/2 replicas created)
Events:
  FirstSeen LastSeen    Count   From                SubobjectPath   Type        Reason          Message
  --------- --------    -----   ----                -------------   --------    ------          -------
  2s        2s      1   {deployment-controller }            Normal      ScalingReplicaSet   Scaled up replica set readiness-minreadyseconds-536553145 to 2

我发现我们可以通过nodeport类型从容器访问资源,因此,如果部署中有一些吊舱不可用,它将如何影响我?

I found that we can access the resource from container by type nodeport, so if there are some pod unavailable in the deployment, how it could affect me?

推荐答案

这可能是对术语的误解.从部署文档中,有一个:

This may be a misunderstanding of the terminology. From the deployment documentation, one has:

.spec.minReadySeconds是一个可选字段,用于指定最小值新创建的Pod准备就绪的秒数不会发生任何容器崩溃的情况,以便将其考虑在内可用.

.spec.minReadySeconds is an optional field that specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available.

因此,将 minReadySeconds 设置为60,它需要持续60秒,而不会发生任何崩溃,才能被视为可用".因此,您所看到的是,即使您的广告连播已标记为就绪,它们仍不满足 minReadySeconds 的条件.

So the minReadySeconds is set to 60, it needs to be up for 60 seconds without any crashes to be considered "available". So, what you're seeing is that even though your pods have been marked ready, they're not satisfying that condition of minReadySeconds yet.

这篇关于术语“可用"的意思是“可用".和“不可用"在kubectl中描述部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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