StatefulSet volume mounts for OrientDB in Kubernetes

10/11/2018

I am trying to deploy an OreintDB cluster with Kubernetes (minikube, specifically). I am using StatefulSet, however, when I use subpaths in volumeMounts declaration for all the OrientDB cluster configs, pods are not created. Although I would like to mount all the configMaps into one folder. ConfigMaps correspond to multiple configuration files required to setup the OrientDB cluster.

The StatefulSet looks like this:

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

Although, when I remove all the subPaths in a StatefulSet, pods are created and config files are placed into separate folders. So StatefulSet looks like this:

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

What could be the reason of such behavior?

-- Cassie
kubernetes
minikube
orientdb

1 Answer

11/10/2018

The issue is there is bug in hostpath volume provisioner that encounters an error with "lstat: no such file or directory" if there is subpath field present in deployment/statefulset, even if the field is empty. This error doesn't let statefulset come up and they goes into containerCreatingConfigErr (happened with me on kubeadm)

This issue is present on kubeadm as well where I encountered it.

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

-- Prafull Ladha
Source: StackOverflow