[英]How to share volume of my google cloud instance with the kubernetes cluster
I am working on a design where I will have my git repository located at one of the google cloud instance. 我正在进行一项设计,我将把我的git存储库放在google云实例之一。 I am trying to run my tests in parallel using kubernetes cluster.
我正在尝试使用kubernetes集群并行运行我的测试。 However I am not able to share the Standard persistent disk(which is having the github repository) that is configured to my instance with the kubernetes cluster.
但是,我无法共享使用kubernetes集群配置到我的实例的标准持久性磁盘(具有github存储库)。 I need my containers to work on the repository that is located in the instance and don't want to create copies of it in cluster instances.
我需要我的容器在位于实例中的存储库上工作,并且不希望在集群实例中创建它的副本。
I have achieved the same thing using docker on a vm but now I would like to put everything on the cloud and run it in a containerised environment. 我在vm上使用docker实现了同样的功能,但现在我想将所有内容放在云上并在容器化环境中运行。
You need to create a persistant volume and then mount that pv to the kubernetes pod. 您需要创建一个持久卷,然后将该pv安装到kubernetes pod。
You should note that this will be read only as you cant attach multiple containers to write to a persistent disk - if you want RW then you will need to use NFS/Gluster or more sensibly GCR. 您应该注意,只有当您无法连接多个容器以写入永久磁盘时才会读取此内容 - 如果您需要RW,则需要使用NFS / Gluster或更明智的GCR。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.