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″.

  • Vagrant box and Docker provider: Titan and Kafka
  • Confused about multiple different containers using a single data volume containers [closed]
  • Issue with running RabbitMQ in Python using Pika inside Docker container
  • change docker containers IP address
  • Automate service (couchbase) configuration of a docker container
  • fatal: destination path '/home/ipy/ipynotebooks/soccer' already exists and is not an empty directory
  • /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!

  • Go+MySql: how easy is to migrate to GKE (Google Cloud Container Engine)?
  • How to connect usb wireless interface to a Docker container on Mac OSX?
  • Docker cannot pull any image
  • Start supervisor by non root user
  • How start docker container with specific veth pair name
  • How to expose Docker volumes to my local machine using KiteMatic interface
  • 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.