【问题标题】:StatefulSet volume mounts for OrientDB in KubernetesKubernetes 中 OrientDB 的 StatefulSet 卷挂载
【发布时间】:2018-11-10 19:13:37
【问题描述】:

我正在尝试使用 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

这种行为的原因可能是什么?

【问题讨论】:

    标签: kubernetes orientdb minikube


    【解决方案1】:

    如果部署/状态集中存在子路径字段,即使该字段为空,主机路径卷配置程序中的错误也会遇到“lstat:没有此类文件或目录”的错误。这个错误不会让 statefulset 出现,它们会进入 containerCreatingConfigErr(在 kubeadm 上发生在我身上)

    这个问题在我遇到的 kubeadm 上也存在。

    https://github.com/kubernetes/minikube/issues/2256

    【讨论】:

      猜你喜欢
      • 2020-08-07
      • 2019-08-24
      • 2021-10-26
      • 2019-10-09
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 2017-07-21
      • 1970-01-01
      相关资源
      最近更新 更多