Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

A container cannot restart when there is any terminating container in the same pod #121398

Copy link
Copy link
@gjkim42

Description

@gjkim42
Issue body actions

What happened?

A terminated container cannot restart when there is any terminating container in the same pod.

/sig node

What did you expect to happen?

I expect the terminated container can restart during another container's termination.

How can we reproduce it (as minimally and precisely as possible)?

Make a pod with

  • terminating-container: terminate because of the liveness failure
  • restarting-container: exit immediately
apiVersion: v1
kind: Pod
metadata:
  labels:
    run: test
  name: test
spec:
  containers:
  - args:
    - bash
    - "-c"
    - |
      _term() {
        echo "terminating..." >> /shared/log
        sleep 15s
        echo "terminated" >> /shared/log
        exit 0
      }
      trap _term TERM
      exec sleep infinity & wait $!
    livenessProbe:
        exec:
          command:
          - "false"
        periodSeconds: 1
        failureThreshold: 1
    image: ubuntu
    name: terminating-container
    volumeMounts:
    - name: log
      mountPath: /shared
  - args:
    - bash
    - "-c"
    - echo "start a container" >> /shared/log
    image: ubuntu
    name: restarting-container
    volumeMounts:
    - name: log
      mountPath: /shared
  - args:
    - tail
    - -F
    - /shared/log
    image: ubuntu
    name: log
    volumeMounts:
    - name: log
      mountPath: /shared
  volumes:
  - name: log
    emptyDir: {}
$ kubectl logs test -c log -f
start a container
start a container
terminating...
terminated
start a container
terminating...
terminated
terminating...
terminated
start a container
terminating...
terminated
terminating...
terminated
start a container
terminating...
terminated
start a container

The result is saying that no container restarts during the termination.

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.0

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.Categorizes 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.Important 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.Categorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Status

Triaged
Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.