| Summary: | MongoDB is not deploying with PVC attached | ||
|---|---|---|---|
| Product: | OpenShift Online | Reporter: | Jordi <jordiszrz> |
| Component: | Templates | Assignee: | Abhishek Gupta <abhgupta> |
| Status: | CLOSED DUPLICATE | QA Contact: | XiuJuan Wang <xiuwang> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.x | CC: | aos-bugs, jokerman, jordiszrz, mfojtik, mmccomas |
| 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: | 2016-11-15 19:33:52 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
Jordi
2016-11-05 20:24:09 UTC
Ben, what is the correct component for the images? (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. (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! 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?
Is this problem related with the alert in the Openshift Web Console? "Investigating - We notice that there is an issue when create persistent volumes" 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). 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 *** |