Azure/kubernetes-volume-drivers

Please explain the --volume parameter in config kubelet service to enable FlexVolume driver

HimanshuZinzuwadia opened this issue · 2 comments

Is your feature request related to a problem?/Why is this needed
I don't understand the purpose of this line and where to put it.
--volume=/etc/kubernetes/volumeplugins:/etc/kubernetes/volumeplugins:rw
There is no such file
/etc/systemd/system/kubelet.service.
There are /var/lib/kubelet/config.yaml and /etc/systemd/system/kubelet.service.d/10-kubeadm.conf and /etc/default/kubelet containing KUBELET_EXTRA_ARGS=...

Describe the solution you'd like in detail
clarify the documentation to explain this flag and its purpose. Clarify where to add this flag in recent installations of kubelet that are driven by config files.

Describe alternatives you've considered
adding this argument to KUBELET_EXTRA_ARGS --volume=/etc/kubernetes/volumeplugins:/etc/kubernetes/volumeplugins:rw

Additional context

it's kubelet binary parameter under kubelet service, and flexvolume is already deprecated, what flexvolume plugin are you using now? I would suggest use CSI driver instead.

[Unit]
Description=Kubelet
ConditionPathExists=/usr/local/bin/kubelet

[Service]
Restart=always
EnvironmentFile=/etc/default/kubelet
SuccessExitStatus=143
ExecStartPre=/bin/bash /opt/azure/containers/kubelet.sh
ExecStartPre=/bin/mkdir -p /var/lib/kubelet
ExecStartPre=/bin/mkdir -p /var/lib/cni
ExecStartPre=/bin/bash -c "if [ $(mount | grep \"/var/lib/kubelet\" | wc -l) -le 0 ] ; then /bin/mount --bind /var/lib/kubelet /var/lib/kubelet ; fi"
ExecStartPre=/bin/mount --make-shared /var/lib/kubelet

ExecStartPre=-/sbin/ebtables -t nat --list
ExecStartPre=-/sbin/iptables -t nat --numeric --list

ExecStart=/usr/local/bin/kubelet \
        --enable-server \
        --node-labels="${KUBELET_NODE_LABELS}" \
        --v=2 \
        --volume-plugin-dir=/etc/kubernetes/volumeplugins \
        $KUBELET_TLS_BOOTSTRAP_FLAGS \
        $KUBELET_CONFIG_FILE_FLAGS \
        $KUBELET_CONTAINERD_FLAGS \
        $KUBELET_FLAGS

[Install]
WantedBy=multi-user.target

I am using NFS plugin q1autoops which is similar to this one. I am installing that plugin manually on the windows node. For this one also I install it manually on windows node in similar way, So I think that the above change to make plugin volume rw is not required. I will try to add this parameter to the kubelet service startup script installed by Calico on my windows node.

CSI Driver for windows node has additional requirement of CSI Proxy that may have other requirements for Windows node and I wanted to keep it simple for now. I will revisit CSI driver later.