Infiniroot Blog: We sometimes write, too.

Of course we cannot always share details about our work with customers, but nevertheless it is nice to show our technical achievements and share some of our implemented solutions.

Rancher 2: Kubernetes cluster provisioning fails with error response / is not a shared mount

Published on April 24th 2020


On dev environments sometimes a simple LXC or VM is powered on with a single partition: Everything is running in the root partition. This is not a wise choice on production systems, but on fire-and-forget machines this is a common practice. 

However when deploying a Kubernetes cluster (using Rancher 2), this seems to cause problems. 

Kubernetes deployment fails: mounted on / but it is not a shared mount

The error message shows:

Error response from daemon: path /var/lib/rancher is mounted on / but it is not a shared mount]

To overcome this error message, the root partition needs to be mounted using the --make-rshared parameter. This does not remount the partition itself and can be done during runtime:

root@kube3:~# mount --make-rshared /

To overcome a reboot, the command can be added in /etc/rc.local:

root@kube3:~# cat < /etc/rc.local
#!/bin/bash
mount --make-shared /
exit
EOF


root@kube3:~# chmod 755 /etc/rc.local

The cluster provisioning should be able to continue after this adjustment.