Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play kube: initContainer keeps restarting #16343

Closed
1player opened this issue Oct 29, 2022 · 1 comment · Fixed by #16698
Closed

play kube: initContainer keeps restarting #16343

1player opened this issue Oct 29, 2022 · 1 comment · Fixed by #16698
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@1player
Copy link

1player commented Oct 29, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

A pod with an initContainer has it restarting ad infinitum, even if successful. Removing the initContainer fixes it.

Steps to reproduce the issue:

apiVersion: v1
kind: Pod
metadata:
  name: website
spec:
  initContainers:
  - name: volume-permissions
    image: docker.io/library/busybox
    command: ["ls"]
  containers:
    - image: docker.io/library/busybox
      command: ["sleep", "3000"]

then podman play kube --replace pod.yml

Describe the results you received:

Pod takes 30 seconds to start. Journal shows initContainer keeps being restarted.

Oct 29 12:49:21 combo podman[102563]: 2022-10-29 12:49:21.469683827 +0000 UTC m=+0.079065087 container restart 92df18deabbcbe5a87f4ba9b17ced6ea8157bf759fee4dec7536ef7a0cbe5973 (image=docker.io/library/busybox:latest, name=website-volume-permissions, health_status=)
Oct 29 12:49:21 combo systemd[1]: Started libpod-92df18deabbcbe5a87f4ba9b17ced6ea8157bf759fee4dec7536ef7a0cbe5973.scope - libcrun container.
Oct 29 12:49:21 combo audit: BPF prog-id=2499 op=LOAD
Oct 29 12:49:21 combo podman[102563]: 2022-10-29 12:49:21.620462302 +0000 UTC m=+0.229843380 container init 92df18deabbcbe5a87f4ba9b17ced6ea8157bf759fee4dec7536ef7a0cbe5973 (image=docker.io/library/busybox:latest, name=website-volume-permissions, health_status=)
Oct 29 12:49:21 combo website-volume-permissions[102574]: bin
Oct 29 12:49:21 combo website-volume-permissions[102574]: dev
Oct 29 12:49:21 combo website-volume-permissions[102574]: etc
Oct 29 12:49:21 combo website-volume-permissions[102574]: home
Oct 29 12:49:21 combo website-volume-permissions[102574]: proc
Oct 29 12:49:21 combo website-volume-permissions[102574]: root
Oct 29 12:49:21 combo website-volume-permissions[102574]: run
Oct 29 12:49:21 combo website-volume-permissions[102574]: sys
Oct 29 12:49:21 combo website-volume-permissions[102574]: tmp
Oct 29 12:49:21 combo website-volume-permissions[102574]: usr
Oct 29 12:49:21 combo website-volume-permissions[102574]: var
Oct 29 12:49:21 combo podman[102563]: 2022-10-29 12:49:21.628705606 +0000 UTC m=+0.238086684 container start 92df18deabbcbe5a87f4ba9b17ced6ea8157bf759fee4dec7536ef7a0cbe5973 (image=docker.io/library/busybox:latest, name=website-volume-permissions, health_status=)
Oct 29 12:49:21 combo systemd[1]: libpod-92df18deabbcbe5a87f4ba9b17ced6ea8157bf759fee4dec7536ef7a0cbe5973.scope: Deactivated successfully.
Oct 29 12:49:21 combo audit: BPF prog-id=0 op=UNLOAD
Oct 29 12:49:21 combo podman[102578]: 2022-10-29 12:49:21.732714792 +0000 UTC m=+0.088481172 container died 92df18deabbcbe5a87f4ba9b17ced6ea8157bf759fee4dec7536ef7a0cbe5973 (image=docker.io/library/busybox:latest, name=website-volume-permissions, health_status=)

repeated forever.

Describe the results you expected:

initContainer runs once

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.5
Built:        Wed Sep  7 19:58:19 2022
OS/Arch:      linux/amd64

Output of podman info:

host:
  arch: amd64
  buildahVersion: 1.27.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.4-3.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.4, commit: '
  cpuUtilization:
    idlePercent: 99.7
    systemPercent: 0.14
    userPercent: 0.17
  cpus: 2
  distribution:
    distribution: fedora
    version: "36"
  eventLogger: journald
  hostname: combo
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.19.4-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 2089476096
  memTotal: 4008861696
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.6-2.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.6
      commit: 18cf2efbb8feb2b2f20e316520e0fd0b6c41ef4d
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 4008701952
  swapTotal: 4008701952
  uptime: 97h 47m 5.00s (Approximately 4.04 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 40165670912
  graphRootUsed: 1936789504
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 8
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.2.1
  Built: 1662580699
  BuiltTime: Wed Sep  7 19:58:19 2022
  GitCommit: ""
  GoVersion: go1.18.5
  Os: linux
  OsArch: linux/amd64
  Version: 4.2.1

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

podman-4.2.1-2.fc36.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

No

Additional environment details (AWS, VirtualBox, physical, etc.):

Fedora Server VPS, pod running as root

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 29, 2022
@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

rhatdan added a commit to rhatdan/podman that referenced this issue Dec 1, 2022
This is causing podman to wait about 25 seconds before starting
the primary container.

Fixes: containers#16343

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <[email protected]>
@umohnani8 umohnani8 assigned rhatdan and unassigned umohnani8 Dec 5, 2022
tony84727 added a commit to tony84727/podman that referenced this issue May 5, 2023
Restart policy of initContainers should not be overriden by pod and
the restart policy should always be "no".

See containers#16343

Signed-off-by: Tony Duan <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants