I am not sure why you want to enter the filesystem to check why Job
failed.
When you are creating job
it automatically creates pod
. Example based on official docs.
$ sudo k3s kubectl apply -f https://k8s.io/examples/controllers/job.yaml
job.batch/pi created
In the meantime it created pod (in the meantime ive created alias kk="sudo k3s kubectl")
$ kk get pods
NAME READY STATUS RESTARTS AGE
pi-796ng 0/1 Completed 0 55s
$ kk get jobs
NAME COMPLETIONS DURATION AGE
pi 1/1 7s 30s
1. To check what happen inside the pod you can check it by
$ sudo k3s kubectl logs <pod_name> -c <container_name>
$ kk logs pi-796ng -c pi
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647...
2. Describe pod / describe job
$ sudo k3s kubectl describe pod <pod_name>
$ sudo k3s kubectl describe job <job_name>
If they are in different namespace
then default
you need to add -n <namespace>
flag to query
3. Kubernetes events
Execute command
$ sudo k3s kubectl get events
It will show you all events from your Kubernetes
cluster.
Many troubleshooting factors might also depends on your Job
spec. For example .spec.activeDeadlineSeconds
or .spec.backoffLimit
. More info here.