# 创建job [root@master ~]# kubectl create -f pc-job.yaml job.batch/pc-job created
# 查看job [root@master ~]# kubectl get job -n dev -w -o wide NAME COMPLETIONS DURATION AGE CONTAINERS IMAGES SELECTOR pc-job 0/1 27s 27s counter centos:7.8.2003 app=counter-pod pc-job 1/1 28s 28s counter centos:7.8.2003 app=counter-pod
# 通过观察pod状态可以看到,pod在运行完毕任务后,就会变成Completed状态 [root@master ~]# kubectl get pod -n dev -w NAME READY STATUS RESTARTS AGE pc-job-rk64q 1/1 Running 0 1s pc-job-rk64q 0/1 Completed 0 28s