Bug 1392189 - MongoDB is not deploying with PVC attached
Summary: MongoDB is not deploying with PVC attached
Keywords:
Status: CLOSED DUPLICATE of bug 1392650
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Templates
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-05 20:24 UTC by Jordi
Modified: 2016-11-15 19:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-15 19:33:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1392650 0 unspecified CLOSED [Preview] Slow provisioning of PVs 2021-02-22 00:41:40 UTC

Internal Links: 1392650

Description Jordi 2016-11-05 20:24:09 UTC
Description of problem:
MongoDB is not deploying if PVC is attached.

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

How reproducible:
Create a MongoDB application using the quick start.

Steps to Reproduce:
1. Create a MongoDB application using the quick start.
2. Wait until PVC is activated.
3. Deploy the MongoDB container.
4. The MongoDB never ends the deploy and returns a timeout.

Actual results:

The MongoDB never ends the deploy and returns a timeout.


Expected results:

MongoDB should be deployed and activated.

Additional info:

If I remove the PVC, it deploys correctly.

Comment 1 Michal Fojtik 2016-11-07 08:22:21 UTC
Ben, what is the correct component for the images?

Comment 2 Michal Fojtik 2016-11-07 08:23:19 UTC
(In reply to Jordi from comment #0)
> Description of problem:
> MongoDB is not deploying if PVC is attached.
> 
> Version-Release number of selected component (if applicable):
> MongoDB 3.2
> 
> How reproducible:
> Create a MongoDB application using the quick start.
> 
> Steps to Reproduce:
> 1. Create a MongoDB application using the quick start.
> 2. Wait until PVC is activated.
> 3. Deploy the MongoDB container.
> 4. The MongoDB never ends the deploy and returns a timeout.
> 
> Actual results:
> 
> The MongoDB never ends the deploy and returns a timeout.
> 
> 
> Expected results:
> 
> MongoDB should be deployed and activated.
> 
> Additional info:
> 
> If I remove the PVC, it deploys correctly.


What PVC do you have attached to Mongo? If it is RWO and you're using the "rolling" strategy that will not work as the PVC can be used only by one pod. In that case you have to switch it to Recreate strategy.

Comment 3 Jordi 2016-11-07 12:55:15 UTC
(In reply to Michal Fojtik from comment #2)
> (In reply to Jordi from comment #0)
> > Description of problem:
> > MongoDB is not deploying if PVC is attached.
> > 
> > Version-Release number of selected component (if applicable):
> > MongoDB 3.2
> > 
> > How reproducible:
> > Create a MongoDB application using the quick start.
> > 
> > Steps to Reproduce:
> > 1. Create a MongoDB application using the quick start.
> > 2. Wait until PVC is activated.
> > 3. Deploy the MongoDB container.
> > 4. The MongoDB never ends the deploy and returns a timeout.
> > 
> > Actual results:
> > 
> > The MongoDB never ends the deploy and returns a timeout.
> > 
> > 
> > Expected results:
> > 
> > MongoDB should be deployed and activated.
> > 
> > Additional info:
> > 
> > If I remove the PVC, it deploys correctly.
> 
> 
> What PVC do you have attached to Mongo? If it is RWO and you're using the
> "rolling" strategy that will not work as the PVC can be used only by one
> pod. In that case you have to switch it to Recreate strategy.

Hi Michal,

Yes, the PVC y RWO type. What do you mean with rolling/recreate strategy? Is here any documentation about it? I simply have deployed the example proyect, without any change.

Thanks for your help!

Comment 4 Jordi 2016-11-07 19:27:19 UTC
This is the PVC information:

oc get pvc
NAME      STATUS    VOLUME         CAPACITY   ACCESSMODES   AGE
mongodb   Bound     pv-aws-hf25u   1Gi        RWO           1d

This is the log of a failed deploy:

--> Scaling mongodb-1 to 1
--> Waiting up to 10m0s for pods in deployment mongodb-1 to become ready
error: update acceptor rejected mongodb-1: pods for deployment "mongodb-1" took longer than 600 seconds to become ready

The PVC is only trying to be used by this deploy, so it is not being used to another pod. This configuration was generated with the template "nodejs-mongodb-example". 

And here the yaml of the last failed deploy:

apiVersion: v1
kind: ReplicationController
metadata:
  name: mongodb-1
  namespace: iknow
  selfLink: /api/v1/namespaces/iknow/replicationcontrollers/mongodb-1
  uid: 3e57308e-a41d-11e6-8c72-0ebeb1070c7f
  resourceVersion: '314045475'
  generation: 3
  creationTimestamp: '2016-11-06T12:33:38Z'
  labels:
    app: nodejs-mongodb-example
    openshift.io/deployment-config.name: mongodb
    template: nodejs-mongodb-example
  annotations:
    kubectl.kubernetes.io/desired-replicas: '1'
    openshift.io/deployer-pod.name: mongodb-1-deploy
    openshift.io/deployment-config.latest-version: '1'
    openshift.io/deployment-config.name: mongodb
    openshift.io/deployment.phase: Failed
    openshift.io/deployment.replicas: '0'
    openshift.io/deployment.status-reason: 'caused by an image change'
    openshift.io/encoded-deployment-config: "{\"kind\":\"DeploymentConfig\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"mongodb\",\"namespace\":\"iknow\",\"selfLink\":\"/oapi/v1/namespaces/iknow/deploymentconfigs/mongodb\",\"uid\":\"3e506c55-a41d-11e6-9ac6-0e3d364e19a5\",\"resourceVersion\":\"314010660\",\"generation\":2,\"creationTimestamp\":\"2016-11-06T12:33:38Z\",\"labels\":{\"app\":\"nodejs-mongodb-example\",\"template\":\"nodejs-mongodb-example\"},\"annotations\":{\"description\":\"Defines how to deploy the database\"}},\"spec\":{\"strategy\":{\"type\":\"Recreate\",\"recreateParams\":{\"timeoutSeconds\":600},\"resources\":{}},\"triggers\":[{\"type\":\"ImageChange\",\"imageChangeParams\":{\"automatic\":true,\"containerNames\":[\"mongodb\"],\"from\":{\"kind\":\"ImageStreamTag\",\"namespace\":\"openshift\",\"name\":\"mongodb:3.2\"},\"lastTriggeredImage\":\"registry.ops.openshift.com/rhscl/mongodb-32-rhel7@sha256:2b8a9d4570d2d466203275e73eab704da5f8f4fbf8ad174c8a834ced6c064f75\"}},{\"type\":\"ConfigChange\"}],\"replicas\":1,\"test\":false,\"selector\":{\"name\":\"mongodb\"},\"template\":{\"metadata\":{\"name\":\"mongodb\",\"creationTimestamp\":null,\"labels\":{\"name\":\"mongodb\"}},\"spec\":{\"volumes\":[{\"name\":\"mongodb-data\",\"persistentVolumeClaim\":{\"claimName\":\"mongodb\"}}],\"containers\":[{\"name\":\"mongodb\",\"image\":\"registry.ops.openshift.com/rhscl/mongodb-32-rhel7@sha256:2b8a9d4570d2d466203275e73eab704da5f8f4fbf8ad174c8a834ced6c064f75\",\"ports\":[{\"containerPort\":27017,\"protocol\":\"TCP\"}],\"env\":[{\"name\":\"MONGODB_USER\",\"value\":\"userRAF\"},{\"name\":\"MONGODB_PASSWORD\",\"value\":\"ka3DQmDyofylmPIq\"},{\"name\":\"MONGODB_DATABASE\",\"value\":\"sampledb\"},{\"name\":\"MONGODB_ADMIN_PASSWORD\",\"value\":\"DDe4qV7F2vySALQA\"}],\"resources\":{\"limits\":{\"memory\":\"512Mi\"}},\"volumeMounts\":[{\"name\":\"mongodb-data\",\"mountPath\":\"/var/lib/mongodb/data\"}],\"livenessProbe\":{\"tcpSocket\":{\"port\":27017},\"initialDelaySeconds\":30,\"timeoutSeconds\":1,\"periodSeconds\":10,\"successThreshold\":1,\"failureThreshold\":3},\"readinessProbe\":{\"exec\":{\"command\":[\"/bin/sh\",\"-i\",\"-c\",\"mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\\\"quit()\\\"\"]},\"initialDelaySeconds\":3,\"timeoutSeconds\":1,\"periodSeconds\":10,\"successThreshold\":1,\"failureThreshold\":3},\"terminationMessagePath\":\"/dev/termination-log\",\"imagePullPolicy\":\"Always\"}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":30,\"dnsPolicy\":\"ClusterFirst\",\"securityContext\":{}}}},\"status\":{\"latestVersion\":1,\"observedGeneration\":2,\"details\":{\"message\":\"caused by an image change\",\"causes\":[{\"type\":\"ImageChange\",\"imageTrigger\":{\"from\":{\"kind\":\"ImageStreamTag\",\"namespace\":\"openshift\",\"name\":\"mongodb:3.2\"}}}]}}}\n"
spec:
  replicas: 0
  selector:
    deployment: mongodb-1
    deploymentconfig: mongodb
    name: mongodb
  template:
    metadata:
      creationTimestamp: null
      labels:
        deployment: mongodb-1
        deploymentconfig: mongodb
        name: mongodb
      annotations:
        openshift.io/deployment-config.latest-version: '1'
        openshift.io/deployment-config.name: mongodb
        openshift.io/deployment.name: mongodb-1
    spec:
      volumes:
        -
          name: mongodb-data
          persistentVolumeClaim:
            claimName: mongodb
      containers:
        -
          name: mongodb
          image: 'registry.ops.openshift.com/rhscl/mongodb-32-rhel7@sha256:2b8a9d4570d2d466203275e73eab704da5f8f4fbf8ad174c8a834ced6c064f75'
          ports:
            -
              containerPort: 27017
              protocol: TCP
          env:
            -
              name: MONGODB_USER
              value: userRAF
            -
              name: MONGODB_PASSWORD
              value: ka3DQmDyofylmPIq
            -
              name: MONGODB_DATABASE
              value: sampledb
            -
              name: MONGODB_ADMIN_PASSWORD
              value: DDe4qV7F2vySALQA
          resources:
            limits:
              memory: 512Mi
          volumeMounts:
            -
              name: mongodb-data
              mountPath: /var/lib/mongodb/data
          livenessProbe:
            tcpSocket:
              port: 27017
            initialDelaySeconds: 30
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            exec:
              command: [/bin/sh, '-i', '-c', 'mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval="quit()"']
            initialDelaySeconds: 3
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext:
status:
  replicas: 0
  observedGeneration: 3
causes:
  -
    type: ImageChange
    imageTrigger:
      from:
        kind: ImageStreamTag
        namespace: openshift
        name: 'mongodb:3.2'


Do you need more information?

Comment 5 Jordi 2016-11-08 14:59:42 UTC
Is this problem related with the alert in the Openshift Web Console?
"Investigating - We notice that there is an issue when create persistent volumes"

Comment 6 Michal Fojtik 2016-11-08 15:11:36 UTC
I think this is a duplicate of: https://bugzilla.redhat.com/show_bug.cgi?id=1392650

(or at least the symptoms are looking the same).

Comment 7 Abhishek Gupta 2016-11-15 19:33:52 UTC
Marking this bug a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1392650 as that bug has a lot of debugging information captured.

*** This bug has been marked as a duplicate of bug 1392650 ***


Note You need to log in before you can comment on or make changes to this bug.