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.
Rancher2-k8s:
“Mounts”: [
{
“Type”: “bind”,
“Source”: “/mnt/disks/ELK/elasticsearch”,
“Destination”: “/usr/share/elasticsearch”,
“Mode”: “”,
“RW”: true,
“Propagation”: “rprivate”
}
]
Rancher1-Cattle:
“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