Kubelet CoreOs FlexVolume plugin

4/25/2017

I have a DigitalOcean flexVolume on CoreOS. I am following this documentation for CoreOS from TonyZou.

Note that CoreOS mounts /usr as read-only so instead you'll want to add --volume-plugin-dir=/etc/kubernetes/volumeplugins to KUBELET_ARGS in /etc/kubernetes/kubelet.env and put the plugins there instead.

Restart kubelet with systemctl restart kubelet.service.

I create file in /etc/kubernetes/kubelet.env with content:

KUBELET_ARGS=--volume-plugin-dir=/etc/kubernetes/volumeplugins

And my driver in /etc/kubernetes/volumeplugins folder. However, the pod using the flexvolume driver keeps remaining in ContainerCreating status. Not sure if the kubelet.env file is getting picked up by kubelet. Any suggestions?

-- Sonam
coreos
kubelet
kubernetes

2 Answers

5/21/2017

Your kubelet didn't pick up the kubelet.env.

  1. If you wanna run the kubelet manually, you should add KUBELET_ARGS=--volume-plugin-dir=/etc/kubernetes/volumeplugins in your shell environment.

  2. If you wanna run the kubelet by systemd, you should add the kubelet.env in your kubelet systemd config file and reload the config file.

-- Xianglin Gao
Source: StackOverflow

4/26/2017

You can maybe add the /etc/kubernetes/kubelet.env file to your kubelet systemd unit. Something like

EnvironmentFile=/etc/kubernetes/kubelet.env

This ensures that the kubelet service will pick up your env file.

-- jonas kint
Source: StackOverflow