This topic provides answers to some frequently asked questions about disk volumes, Apsara File Storage NAS (NAS) volumes, and Object Storage Service (OSS) volumes.

Type Question
FAQ about storage
FAQ about disk volumes
FAQ about NAS volumes
FAQ about OSS volumes

What do I do when a volume fails to be mounted?

Check whether FlexVolume and the plug-in for dynamic volume provisioning are installed.

Method 1: Check whether FlexVolume is installed

Run the following command to query information about pods:

kubectl get pod -n kube-system | grep flexvolume

Expected output:

flexvolume-4wh8s            1/1       Running   0          8d
flexvolume-65z49            1/1       Running   0          8d
flexvolume-bpc6s            1/1       Running   0          8d
flexvolume-l8pml            1/1       Running   0          8d
flexvolume-mzkpv            1/1       Running   0          8d
flexvolume-wbfhv            1/1       Running   0          8d
flexvolume-xf5cs            1/1       Running   0          8d   

Check whether the FlexVolume pods are in the Running state. Check whether the number of running FlexVolume pods equals the number of nodes in the cluster.

If the FlexVolume pods are not in the Running state, troubleshoot the issue based on the log of the FlexVolume plug-in.

Method 2: Check whether the plug-in for dynamic volume provisioning is installed

To mount a dynamically provisioned disk volume, you must install the plug-in for dynamic volume provisioning. Run the following command to query the pod on which the plug-in runs:

kubectl get pod -n kube-system | grep alicloud-disk

Expected output:

alicloud-disk-controller-8679c9fc76-lq6zb     1/1 Running   0   7d           

If the pod is not in the Running state, troubleshoot the issue based on the log of the plug-in.

How do I view the log related to storage services?

You can view the logs of FlexVolume, the provisioner plug-in, and kubelet.

Method 1: Print the log of FlexVolume on Master Node 1

Run the following command to query the pod on which an error occurs:
kubectl get pod -n kube-system | grep flexvolume
Run the following commands in sequence to print the log of the pod on which the error occurs:
kubectl logs flexvolume-4wh8s -n kube-system
kubectl describe pod flexvolume-4wh8s -n kube-system
Note The last several entries of the returned pod information indicate the status of the pod. You can analyze the error based on the log data.

View the logs of the disk driver, NAS driver, and OSS driver.

Perform the following steps to view the logs on the host node. If no PV is mounted to a pod, query the IP address of the node that hosts the pod.

kubectl describe pod nginx-97dc96f7b-xbx8t | grep Node

Expected output:

Node: cn-hangzhou.i-bp19myla3uvnt6zi****/192.168.XX.XX
Node-Selectors:  <none>

Log on to the node and print the logs of the disk driver, NAS driver, and OSS driver.

ssh 192.168.XX.XX
ls /var/log/alicloud/flexvolume*

Expected output:

flexvolume_disk.log  flexvolume_nas.log  flexvolume_o#ss.log

Method 2: Print the log of the provisioner plug-in on Master Node 1

Run the following command to query the pod on which an error occurs:
kubectl get pod -n kube-system | grep alicloud-disk
Run the following commands in sequence to print the log of the pod on which the error occurs:
kubectl logs alicloud-disk-controller-8679c9fc76-lq6zb -n kube-system
kubectl describe pod alicloud-disk-controller-8679c9fc76-lq6zb -n kube-system
Note The last several entries of the returned pod information indicate the status of the pod. You can analyze the error based on the log data.

Method 3: Print the log of kubelet

If no PV is mounted to a pod, query the IP address of the node that hosts the pod.

kubectl describe pod nginx-97dc96f7b-xbx8t | grep Node

Expected output:

Node: cn-hangzhou.i-bp19myla3uvnt6zi****/192.168.XX.XX
Node-Selectors:  <none>

Log on to the node and print the log of kubelet.

ssh 192.168.XX.XX
journalctl -u kubelet -r -n 1000 &> kubelet.log
Note In the preceding command, -n specifies the number of log entries to return.

The preceding steps describe how to print the logs of the FlexVolume, provisioner, and kubelet plug-ins. If the problem persists, contact the technical support team of Alibaba Cloud and provide related log information.

What do I do if I find kubelet contains a pod log that is not managed by ACK?

When a pod exceptionally exits, the mount target is not removed when the system unmounts the PV. As a result, the system fails to delete the pod. kubelet cannot collect all volume garbage. You must manually remove invalid mount targets or run a script to automate garbage collection.

Run the following script on the failed node to remove invalid mount targets:
wget https://raw.githubusercontent.com/AliyunContainerService/kubernetes-issues-solution/master/kubelet/kubelet.sh
sh kubelet.sh