ArangoLocalStorage does not work on Rancher
Problem: Volumes are not mounted because kubelet claims that a local path does not exists (which is does).
Since rancher is running kubelet in a container, I expect that this is a mount propagation issue.
See https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation
I can confirm this issue using Rancher 2.1.7 and its default Kubernetes (v1.13.4-rancher1-1) on a bare metal cluster. The subdirectories for all volumes have been created automatically on the respective hosts but the initialisation of the servers and agents failed with the claim that the directory does not exist.
I tried to determine if your expectation is correct and tried to hardcode the mount propagation into a my clone of kube-arangodb. However, I failed with the following error message:
.gobuild/src/github.com/arangodb/kube-arangodb/pkg/util/k8sutil/pods.go:180:79: cannot use "k8s.io/api/core/v1".MountPropagationHostToContainer (type "k8s.io/api/core/v1".MountPropagationMode) as type *"k8s.io/api/core/v1".MountPropagationMode in field value
Having never programmed in GO, I have no idea what the compiler wants to tell me. I thought I used the required type, but obviously the compiler does not agree.
Any update on this?
https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/issues/107#issuecomment-521340157
kubelet doesn't see the path because it's dockerized
2 options
- define
extra_bindsin RKE kubelet config, kubelet will then see that - use the
/var/lib/kubelet/volume which is already bound
localPath:
- /var/lib/kubelet/volumes/arango-storage
this is what I did, working for me
You can update your cluster to allow kubelet docker container to mount local path. Update cluster.yml with : services:
kubelet:
image: rancher/hyperkube:v1.15.4-rancher1
extra_binds:
- "/mnt/volumes:/mnt"
Run rke up. The changes will be updated. In PV you can mention the mount path as /mnt.
It will be working.