达到k8s pod组的持久卷 [英] Persistent volume atached to k8s pod group

查看:131
本文介绍了达到k8s pod组的持久卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将内部具有prestashop的典型单节点 LAMP堆栈 迁移到Google Cloud Platform上的 kubernetes .

I'm trying to migrate a typical single node LAMP stack with prestashop inside to kubernetes on Google Cloud Platform.

到目前为止,我已经:

  • 将数据库设置为独立的第二代Cloud SQL.
  • 使用Apache和PHP对Docker进行上载并上载了Prestashop的自定义版本.
  • 设置部署部署,包括SQL代理和Ingress以公开服务.

这可行,如果不使部署对磁盘有任何影响的更改变得如此困难(上传产品映像,安装新模块等),我将采用这种方式.

This works, and I would leave it this way if It wouldn't make it so difficult to deploy any changes that have any kind of impact on the disk (uploading product images, installing new modules, etc).

我想将整个 html 文件夹移动到永久卷.我检查了两个选项.

I want to move the whole html folder to a persistent volume. I've checked two options.

  • Google永久磁盘:创建和附加到该磁盘很容易 pods,但需要我将其附加到实例才能进行编辑 它.因此,对于CI来说,这真是一个遗憾.
  • Google云存储(段),它很容易编辑(即使在浏览器中),但是 AFAIK ,则需要使用 GCSFuse 才能将其附加到广告连播. (据我所知,它既慢又处于beta状态.)
  • Google persistent disk: It's easy to create and to attach to the pods, but it requires me to attach it to an instance in order to edit it. So it's kinda a bummer for CI.
  • Google Cloud Storage (segment) it's easy to edit (even from the browser) but AFAIK it requires to use GCSFuse in order to attach it to the pods. (Wich I read is both slow and in a beta state).

我想要一些使用建议,最好具有存储的灵活性和持久性磁盘的本机连接.关于带宽,到目前为止,几乎没有流量进入堆栈,但是以一种体面的方式扩展它会很好. (如果不是,则整个k8s集群是毫无意义的).

I would like some advice on what to use, preferibly with flexibility of the Storage and the native attachement of the persistent disk. Regarding the bandwidth, so far there is little to no traffic to the stack, but it would be nice for it to scale in a decent way. (If not, the whole k8s cluster is kinda pointless).

推荐答案

您可以考虑在html文件夹中使用gitRepo卷:

You may take into consideration the use of gitRepo volume for your html folder:

apiVersion: v1
kind: Pod
metadata:
  name: server
spec:
  containers:
  - image: ...
    name: ...
    volumeMounts:
    - mountPath: /mypath
      name: git-volume
  volumes:
  - name: git-volume
    gitRepo:
      repository: "git@somewhere:me/your-git-repository.git"
      revision: "eef1d8406d464b0c0874075521c1f2e96c253775"

这篇关于达到k8s pod组的持久卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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