[root@centos-7-51 ~]# cat /tmp/job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: test-job
namespace: default
spec:
template:
metadata:
labels:
jobType: sleep
spec:
restartPolicy: Never
containers:
- name: job-sleep
image: busybox:latest
command:
- sleep
- "60"
[root@centos-7-51 ~]# kubectl apply -f /tmp/job.yaml
[root@centos-7-51 ~]# kubectl get pod -o wide| grep job
test-job-2fccp 0/1 Completed 0 3m21s 172.16.4.43 centos-7-55 <none> <none>
[root@centos-7-51 ~]# kubectl get job -o wide
NAME COMPLETIONS DURATION AGE CONTAINERS IMAGES SELECTOR
test-job 1/1 68s 3m26s job-sleep busybox:latest controller-uid=3ba88fdd-ad1c-46c7-86b4-dc6e641ebdb4