为什么“kubectl描述工作xxx”得到了TooManyActivePods?

时间:2017-06-08 10:10:45

标签: kubernetes

我正在运行作业示例https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/

apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    metadata:
      name: pi
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never

我收到了一些警告

  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-5n0vn
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-5n0vn
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-qlp5f
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-j9z6s
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-qlp5f
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-mf1j9
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-mf1j9
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-j9z6s
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-qlp5f
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-w3m2m
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-qlp5f
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-5n0vn
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-nww4h
  23m           23m             2       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-p8pt9
  23m           23m             1       {job-controller }                       Warning         FailedDelete            Error deleting: pods "pi-mf1j9" not found
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-w3m2m
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-69l9r
  23m           23m             1       {job-controller }                       Normal          SuccessfulCreate        Created pod: pi-p8pt9
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-69l9r
  23m           23m             1       {job-controller }                       Normal          SuccessfulDelete        Deleted pod: pi-p8pt9
  23m           23m             1       {job-controller }                       Warning         TooManyActivePods       Too many active pods running after completion count reached
  23m           23m             1       {job-controller }                       Warning         TooManyActivePods       Too many active pods running after completion count reached
  23m           23m             1       {job-controller }                       Warning         TooManyActivePods       Too many active pods running after completion count reached

为什么要开始这么多pod并将其删除?

我无法删除作业

[root@c3-sa-i2-20151229-buf023 ~]# kubectl delete job pi
error: timed out waiting for "pi" to be synced

1 个答案:

答案 0 :(得分:0)

尝试将--grace-period=0 --force添加到删除命令。

https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods

  

kubectl delete命令支持--grace-period =选项,该选项允许用户覆盖默认值并指定自己的值。值0强制删除pod。在kubectl版本> = 1.5中,您必须指定一个附加标志--force以及--grace-period = 0才能执行强制删除。