kubernetes - 带有 directoryOrCreate 的 Kubernetes hostPath 不起作用
问题描述
我正在尝试创建一个hostPath
用于卷的简单 pod。
设置非常简单:
apiVersion: apps/v1
kind: DaemonSet
...
spec:
template:
spec:
containers:
- name: test
...
volumeMounts:
- name: mntdatas3fs
mountPath: /var/s3:shared
...
volumes:
- name: devfuse
hostPath:
path: /dev/fuse
- name: mntdatas3fs
hostPath:
path: "/mnt/s3bucket/my_backet"
type: DirectoryOrCreate
在第一次运行时 - 一切正常,目录按应有的方式创建。
但是如果我删除这个 pod 并重新创建它,它将无法运行并出现以下错误:
Error: failed to start container "storage-mount": Error response from daemon: error while creating mount source path '/mnt/s3bucket/my_backet': mkdir /mnt/s3bucket/my_backet: file exists
解决方案
推荐阅读
- julia - Closure, anonymous function, why not being the values when they were created
- docker - 使用 Dockerfile 安装的依赖项在后续管道步骤中无法访问。如何启用?
- json - 如何使用 Circe 将空对象插入 JSON?
- c++ - libc++ 的 std::is_literal_type 是如何工作的?
- tensorflow - Tensorflow: Modify datapoints used in loss function evaluation after each gradient step using tf optimizer
- angular - How to use gzipper package in angular 7?
- javascript - 如何在不使用 ajax 硬刷新的情况下多次发出请求
- python - 生成字符串列表的所有排列
- javascript - 文件读取永远不会完成
- javascript - 按“提交”按钮1次,有几次进入循环