kubernetes - Kubernetes 中 OrientDB 的 StatefulSet 卷挂载
问题描述
我正在尝试使用 Kubernetes(特别是 minikube)部署一个 OreintDB 集群。我正在使用 StatefulSet,但是,当我在所有 OrientDB 集群配置的 volumeMounts 声明中使用子路径时,不会创建 Pod。虽然我想将所有 configMaps 挂载到一个文件夹中。ConfigMap 对应于设置 OrientDB 集群所需的多个配置文件。
StatefulSet 看起来像这样:
volumeMounts:
- name: orientdb-config-backups
mountPath: /orientdb/config
subPath: backups
- name: orientdb-config-events
mountPath: /orientdb/config
subPath: events
- name: orientdb-config-distributed
mountPath: /orientdb/config
subPath: distributed
- name: orientdb-config-hazelcast
mountPath: /orientdb/config
subPath: hazelcast
- name: orientdb-config-server
mountPath: /orientdb/config
subPath: server
- name: orientdb-config-client-logs
mountPath: /orientdb/config
subPath: client-logs
- name: orientdb-config-server-logs
mountPath: /orientdb/config
subPath: server-log
- name: orientdb-databases
mountPath: /orientdb/databases
- name: orientdb-backup
mountPath: /orientdb/backup
虽然,当我删除 StatefulSet 中的所有子路径时,会创建 pod 并将配置文件放入单独的文件夹中。所以 StatefulSet 看起来像这样:
volumeMounts:
- name: orientdb-config-backups
mountPath: /orientdb/config/backups
- name: orientdb-config-events
mountPath: /orientdb/config/events
- name: orientdb-config-distributed
mountPath: /orientdb/config/distributed
- name: orientdb-config-hazelcast
mountPath: /orientdb/config/hazelcast
- name: orientdb-config-server
mountPath: /orientdb/config/server
- name: orientdb-config-client-logs
mountPath: /orientdb/config/client-logs
- name: orientdb-config-server-logs
mountPath: /orientdb/config/server-logs
- name: orientdb-databases
mountPath: /orientdb/databases
- name: orientdb-backup
mountPath: /orientdb/backup
- name: orientdb-data
mountPath: /orientdb/bin/data
这种行为的原因可能是什么?
解决方案
问题是主机路径卷配置程序中存在错误,如果部署/状态集中存在子路径字段,即使该字段为空,也会遇到“lstat:没有此类文件或目录”错误。此错误不会让 statefulset 出现,它们会进入 containerCreatingConfigErr(在 kubeadm 上发生在我身上)
这个问题在我遇到的 kubeadm 上也存在。
推荐阅读
- python - AttributeError:模块“ale_py.gym”没有属性“ALGymEnv”
- sql - AWS IoT SQL 规则
- computer-vision - 什么 PointCloud 库最适合初学者开始使用?
- c# - C#如何按升序对文本框中的用户输入进行排序
- c++ - cpp-构造一个匿名对象
- python - ValueError: list.remove(x): x 不在列表中,但显然列表包含它
- c++ - 使用 if constexpr 时扣除模板参数失败
- c++ - “int &a = b;”中“&”的区别 与“int c = &d;”
- powershell - 导入 cmdlet 'Test-ActiveToken' 时 Connect-ExchangeOnline 冻结
- gcc - __attribute__ 或 #pragma 中的任何等效项 -fshort-enums?