Hide Forgot
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:
here is the pr to fix template :https://github.com/openshift/origin/pull/11432
This issue has been fixed with latest gitserver-persistent template.