origin icon indicating copy to clipboard operation
origin copied to clipboard

Init container keeps re-executing

Open mliker opened this issue 8 years ago • 7 comments

I have an init container which copies some files from the init container image to a volume shared with the main container. It is a simple rsync -a source dest. After the init container completes successfully (exit code 0) the main container is started and the pod has status of Running. However after a minute or two, while the main container is still running (no restarts) the init container is started again and the pod status changes to pending. The init container finishes (exit code 0) and the pod status is again Running. Now in the next minute or so the whole thing repeats itself. I was also able to reproduce this with a simple sleep 120 command in an init container.

Version

oc v3.9.0+ba7faec-1 kubernetes v1.9.1+a0ce1bc657 features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://xxx.xxx.xxx:8443 openshift v3.9.0+ba7faec-1 kubernetes v1.9.1+a0ce1bc657

Steps To Reproduce
  1. add the following to an existing dc initContainers: - args: - '120' command: - /bin/sleep image: >- docker-registry.default.svc:5000/aproject/animage:latest imagePullPolicy: Always name: aname resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File
  2. Watch the pod
Current Result

Init container is being run over and over

Expected Result

Init container does not run more then once

Additional Information

~ # oc get pod apod-6-rj9nv --watch NAME READY STATUS RESTARTS AGE apod-6-rj9nv 1/1 Running 0 18m apod-6-rj9nv 0/1 Init:0/1 0 18m apod-6-rj9nv 1/1 Running 0 19m apod-6-rj9nv 0/1 Init:0/1 0 19m apod-6-rj9nv 1/1 Running 0 20m apod-6-rj9nv 0/1 Init:0/1 0 21m apod-6-rj9nv 1/1 Running 0 21m apod-6-rj9nv 0/1 Init:0/1 0 23m apod-6-rj9nv 1/1 Running 0 23m

mliker avatar Jul 07 '18 06:07 mliker

@openshift/sig-pod

jwforres avatar Jul 25 '18 14:07 jwforres

This looks a lot like https://github.com/kubernetes/kubernetes/issues/67261 - does it happen after cleanup?

derkoe avatar Oct 09 '18 09:10 derkoe

Looks like it, however, I am not able to confirm since I stopped using the init container.

mliker avatar Oct 11 '18 09:10 mliker

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Jan 09 '19 20:01 openshift-bot

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot avatar Feb 09 '19 01:02 openshift-bot

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-bot avatar Mar 11 '19 03:03 openshift-bot

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openshift-ci-robot avatar Mar 11 '19 03:03 openshift-ci-robot