Kubernetes 中 OrientDB 的 StatefulSet 卷挂载
StatefulSet volume mounts for OrientDB in Kubernetes
我正在尝试使用 Kubernetes(特别是 minikube)部署 OreintDB 集群。我正在使用 StatefulSet,但是,当我在所有 OrientDB 集群配置的 volumeMounts 声明中使用子路径时,不会创建 pods。虽然我想将所有 configMaps 挂载到一个文件夹中。 ConfigMaps对应设置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 中的所有子路径时,会创建 pods 并将配置文件放入单独的文件夹中。所以 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
这种行为的原因可能是什么?
问题是主机路径卷供应器中存在错误,如果 deployment/statefulset 中存在子路径字段,即使该字段为空,也会遇到 "lstat: no such file or directory" 错误。这个错误不会让 statefulset 出现,它们会进入 containerCreatingConfigErr(我在 kubeadm 上遇到过)
这个问题在 kubeadm 上也存在,我也遇到过。
我正在尝试使用 Kubernetes(特别是 minikube)部署 OreintDB 集群。我正在使用 StatefulSet,但是,当我在所有 OrientDB 集群配置的 volumeMounts 声明中使用子路径时,不会创建 pods。虽然我想将所有 configMaps 挂载到一个文件夹中。 ConfigMaps对应设置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 中的所有子路径时,会创建 pods 并将配置文件放入单独的文件夹中。所以 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
这种行为的原因可能是什么?
问题是主机路径卷供应器中存在错误,如果 deployment/statefulset 中存在子路径字段,即使该字段为空,也会遇到 "lstat: no such file or directory" 错误。这个错误不会让 statefulset 出现,它们会进入 containerCreatingConfigErr(我在 kubeadm 上遇到过)
这个问题在 kubeadm 上也存在,我也遇到过。