Red Hat Bugzilla – Bug 1315956
The automatic docker volume provisioning cannot be prevented
Last modified: 2016-05-12 13:10:54 EDT
Description of problem:
To create a new Mongodb app which has the VOLUME directive but the pod spec does not include any corresponding volume, Docker will provision volume directories automatically within /var/lib/docker/volumes.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Has the environment properly configured in AWS(devenv-rhel7_3655)
2.Create a project
oc new-project projectname
3.Create a new Mongodb app with the template http://pastebin.test.redhat.com/355069 which has no "volumeMounts"
oc new-app --file=(template in pastebin)
4. Check the mongodb pod status
oc get pods
5. Check the directory /var/lib/docker/volumes/ to verify whether Docker provision volume directories automatically
The mongodb pod running well and there is a new directory under /var/lib/docker/volumes/ which is created for Mongodb automatically by docker
The mongodb pod should fail to start with the preventing of create directory under /var/lib/docker/volumes/
I'm almost certain this is the result of the immutable bit not being set on the /var/lib/docker/volumes directory. I requested that Ops modify the deployment scripts for Online nodes to include the appropriate chattr command to accomplish this. I can think of several reasons why the command would be failing:
- The command never made it into the deployment scripts. Entirely possible I contacted the wrong person when I requested it be added.
- The command is placed incorrectly in the deployment script. The /var/lib/docker/volumes directory must exist in order for the command to work - therefore, it has to be run after Docker is started for the first time, or the directory needs to be manually created prior to running it
- The deployment scripts for release and QE differ, and the changes aren't in the QE scripts. I'm not at all familiar with the way that Online AWS deployments happen, so I can't rule this out.
I'm contacting Ops to look into getting this fixed.
This issue is fixed on below version:
Docker 1.8.2-el7, build a01dc02/1.8.2
But still repro on origin(devenv-rhel7_3734):
The configuration to set the immutable bit on the /var/lib/docker/volumes directory is only applied to the dev-preview-int custer. You should not expect it to be applied on a regular origin devenv.
Marking this bug ON_QA based on comment above that this issue is now resolved in Dev Preview INT.
This issue is fixed on dev-preview-int, change the status to verified.