kubernetes - 从 Kubernetes 中的快照创建 Google 永久性磁盘
问题描述
我需要在 Kubernetes 中具有非常大(700GB)只读数据集的多个节点上运行 pod。我尝试使用 readonlymany,但它在多节点设置中失败,而且通常非常不稳定。
pod 有没有办法从快照创建一个新的永久磁盘,将其附加到 pod,并在 pod 被销毁时将其销毁?这将允许我偶尔使用新数据更新快照。
解决方案
您可以使用 GCP 上的现有映像手动配置永久性磁盘:
gcloud beta compute disks create --size=500GB --image=<snapshot-name> my-data-disk
然后在你的 pod 上使用它:
apiVersion: v1
kind: Pod
metadata:
name: test-pd
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: test-container
volumeMounts:
- mountPath: /test-pd
name: test-volume
volumes:
- name: test-volume
# This GCE PD must already exist.
gcePersistentDisk:
pdName: my-data-disk
fsType: ext4
GCE 存储类不支持快照,所以很遗憾,你不能用 PVC 来做。更多信息在这里
希望能帮助到你。
推荐阅读
- python-2.7 - 如何从python中的特定json格式中获取价值
- input - 如何有效地检查和评估用户输入?
- android - 如何将文本视图放在按钮后面?
- sql - 向行添加偏移量以获得单调递增的值
- html - 在 Angular 中添加规则失败
- python - pandas (horizontal) 堆积条形图,按条形分段排序
- angularjs - Angularjs $filter 不适用于 uglify
- c++ - 如何更改 QStackedBarSeries 中单个 QBarSet 的宽度?
- css - 背景项目周围的“透明”边框
- sql - Postgresql:附加两个具有不同列的表