Mount type volume, not bind

Cluster information:

Kubernetes version: v2.2.6
Cloud being used: bare-metal
Installation method: docker run
Host OS: ubuntu
CNI and version:
CRI and version:

Hi community. I have a problem with mounting volumes.
Rancher with Cattle uses mount type “volume”.
Rancher 2 with k8s uses mount type “bind”.
From official Documentation: The file or directory does not need to exist on the Docker host already. It is created on demand if it does not yet exist.
So every new container creates all files in mounted path and i can edit it from host itself.
But in Kubernetes it mounts empty dir to container and all files in they are gone.

“Mounts”: [
“Type”: “bind”,
“Source”: “/mnt/disks/ELK/elasticsearch”,
“Destination”: “/usr/share/elasticsearch”,
“Mode”: “”,
“RW”: true,
“Propagation”: “rprivate”

“Mounts”: [
“Type”: “volume”,
“Name”: “es”,
“Source”: “/var/lib/docker/volumes/es/_data”,
“Destination”: “/usr/share/elasticsearch”,
“Driver”: “local”,
“Mode”: “rw”,
“RW”: true,
“Propagation”: “”

Sorry for my English

emptyDir is intended to be a non-permanent volume. Think of it like temp space intended for sharing data between multiple containers in a pod.

To mount a specific location on the host you want to use hostpath or local storage types.

I’ve tried all of this Volume types. All of these types are “bind”.
And mounted path inside of Container is epmty.
But i need type “volume” as at classic Docker.
For example, if i will mount some hostPath with mount point “/etc” that all files in this folder will be created in my hostPath.

With k8s i can’t do like this.

To my knowledge the volume type is essentially a bind mount but ad-hoc created in the docker volume directory. It’s docker specific and doesn’t have a direct equivalent in kubernetes. The closest thing would probably be still hostpath, local, or emptyDir.

Is there a specific reason you’re looking to use docker style volumes?