Use the kubectl logs to collect logs for vSphere Container Storage Plug-in pods. You can then analyze the logs to diagnose problems with your vSphere Container Storage Plug-in environment.

Procedure

  • Collect logs for vSphere Container Storage Plug-in pods by using the following command.
    kubectl logs -f pod-name -c container-name -n namespace
    The command takes these options.
    Option Description
    -f pod-name The name of the vSphere Container Storage Plug-in pod.
    -c container-name The name of the container in the vSphere Container Storage Plug-in pod.
    -n namespace The location where you deploy vSphere Container Storage Plug-in. Default is vmware-system-csi.

Example: Command Examples

To collect vSphere CSI controller logs use the following command:
kubectl logs vsphere-csi-controller-suffix -c vsphere-csi-controller -n vmware-system-csi
To collect vSphere CSI syncer logs, use the following command:
 kubectl logs vsphere-csi-controller-suffix -c vsphere-syncer -n vmware-system-csi
To collect vSphere CSI Node Daemonset Pod logs, use the following command:
kubectl logs vsphere-csi-node-suffix -c vsphere-csi-node -n vmware-system-csi
Note: In the production environment, vSphere Container Storage Plug-in runs with multiple replicas. It is recommended to collect logs from each replica of the pod. It is also important to collect logs of all containers from all replicas of the vSphere Container Storage Plug-in pod to perform root cause analysis in case you find any issues.