Kubernetes pod not binding volumes to container

I’ve got the following ReplicationController JSON defined:

  "id": "PHPController",
  "kind": "ReplicationController",
  "apiVersion": "v1beta1",
  "desiredState": {
    "replicas": 2,
    "replicaSelector": {"name": "php"},
    "podTemplate": {
      "desiredState": {
         "manifest": {
           "version": "v1beta1",
           "id": "PHPController",
           "volumes": [{ "name": "wordpress", "path": "/mnt/nfs/wordpress_a", "hostDir": "/mnt/nfs/wordpress_a"}],
           "containers": [{
             "name": "php",
             "image": "internaluser/php53",
             "ports": [{"containerPort": 80, "hostPort": 9021}],
             "volumeMounts": [{"name": "wordpress", "mountPath": "/mnt/nfs/wordpress_a"}]
       "labels": {"name": "php"}
  "labels": {"name": "php"} 


The container starts correctly when run with “docker run -t -i -p -v /mnt/nfs/wordpress_a:/mnt/nfs/wordpress_a:rw internaluser/php53″.

  • Docker Hub Private Repo Login. More secure way?
  • Privileges in an Ubuntu Docker container after USER statement in Dockerfile
  • Unable to locate package language-pack-en
  • how to import a file as a parameter in Docker?
  • Deploying with Docker into production: Zero downtime
  • Docker container linking via port forwarding?
  • /mnt/nfs/wordpress_a is an NFS share, mounted on all of the minions. Each minion has full RW access and I have verified that the share is present.

    After creating the pod containers with the Replication Controller, I can see that the volume was never actually bound, and/or incorrectly mounted:

        "Volumes": {
            "/mnt/nfs/wordpress_a": "/var/lib/docker/vfs/dir/8b5dc8477958f5c1b894e68ab9412b41e81a34ef16dac81f0f9d4884352a90b7"
        "VolumesRW": {
            "/mnt/nfs/wordpress_a": true
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LxcConf": null,
            "Privileged": false,
            "PortBindings": {
                "80/tcp": [
                        "HostIp": "",
                        "HostPort": "9021"

    I find it strange that the container believes /mnt/nfs/wordpress_a is mapped to “/var/lib/docker/vfs/dir/8b5dc8477958f5c1b894e68ab9412b41e81a34ef16dac81f0f9d4884352a90b7”.

    From the kubelet log:

    Desired []: [{Namespace:etcd Name:c823da9e-4437-11e4-a3b1-0050568421eb Manifest:{Version:v1beta1 ID:c823da9e-4437-11e4-a3b1-0050568421eb UUID:c823da9e-4437-11e4-a3b1-0050568421eb Volumes:[{Name:wordpress Source:}] Containers:[{Name:php Image:internaluser/php53 Command:[] WorkingDir: Ports:[{Name: HostPort:9021 ContainerPort:80 Protocol:TCP HostIP:}] Env:[{Name:SERVICE_HOST Value:}] Memory:0 CPU:0 VolumeMounts:[{Name:wordpress ReadOnly:false MountPath:/mnt/nfs/wordpress_a}] LivenessProbe: Lifecycle: Privileged:false}] RestartPolicy:{Always:0xa99a20 OnFailure: Never:}}}]

    Does anyone have experience with this sort of thing? I’ve been driving myself crazy troubleshooting this. Thanks!

  • Extend docker devicemapper loop-lvm sparse file
  • Link docker container with host
  • sudo: docker-compose: command not found
  • DC/OS and concurrent deployments
  • How to edit Docker container files from the host?
  • Why don't my udev rules work inside of a running docker container?
  • One Solution collect form web for “Kubernetes pod not binding volumes to container”

    Solved. The volumes syntax was incorrect.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.