# kubectl get node NAME STATUS ROLES AGE VERSION edge-node Ready <none> 15m v1.17.0 edge-node2 Ready <none> 16m v1.17.0 ubuntu Ready master 67d v1.17.0
kubectl get cronjob hello kubectl describe cronjob hello
查看job过程:
1 2 3 4 5 6 7 8 9
# kubectl get cronjob NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 <none> 32s
// 等等片刻后
# kubectl get cronjob hello NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 1 22s 2m9s
(发现,ACTIVE在0和1之间变化)
监控job过程:
1 2 3 4 5 6
# kubectl get jobs --watch NAME COMPLETIONS DURATION AGE hello-1583853360 1/1 29s 3m12s hello-1583853420 1/1 17s 2m12s hello-1583853480 1/1 17s 72s hello-1583853540 0/1 12s 12s
查看log(必须等待任务被调度到):
1 2 3 4 5 6 7
# kubectl get pods # kubectl logs hello-1583853900-4jbtv Tue Mar 10 15:25:23 UTC 2020 Hello from the Kubernetes cluster # kubectl logs hello-1583853960-h2fdk Tue Mar 10 15:26:23 UTC 2020 Hello from the Kubernetes cluster