Get Kubernetes FlexVolume Logs

4/11/2019

I'm trying to create a custom FlexVolume, but it's failing to attach/mount with a timeout message. Where can I find the logs to determine the cause of failure?

Here is my StatefulSet spec:

kind: StatefulSet
...
spec:
  ...
  template:
    ...
    spec:
      ...
      volumes:
        - name: "ignite-storage"
          flexVolume:
            driver: "co.mira/lvm"
            fsType: "ext4"
            options:
              awsRegion: "us-east-1"
              vols: "2"
              tag: "ignite"
              ebsType: "{{ ignite_storage_ebs_volume_type }}"
              sizeGb: "{{ ignite_storage_ebs_volume_size_gb }}"
              iopsPerGb: "2"
      containers:
        - name: ignite
          ...
          volumeMounts:
            - name: "ignite-storage"
              mountPath: "..."

My FlexVolume is deployed using a Daemon on all nodes at: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/mira.co~lvm/lvm

-- kellanburket
kubernetes
logging
mounted-volumes

2 Answers

4/26/2019

As mentioned here

The vendor and driver names must match flexVolume.driver in the volume spec, with '~' replaced with '/'.

While you have driver: "co.mira/lvm" and vendor name mira.co~lvm

-- A_Suh
Source: StackOverflow

4/30/2019

kube-controller-manager is responsible for attaching and detaching (if enabled), so look for logs to attach, detach, and isattached on the master at /var/log/kube-controller-manager.log. If it's deployed on its own kube-system pod, use: kubectl -n kube-system logs -f $POD_NAME.

For the operations waitforattach, mountdevice, unmountdevice check the kubelet logs on each of the nodes try /var/log/kubelet.log or journalctl -u kubelet.service.

init operations should be logged in both.

-- kellanburket
Source: StackOverflow