Skip to content

Commit 0fdbbbb

Browse files
author
Ariel Kass
committed
update log colletion instructions to include 'previous' contain/pod instance logs
(cherry picked from commit 795dc78)
1 parent 9043b91 commit 0fdbbbb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/content/troubleshooting/log_status_collect.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,39 @@ If the PVCs are not in the _Bound_ state, collect the events of all unbound PVCs
6060

6161
#### Log collection for all CSI driver node pods and their containers
6262

63-
To collect logs for all CSI driver node pods, use the following commands:
63+
To collect logs for all CSI driver node pods, use the following commands (collection of 'previous' pod logs may fail if the pods have never restarted):
6464

6565
nodepods=`kubectl get pods -n <namespace> -l product=ibm-block-csi-driver -l app.kubernetes.io/component=csi-node --output=jsonpath={.items..metadata.name}`
6666

6767
for pod in $nodepods;do for container in `kubectl get -n <namespace> pod $pod -o jsonpath='{.spec.containers[*].name}'`;do kubectl logs -n <namespace> $pod -c $container > logs/${pod}_${container}.log;done;done
68+
for pod in $nodepods;do for container in `kubectl get -n <namespace> pod $pod -o jsonpath='{.spec.containers[*].name}'`;do kubectl logs --previous -n <namespace> $pod -c $container > logs/${pod}_${container}.previous.log;done;done
6869

6970
<br>
7071

7172
#### Log collection for all CSI controller containers
7273

73-
To collect logs for all controller containers, use the following commands:
74+
To collect logs for all controller containers, use the following commands (collection of 'previous' pod logs may fail if the pod has never restarted):
7475

7576
for container in `kubectl get -n <namespace> pod ibm-block-csi-controller-0 -o jsonpath='{.spec.containers[*].name}'`;do kubectl logs -n <namespace> ibm-block-csi-controller-0 -c $container > logs/ibm-block-csi-controller-0_${container}.log;done
77+
for container in `kubectl get -n <namespace> pod ibm-block-csi-controller-0 -o jsonpath='{.spec.containers[*].name}'`;do kubectl logs --previous -n <namespace> ibm-block-csi-controller-0 -c $container > logs/ibm-block-csi-controller-0_${container}.previous.log;done
7678

7779
<br>
7880

7981
#### Log collection for CSI operator logs
80-
To collect CSI operator logs, use the following commands:
82+
To collect CSI operator logs, use the following commands (collection of 'previous' pod logs may fail if the pod has never restarted):
8183

8284
operatorpod=`kubectl get pods -n <namespace> -l app.kubernetes.io/instance=ibm-block-csi-operator --output=jsonpath='{.items..metadata.name}'`
8385
kubectl logs $operatorpod -n <namespace> > logs/operator.log
86+
kubectl logs --previous $operatorpod -n <namespace> > logs/operator.previous.log
8487

8588
<br>
8689

8790
#### Log collection when using host definer
88-
When a host definer issue occurs, be sure to collect logs from the host definer pod where the error occurred.
91+
When a host definer issue occurs, be sure to collect logs from the host definer pod where the error occurred, using the following command (collection of 'previous' pod logs may fail if the pods has never restarted):
8992

9093
hostdefinerpod=`kubectl get pods -n <namespace> -l app.kubernetes.io/component=hostdefiner --output=jsonpath='{.items..metadata.name}'`
9194
kubectl logs $hostdefinerpod -n <namespace> > logs/hostdefiner.log
95+
kubectl logs --previous $hostdefinerpod -n <namespace> > logs/hostdefiner.previous.log
9296

9397
<br>
9498

0 commit comments

Comments
 (0)