Kubernetes job only runs four times, when it should run six according to `backoffLimit` parameter

5/21/2019

Job runs for four times, and gets a errors. After this, it does not keep running,although default option backoffLimit is set to six.

Why is this happening?

spec:
  activeDeadlineSeconds: 600
  backoffLimit: 6
  completions: 1
  parallelism: 1
test-job-pqgz7                    0/1     Error     0          10m
test-job-s6j4h                    0/1     Error     0          9m50s
test-job-vgjcc                    0/1     Error     0          10m
test-job-w4c7v                    0/1     Error     0          10m

---- EDIT (adding more info) ------

Describe output:

[root@kube-master-01 ~]# kubectl describe job
Name:                     test-job
Namespace:                default
Selector:                 controller-uid=fa052b6a-7bb5-11e9-bb14-fa163ec7733c
Labels:                   controller-uid=fa052b6a-7bb5-11e9-bb14-fa163ec7733c
                          job-name=test-job
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"batch/v1","kind":"Job","metadata":{"annotations":{},"name":"test-job","namespace":"default"},"spec":{"activeDeadlineSeconds...
Parallelism:              1
Completions:              1
Start Time:               Tue, 21 May 2019 18:48:32 +0800
Active Deadline Seconds:  1200s
Pods Statuses:            0 Running / 0 Succeeded / 4 Failed
Pod Template:
  Labels:  controller-uid=fa052b6a-7bb5-11e9-bb14-fa163ec7733c
           job-name=test-job
  Containers:
   busybox:
    Image:      busybox
    Port:       <none>
    Host Port:  <none>
    Command:
      sh
    Args:
      -c
      wget --server-response --spider www123.baidu.com 2>&1|grep '200 OK'
    Environment:  <none>
    Mounts:       <none>
  Volumes:        <none>
Events:
  Type     Reason                Age    From            Message
  ----     ------                ----   ----            -------
  Normal   SuccessfulCreate      3m51s  job-controller  Created pod: test-job-gzkfg
  Normal   SuccessfulCreate      3m44s  job-controller  Created pod: test-job-jszs5
  Normal   SuccessfulCreate      3m34s  job-controller  Created pod: test-job-9h5sb
  Normal   SuccessfulCreate      2m54s  job-controller  Created pod: test-job-ck4x6
  Warning  BackoffLimitExceeded  14s    job-controller  Job has reached the specified backoff limit

Kubernetes version:

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:30:26Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:30:26Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
-- lklkxcxc
jobs
kubernetes

0 Answers