gpt4 book ai didi

kubernetes - 用于 Kubernetes Volume 的 DigitalOcean block 存储

转载 作者:行者123 更新时间:2023-12-04 21:06:50 24 4
gpt4 key购买 nike

我有一个在 DigitalOcean 上运行的 K8S 集群。我在那里运行了一个 Postgresql 数据库,我想使用 DigitalOcean BlockStorage 创建一个卷,以供 Postgresql pod 用作卷。有没有关于如何做到这一点的例子?

如果不能使用 DigitalOcean 块存储,那么大多数公司如何运行他们的数据库持久性存储?

最佳答案

还没有官方支持。你可以试试 this github issue 中某人的例子:

Update: I finished writing a volume plugin for digitalocean. Attach/detach is working on my cluster. Looking for anyone willing to test this on their k8s digitalocean cluster. My branch is https://github.com/wardviaene/kubernetes/tree/do-volume

You can use the following spec in your pod yml:

spec:
containers:
- name: k8s-demo
image: yourimage
volumeMounts:
- mountPath: /myvol
name: myvolume
ports:
- containerPort: 3000
volumes:
- name: myvolume
digitaloceanVolume:
volumeID: mykubvolume
fsType: ext4 Where mykubvolume is the volume created in DigitalOcean in the same region.

You will need to add create a config file:

[Global] apikey = do-api-key region = your-region and add these parameters to your kubernetes processes: --cloud-provider=digitalocean --cloud-config=/etc/cloud.config

I'm still waiting for an issue in the godo driver to be resolved, before I can submit a PR (digitalocean/godo#102)

关于kubernetes - 用于 Kubernetes Volume 的 DigitalOcean block 存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43530747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com