簡體   English   中英

kubectl wait - 在條件滿足之前等待條件超時

[英]kubectl wait - timed out waiting for the condition before the condition met

當我縮小 statefulset 時,我試圖檢查 pod 狀態,但是在 pod 完全終止之前“kubectl wait”命令退出。

狀態集終止

> kubectl scale statefulset.apps/myneo4j --replicas=0

Kubectl 等待

> time kubectl wait --for=condition=delete pod -l app.kubernetes.io/name=neo
timed out waiting for the condition on pods/myneo4j-0
timed out waiting for the condition on pods/myneo4j-1
timed out waiting for the condition on pods/myneo4j-2

real    1m30.163s
user    0m0.122s
sys     0m0.057s

請建議如何在不使用 --timeout 條件的情況下讓命令等待 pod 完全終止。 即使 pod 完全終止, timeout 也會讓命令等待。

實際上,默認超時等於 30 秒,在您的情況下,您達到每個副本的超時(您有 3 個副本),因此總時間為 1 分 30 秒。

您可以設置任何其他正值(與單位)來增加超時,零檢查一次或負值等待一周:

kubectl wait --for=condition=delete pod -l app.kubernetes.io/name=neo --timeout=1h

當您設置超時時,您的命令會一直等待,直到在資源的狀態字段中看到指定的條件,或者直到達到超時,但它不會永遠等待,如果是這樣,您應該調試您的命令。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM