Skip to content

Pod is removed from store but the containers are not terminated #88613

@ialidzhikov

Description

@ialidzhikov

What happened:
Pod is removed from store but the associated containers can run on the Node for a very long time.

What you expected to happen:
I would expect to have a consistent behaviour and when a Pod is removed from the store, the associated containers to be terminated.

How to reproduce it (as minimally and precisely as possible):

  1. Apply the following Pod:
apiVersion: v1
kind: Pod
metadata:
  name: alpine
spec:
  activeDeadlineSeconds: 30
  containers:
  - command:
    - sh
    - -c
    - sleep 3600
    image: alpine:3.10.3
    imagePullPolicy: IfNotPresent
    name: alpine
  terminationGracePeriodSeconds: 600
  1. Ensure that after 30s (.spec.activeDeadlineSeconds) the Pod will be with .status.phase=Failed and .status.reason=DeadlineExceeded. Ensure that the container will receive SIGTERM signal at this point of the time.

  2. Delete the Pod after it is DeadlineExceeded.

$ k delete po alpine
  1. Ensure that the deletion completes right away and the pod is removed from the store.

  2. Ensure that the associated containers will continue to run on the Node until .spec.terminationGracePeriodSeconds is passed.

/ # docker ps | grep alpine
f2fdf243db1a        alpine                                                                       "sh -c 'sleep 3600'"     3 minutes ago       Up 3 minutes                            k8s_alpine_alpine_default_c8aa37a1-d248-4831-a06f-e9ac4bac4a62_0

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): v1.15.10
$ k version

Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.10", GitCommit:"1bea6c00a7055edef03f1d4bb58b773fa8917f11", GitTreeState:"clean", BuildDate:"2020-02-11T20:05:26Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Network plugin and version (if this is a network-related bug):
  • Others:

Metadata

Metadata

Assignees

Labels

area/kubeletkind/bugCategorizes issue or PR as related to a bug.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.sig/nodeCategorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions