NoDiskConflict when mounting GDE disk in read-only mode

8/26/2015

As previously reported here, two pods can't mount the same disk even though one of them tries to do it as read-only mode.

This is supposed to be allowed from Kubernetes documentation.

Mounting scheme is:

  • UniqueCluster/PodA has successfully mounted gdeDisk1 as read-write
  • UniqueCluster/PodB fails to start when mounting gdeDisk1 as read-only

Node description:

Name:           gke-zupcat-cluster-8fd35d81-node-1zr4
Labels:         kubernetes.io/hostname=gke-zupcat-cluster-8fd35d81-node-1zr4
CreationTimestamp:  Wed, 22 Jul 2015 14:47:56 -0300
Conditions:
  Type      Status  LastHeartbeatTime           LastTransitionTime   Reason                      Message
Ready     True    Thu, 23 Jul 2015 12:06:18 -0300     Wed, 22 Jul 2015 22:53:34 -0300     kubelet is posting ready status     
Addresses:  10.240.17.72,146.148.79.174
Capacity:
 cpu:       2
memory:    7679608Ki
pods:      40
Version:
  Kernel Version:        3.16.0-0.bpo.4-amd64
  OS Image:          Debian GNU/Linux 7 (wheezy)
Container Runtime Version: docker://Unknown
Kubelet Version:       v1.0.1
Kube-Proxy Version:        v1.0.1
PodCIDR:            10.108.0.0/24
ExternalID:         11953122931827361742
Pods:               (5 in total)
Namespace         Name
 default           fastrwdiskpod-yu517
 kube-system           fluentd-cloud-logging-gke-zupcat-cluster-8fd35d81-        node-1zr4
 kube-system           kube-dns-v8-i3h20
 kube-system           kube-ui-v1-8zdrq
 kube-system           monitoring-heapster-v5-e1zmi
 No events.

Products versions:

Client Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.0", GitCommit:"cd821444dcf3e1e237b5f3579721440624c9c4fa", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.1", GitCommit:"6a5c06e3d1eb27a6310a09270e4a5fb1afa93e74", GitTreeState:"clean"}
docker version Docker version 1.7.1, build 786b29d
-- Hernan
google-compute-engine
google-kubernetes-engine
kubernetes

1 Answer

8/26/2015

According to the GCE persistent disk documentation: "if you attach a persistent disk to multiple instances, all instances must attach the persistent disk in read-only mode."

The Kubernetes documentation for GCE PD volumes also explains this limitation: "A feature of PD is that they can be mounted as read-only by multiple consumers simultaneously. This means that you can pre-populate a PD with your dataset and then serve it in parallel from as many pods as you need. Unfortunately, PDs can only be mounted by a single consumer in read-write mode - no simultaneous readers allowed."

-- Robert Bailey
Source: StackOverflow