有沒有辦法以編程方式確定 pod 是否處于 crashloopbackoff 狀態?我嘗試了以下pods,err := client.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})if err != nil { return err}for _, item := range pods.Items { log.Printf("found pod %v with state %v reason %v and phase %v that started at %v", item.Name, item.Status.Message, item.Status.Reason, item.Status.Phase, item.CreationTimestamp.Time)}然而,這只是出于狀態和原因打印空白,但它打印階段。
- 1 回答
- 0 關注
- 115 瀏覽
添加回答
舉報
0/150
提交
取消