以只读模式挂载 GDE 磁盘时出现 NoDiskConflict

NoDiskConflict when mounting GDE disk in read-only mode

如前所述here两个pods无法装载同一个磁盘,即使其中一个试图以只读模式进行装载.

Kubernetes 文档应该允许这样做。

安装方案是:

节点描述:

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.

产品版本:

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

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

Kubernetes documentation for GCE PD volumes 也解释了这个限制:"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."