以只读模式安装GDE磁盘时为NoDiskConflict

时间:2015-08-26 12:07:02

标签: google-compute-engine kubernetes google-kubernetes-engine

正如之前报道的here两个广告连播不能安装相同的磁盘,即使其中一个尝试以只读模式

这应该是从Kubernetes文档中允许的。

安装方案是:

  • UniqueCluster / Pod A 已成功将gdeDisk1挂载为读写
  • 将gdeDisk1挂载为只读时,UniqueCluster / Pod B 无法启动

节点描述:

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

1 个答案:

答案 0 :(得分:1)

根据GCE persistent disk documentation:"如果您将永久磁盘附加到多个实例,则所有实例都必须以只读模式附加永久磁盘。"

Kubernetes documentation for GCE PD volumes也解释了这个限制:" PD的一个特点是它们可以同时由多个消费者以只读方式挂载。这意味着您可以使用数据集预先填充PD,然后根据需要从多个pod中并行提供。不幸的是,PD只能由一个消费者以读写模式安装 - 不允许同时读取。"