kubernetes - 删除 pod 后 kubernetes pod 无法挂载 gcloud 持久化磁盘
问题描述
我有一个带有 gcloud 持久性磁盘的工作 redis pod。有时在删除 pod 时会抛出以下错误:
AttachVolume.Attach failed for volume "redis-volume" : GCE persistent disk not found: diskName="redis-volume" zone="europe-west3-c"
如果删除 pod 失败,请再次解决问题 - 但这不是一个问题。
使用以下 Kubernetes 配置:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:3.2-alpine
imagePullPolicy: Always
args: ["--requirepass", "password", "--appendonly", "yes", "--save", "900", "1", "--save", "30", "1"]
ports:
- containerPort: 6379
name: redis
env:
volumeMounts:
- name: redis-volume
mountPath: /data
volumes:
- name: redis-volume
gcePersistentDisk:
pdName: redis-volume
fsType: ext4
有没有人遇到过这个问题?
解决方案
在将持久卷与持久卷声明分开后,我遇到了同样的问题。
推荐阅读
- java - Map becomes null
- java - 嵌套布局崩溃
- unity3d - 在 Unity 中使用 Unet 更改 GameObjects 上的材质
- android - 如何在 WebView 中获取位置
- bash - 使用awk根据不同列中前一行的值和同一列的当前行生成新列
- javascript - N体重力/太阳系Javascript模拟
- r - 数据变异的查找函数
- javascript - 如何验证2个加拿大邮政编码之间的距离
- python - 在正交投影中使用 cartopy 绘制圆
- python - CalDAV 仅使用“X-MOZ-FAKED-MASTER”响应雷鸟事件,而不是真正的事件