Bug 1386482

Summary: gitserver-persistent template failed to redoploy using the default rolling deploy strategy
Product: OKD Reporter: shiyang.wang <shiywang>
Component: ImageAssignee: Cesar Wong <cewong>
Status: CLOSED CURRENTRELEASE QA Contact: Dongbo Yan <dyan>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, mmccomas, wsun, xiuwang
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-11-10 21:34:25 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:

Description shiyang.wang 2016-10-19 05:20:23 UTC
Description of problem:
After deploy, pvc bound to a pv, and the pod started and mount that pv, after redeploy ,default rolling deploy strategy will start new pod first, but the new pod cannot use the pv, because it is already used by old pod,so the new pod failed to start, we should use recreate strategy here. like what mongodb-persistent template do here:https://github.com/openshift/origin/blob/master/examples/db-templates/mongodb-persistent-template.json#L66

Version-Release number of selected component (if applicable):

oc v3.3.1.2
kubernetes v1.3.0+52492b4
features: Basic-Auth GSSAPI Kerberos SPNEGO
openshift v3.3.1.2



How reproducible:
Always

Steps to Reproduce:
1.oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/gitserver/gitserver-persistent.yaml

2. oc patch pvc/git -p '{"metadata":{"annotations":{"volume.alpha.kubernetes.io/storage-class":"foo"}}} '

3.oc deploy dc/git --latest

Actual results:
git-2 deploy pending 

[root@qe-share-master-etcd-1 ~]# oc describe pod/git-2-129na
Name:			git-2-129na
Namespace:		sstest
Security Policy:	restricted
Node:			qe-share-node-registry-router-etcd-2/10.240.0.5
Start Time:		Tue, 18 Oct 2016 22:08:09 -0400
Labels:			deployment=git-2
			deploymentconfig=git
			run-container=git
Status:			Pending
IP:			
Controllers:		ReplicationController/git-2
Containers:
  git:
    Container ID:	
    Image:		openshift/origin-gitserver:latest
    Image ID:		
    Port:		8080/TCP
    State:		Waiting
      Reason:		ContainerCreating
    Ready:		False
    Restart Count:	0
    Readiness:		http-get http://:8080/_/healthz delay=0s timeout=1s period=10s #success=1 #failure=3
    Volume Mounts:
      /var/lib/git from git-data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from git-token-7kc9i (ro)
    Environment Variables:
      POD_NAMESPACE:		sstest (v1:metadata.namespace)
      PUBLIC_URL:		http://git.$(POD_NAMESPACE).svc.cluster.local:8080
      INTERNAL_URL:		http://git:8080
      GIT_HOME:			/var/lib/git
      HOOK_PATH:		/var/lib/git-hooks
      GENERATE_ARTIFACTS:	true
      BUILD_STRATEGY:		
      DETECTION_SCRIPT:		
      ALLOW_GIT_PUSH:		true
      ALLOW_GIT_HOOKS:		true
      ALLOW_LAZY_CREATE:	true
      ALLOW_ANON_GIT_PULL:	true
      REQUIRE_SERVER_AUTH:	-
      AUTH_NAMESPACE:		$(POD_NAMESPACE)
      REQUIRE_GIT_AUTH:		
      AUTOLINK_KUBECONFIG:	-
      AUTOLINK_NAMESPACE:	$(POD_NAMESPACE)
      AUTOLINK_HOOK:		
Conditions:
  Type		Status
  Initialized 	True 
  Ready 	False 
  PodScheduled 	True 
Volumes:
  git-data:
    Type:	PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:	git
    ReadOnly:	false
  git-token-7kc9i:
    Type:	Secret (a volume populated by a Secret)
    SecretName:	git-token-7kc9i
QoS Tier:	BestEffort
Events:
  FirstSeen	LastSeen	Count	From						SubobjectPath	Type	Reason		Message
  ---------	--------	-----	----						-------------	--------------		-------
  8m		8m		1	{default-scheduler }						Normal	Scheduled	Successfully assigned git-2-129na to qe-share-node-registry-router-etcd-2
  6m		6s		4	{kubelet qe-share-node-registry-router-etcd-2}			Warning	FailedMount	Unable to mount volumes for pod "git-2-129na_sstest(e1b964bc-95a0-11e6-bdcd-42010af00003)": timeout expired waiting for volumes to attach/mount for pod "git-2-129na"/"sstest". list of unattached/unmounted volumes=[git-data]
  6m		6s		4	{kubelet qe-share-node-registry-router-etcd-2}			Warning	FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "git-2-129na"/"sstest". list of unattached/unmounted volumes=[git-data]


Expected results:
git-1 scale down and git-2 scale up deploy success

Additional info:

Comment 1 shiyang.wang 2016-10-19 05:23:07 UTC
here is the pr to fix template :https://github.com/openshift/origin/pull/11432

Comment 2 XiuJuan Wang 2017-10-12 03:13:10 UTC
This issue has been fixed with latest gitserver-persistent template.