kubectl logs -f <pod-name> -c <container-name> -n <namespace>
Examples of listing the logs:
kubectl logs -f <pod-name> -c <container-name> -n <namespace>
kubectl logs -f csi-vmware-controller-7b85fcfb5b-8hg48 -c csi-provisioner -n kube-system
Export Logs to a File
To export the logs for further analysis, you can redirect the output to a file:
kubectl logs <pod-name> -c <container-name> -n <namespace> > csi-logs.txt
This command will save the logs to csi-logs.txt in your current directory.
By following these steps, you can efficiently access and save the necessary logs to assist with CSI troubleshooting.