admin管理员组文章数量:1287885
I'm using kubectl rollout status
to monitor the scale up/down of statefulset. But on scale down it doesn't work the prompt/script right away continues even tho there are still pod out which are in the process of terminating.
Example scale up:
kubectl scale sts my-cnn-box --replicas=20
##wait for most replicas to be deployed
kubectl rollout status sts my-cnn-box --timeout=15m
output
statefulset.apps/my-cnn-box scaled
Waiting for 20 pods to be ready...
Waiting for 19 pods to be ready...
Waiting for 19 pods to be ready...
Waiting for 18 pods to be ready...
Waiting for 18 pods to be ready...
Example scale down:
##clean stop
kubectl scale sts -n my-ns --replicas=0 --all
##wait for replicas to be terminated
kubectl rollout status sts my-cnn-box --timeout=15m
output, cmd prompt comes back right away so I can run the cmd few times.
partitioned roll out complete: 11 new pods have been updated...
tilo@my:/mnt/c/temp$ kubectl rollout status sts my-cnn-box --timeout=15m
partitioned roll out complete: 6 new pods have been updated...
tilo@my:/mnt/c/temp$ kubectl rollout status sts my-cnn-box --timeout=15m
partitioned roll out complete: 4 new pods have been updated...
tilo@my:/mnt/c/temp$ kubectl rollout status sts my-cnn-box --timeout=15m
partitioned roll out complete: 2 new pods have been updated...
is there a tweak to the rollout status or should it work for scale down?
I'm using kubectl rollout status
to monitor the scale up/down of statefulset. But on scale down it doesn't work the prompt/script right away continues even tho there are still pod out which are in the process of terminating.
Example scale up:
kubectl scale sts my-cnn-box --replicas=20
##wait for most replicas to be deployed
kubectl rollout status sts my-cnn-box --timeout=15m
output
statefulset.apps/my-cnn-box scaled
Waiting for 20 pods to be ready...
Waiting for 19 pods to be ready...
Waiting for 19 pods to be ready...
Waiting for 18 pods to be ready...
Waiting for 18 pods to be ready...
Example scale down:
##clean stop
kubectl scale sts -n my-ns --replicas=0 --all
##wait for replicas to be terminated
kubectl rollout status sts my-cnn-box --timeout=15m
output, cmd prompt comes back right away so I can run the cmd few times.
partitioned roll out complete: 11 new pods have been updated...
tilo@my:/mnt/c/temp$ kubectl rollout status sts my-cnn-box --timeout=15m
partitioned roll out complete: 6 new pods have been updated...
tilo@my:/mnt/c/temp$ kubectl rollout status sts my-cnn-box --timeout=15m
partitioned roll out complete: 4 new pods have been updated...
tilo@my:/mnt/c/temp$ kubectl rollout status sts my-cnn-box --timeout=15m
partitioned roll out complete: 2 new pods have been updated...
is there a tweak to the rollout status or should it work for scale down?
Share Improve this question edited Feb 25 at 0:39 David Maze 160k45 gold badges243 silver badges287 bronze badges asked Feb 24 at 19:35 TiloTilo 1,2203 gold badges24 silver badges47 bronze badges1 Answer
Reset to default 0kubectl rollout status
isn't primarily designed to track the removal of pods during a scale down of a StatefulSet. It primarily focuses on observing updates and new pod deployments as it is more focused on the progress of pod creation and updates.
If you want to see or watch the realtime changes of pods, you can use –watch
or -w
to see pods transition through statuses like Terminating and eventually disappear from the output :
kubectl get pod <your pod name> -w
See this additional information that might help :
- https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-status-em-
- https://github/kubernetes/kubectl/issues/1628
- https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#scale
本文标签: kuberneteskubectl rollout status for scale downdoesn39t workStack Overflow
版权声明:本文标题:kubernetes - kubectl rollout status for scale down - doesn't work - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741245067a2364715.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论