kubectl describe deployment中"available"和"unavailable"的含义
Meaning of "available" and "unavailable" in kubectl describe deployment
Readiness probe 成功与否决定pod 就绪或未就绪。如果我设置 .spec.minReadySeconds = 60
并且 Readiness 探测成功(.readinessProbe.initialDelaySeconds = 1
),那么当我们创建部署超过 1 秒小于 60 秒时,pod 进入就绪状态但部署的 'status' 如下所示:
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 从容器访问资源,所以如果部署中有一些 pod 不可用,它会对我有什么影响?
这可能是对术语的误解。从 deployment documentation 开始,有:
.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 秒且没有任何崩溃才能被视为 "available"。因此,您看到的是,即使您的 pods 已标记为准备就绪,它们仍未满足 minReadySeconds
的条件。
Readiness probe 成功与否决定pod 就绪或未就绪。如果我设置 .spec.minReadySeconds = 60
并且 Readiness 探测成功(.readinessProbe.initialDelaySeconds = 1
),那么当我们创建部署超过 1 秒小于 60 秒时,pod 进入就绪状态但部署的 'status' 如下所示:
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 从容器访问资源,所以如果部署中有一些 pod 不可用,它会对我有什么影响?
这可能是对术语的误解。从 deployment documentation 开始,有:
.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 秒且没有任何崩溃才能被视为 "available"。因此,您看到的是,即使您的 pods 已标记为准备就绪,它们仍未满足 minReadySeconds
的条件。