Bug 1453180

Summary: Init container State should not be "Running" when pod is failed
Product: OpenShift Container Platform Reporter: Weihua Meng <wmeng>
Component: NodeAssignee: Seth Jennings <sjenning>
Status: CLOSED ERRATA QA Contact: Weihua Meng <wmeng>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, decarr, jokerman, mmccomas, smunilla
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-10 05:25:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Weihua Meng 2017-05-22 10:31:15 UTC
Description of problem:
Init container State should not be "Running" when pod is failed

Version-Release number of selected component (if applicable):
openshift v3.6.77
kubernetes v1.6.1+5115d708d7

How reproducible:
Always

Steps to Reproduce:
1. create a pod having active-deadline with initcontainer.
# cat pod-init-containers-deadline.yaml
apiVersion: v1
kind: Pod
metadata:
  name: init-deadline
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80
    volumeMounts:
    - name: workdir
      mountPath: /usr/share/nginx/html
  initContainers:
  - name: init
    image: centos:centos7
    command:
    - /bin/sh
    - "-c"
    - "sleep 30"
  activeDeadlineSeconds: 15
  volumes:
  - name: workdir
    emptyDir: {}

2. check the pod info when DeadlineExceeded
$ oc describe po/init-deadline


Actual results:
2. 
Name:			init-deadline
Namespace:		wmeng2
Security Policy:	restricted
Node:			ip-172-31-9-167.ec2.internal/
Start Time:		Mon, 22 May 2017 18:07:35 +0800
Labels:			<none>
Annotations:		kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"init-deadline","namespace":"wmeng2"},"spec":{"activeDeadlineSeconds":15,"container...
			kubernetes.io/limit-ranger=LimitRanger plugin set: cpu, memory request for container nginx; cpu, memory limit for container nginx; cpu, memory request for init container init; cpu, memory limit for in...
			openshift.io/scc=restricted
Status:			Failed
Reason:			DeadlineExceeded
Message:		Pod was active on the node longer than the specified deadline
IP:			
Controllers:		<none>
Init Containers:
  init:
    Container ID:	docker://711a32913cf18f6b9ea8e18aa042567169b921b20ce06a5a504db305c452ea71
    Image:		centos:centos7
    Image ID:		docker-pullable://docker.io/centos@sha256:bba1de7c9d900a898e3cadbae040dfe8a633c06bc104a0df76ae24483e03c077
    Port:		
    Command:
      /bin/sh
      -c
      sleep 30
    State:		Running
      Started:		Mon, 22 May 2017 18:07:39 +0800
    Ready:		False
    Restart Count:	0
<---snip--->
 
Expected results:
Init container state should be failed

Additional info:

Comment 1 Seth Jennings 2017-05-22 21:30:18 UTC
*** Bug 1453187 has been marked as a duplicate of this bug. ***

Comment 2 Seth Jennings 2017-05-23 20:45:11 UTC
Kube PR:
https://github.com/kubernetes/kubernetes/pull/46305

Comment 3 Seth Jennings 2017-05-24 20:20:10 UTC
Origin PR:
https://github.com/openshift/origin/pull/14331

Comment 5 Weihua Meng 2017-06-05 08:21:12 UTC
Verified on openshift v3.6.94
Fixed.

Comment 7 errata-xmlrpc 2017-08-10 05:25:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1716