如何使一个持久卷可访问多个Kubernetes Pod? [英] How Do I Make A Persistent Volume Accessible to Multiple Kubernetes Pods?

查看:49
本文介绍了如何使一个持久卷可访问多个Kubernetes Pod?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了很多研究,但还没有找到答案.这是我要完成的工作:

I've done quite a bit of research and have yet to find an answer to this. Here's what I'm trying to accomplish:

  • 我有一个ELK堆栈容器在GCE中的k8s集群上的容器中运行-集群还包含一个PersistentVolume(格式:ext4)和一个PersistentVolumeClaim.
  • 为了将ELK堆栈扩展到多个Pod/节点并在ElasticSearch中保留持久数据,我要么需要将所有Pod都写入同一PV(使用ES文件系统的节点/索引结构),要么一些体积逻辑以扩大/创建这些PV/PVC.
  • 当前发生的情况是,如果我在复制控制器上旋转第二个Pod,它将无法安装PV.

因此,我想知道是否要以错误的方式进行操作,而当我的集群/节点自动扩展时,构造此解决方案以允许ES中的持久性数据的最佳方法是什么?

So I'm wondering if I'm going about this the wrong way, and what is the best way to architect this solution to allow for persistent data in ES when my cluster/nodes autoscale.

推荐答案

持久卷具有访问语义.在GCE上,我假设您使用的是永久磁盘,可以将其可写地安装到单个Pod上,也可以以只读方式安装到多个Pod上.如果要使用多作者语义,则需要设置Nfs或其他一些存储,以便您从多个Pod中进行书写.

Persistent Volumes have access semantics. on GCE I'm assuming you are using a Persistent Disk, which can either be mounted as writable to a single pod or to multiple pods as read-only. If you want multi writer semantics, you need to setup Nfs or some other storage that let's you write from multiple pods.

如果您有兴趣运行NFS- https://github.com/kubernetes/kubernetes/blob/release-1.2/examples/nfs/README.md

In case you are interested in running NFS - https://github.com/kubernetes/kubernetes/blob/release-1.2/examples/nfs/README.md

仅供参考:在您扩展部署时,我们仍在努力支持PV的自动配置.到目前为止,这是一个手动过程.

FYI: We are still working on supporting auto-provisioning of PVs as you scale your deployment. As of now it is a manual process.

这篇关于如何使一个持久卷可访问多个Kubernetes Pod?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆