Kubernetes中OrientDB的StatefulSet卷安装

时间:2018-10-11 13:18:44

标签: kubernetes orientdb minikube

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

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

1 个答案:

答案 0 :(得分:1)

问题在于,如果部署/状态集中存在子路径字段,即使该字段为空,主机路径卷配置程序中也会存在一个错误,该错误会出现“ lstat:无此类文件或目录”错误。此错误不会让statefulset出现,而是进入containerCreatingConfigErr(在kubeadm上与我一起发生)

这个问题在我遇到的地方也存在。

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