Skip to content

kubelet doesn't respect terminationGracePeriodSeconds and kills pause container #35333

@kayrus

Description

@kayrus

kubernetes 1.3.5

when you set terminationGracePeriodSeconds: 999 for the pod and this pod terminates tool long (it has to reschedule the data), kubelet terminates pause container (after 2 minutes when --sync-frequency=1m0s) and pod became inaccessible. and as a result data rescheduling fails too.

pod.yaml:

apiVersion: v1
kind: Pod
metadata:
  name: long-waiting-pod
spec:
  containers:
  - name: base
    image: alpine:3.4
    command:
      - sleep
      - '999999'
  terminationGracePeriodSeconds: 999999
kubectl create -f pod.yaml

run in another terminal and watch for eth0 network interface.

kubectl exec -ti long-waiting-pod -- watch -n1 ifconfig

delete the pod:

kubectl delete pod long-waiting-pod

and after 2 minutes you'll see:

Every 1s: ifconfig                                          2016-10-21 21:53:48

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1%32587/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions