在Kubernetes中部署特定的卷 [英] Deployment specific volumes in Kubernetes
问题描述
是否可以创建一个在部署中的所有Pod之间共享但无法挂载到其他Pod的卷?
Is it possible to create a volume that is shared between all pods in a deployment but impossible to mount for any other pod?
或者是从一个部署中读取/写入,而从任何其他Pod中读取?
Alternatively that is read/write from one deployment and just read from any other pod?
推荐答案
That could be addressed in Kubernetes 1.12 (Q3 2018) with Topology aware dynamic provisioning, which is now in beta.
That means storage resources can now understand where they live.
This also includes beta support to AWS EBS and GCE PD.
请参见 kubernetes/feature 561 及其提交e1e6555 )
请参见存储/存储类/卷绑定模式(K8s 1.12中的Beta版)
See Storage / Storage Classes / Volume Binding Mode (beta in K8s 1.12)
默认情况下,
Immediate
模式指示一旦创建PersistentVolumeClaim
,就会发生卷绑定和动态预配置. 对于拓扑受限且无法从群集中的所有节点全局访问的存储后端,PersistentVolumes
将被绑定或置备,而无需了解Pod的调度要求.这可能会导致计划外的Pod.
By default, the
Immediate
mode indicates that volume binding and dynamic provisioning occurs once thePersistentVolumeClaim
is created. For storage backends that are topology-constrained and not globally accessible from all Nodes in the cluster,PersistentVolumes
will be bound or provisioned without knowledge of the Pod’s scheduling requirements. This may result in unschedulable Pods.
允许的拓扑是如何限制拓扑到特定区域的预配置卷的数量.
Allowed Topologies is how to restrict the topology of provisioned volumes to specific zones.
allowedTopologies:
- matchLabelExpressions:
- key: failure-domain.beta.kubernetes.io/zone
values:
- us-central1-a
- us-central1-b
这篇关于在Kubernetes中部署特定的卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!