Azim Sain:
EHi
Hello Everyone,
I am trying to get the restart time for all the pods in the cluster but it only returns result for first pod in the file.
Step 1) using below I get the pod names to file podNames.txt
kubectl get pods | awk '{print ($1)}' > podNames.txt
step2) in below I am trying to check storage usage of either of folder with names zoo or data
cat podNames.txt | while read in; do echo "$in"; kubectl exec -it "$in" -- df -h | grep -e zoo -e data; done
So it gives output for only first pod in the podNames.txt file. and give below message in output:
Unable to use a TTY - input is not a terminal or the right kind of file
So I removed (-t) in the command and ran below:
cat podNames.txt | while read in; do echo "$in"; kubectl exec -i "$in" -- df -h | grep -e zoo -e data; done
This time also same output only for first pod, only the warning message was not displayed.
can anyone help here, as I suspects after running the command inside container the loop gets exit and unable to proceed.