0

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?

Community
  • 1
  • 1
Katlock
  • 1,200
  • 1
  • 17
  • 41

2 Answers2

1

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
  • 41
  • 4
0

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.