本文介绍了在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?

推荐答案

可以在 Kubernetes 1.12 (2018年第3季度)和可感知拓扑的动态配置(现已提供测试版).
这意味着存储资源现在可以了解它们的位置.
这还包括对AWS EBS和GCE PD的beta支持.

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 及其文档PR 9939 (提交e1e6555 )

请参见存储/存储类/卷绑定模式(K8s 1.12中的Beta版)

See Storage / Storage Classes / Volume Binding Mode (beta in K8s 1.12)

允许的拓扑是如何限制拓扑到特定区域的预配置卷的数量.

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中部署特定的卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-01 13:34