When i create a job, it gets created successfully. however in the logs it compla . . .

Ravi Vijaykumar:
when i create a job, it gets created successfully. however in the logs it complains as pod not found, any idea why please? and how to debug this?

Job as below:

apiVersion: batch/v1
kind: Job
metadata:
  name: throw-job-1
spec:
 backoffLimit: 15
 template:
  spec:
   containers:
   -  image: kodekloud/throw-dice
      name: throw-dice
   restartPolicy: Never

Command: kubectl create -f throw-job-1.yml

Output:

 job.batch/throw-job-1 created

Logs command: kubectl logs throw-job-1

Output of logs:

Error from server (NotFound): pods "throw-job-1" not found

Ravi Vijaykumar:
If i go to a pod associated with the job after doing describe job, it does show the output in the pod logs

Ravi Vijaykumar:
but confused why it is not showing up when we do logs against job itself

Ravi Vijaykumar:
I am going to just assume logs is not for jobs for now.

unnivkn:
Hi… how long this job is running ? Can you make sure the job is running for long time & look for the logs

David David:
kubectl logs job/throw-job-1