Skip to content

Instantly share code, notes, and snippets.

@Aceeri
Created May 18, 2018 20:54
Show Gist options
  • Save Aceeri/5bf6f3d21d357f9607199ac141ecc66e to your computer and use it in GitHub Desktop.
Save Aceeri/5bf6f3d21d357f9607199ac141ecc66e to your computer and use it in GitHub Desktop.
pods='\n' read -r -a array <<< $(kubectl get pods -l app=$1 -o name | sed 's/pods\///g')
rm ~/kubefifo
mkfifo ~/kubefifo
for pod in "${array[@]}"
do
kubectl logs $pod -f > ~/kubefifo & echo "$pod following";
done
cat ~/kubefifo
rm ~/kubefifo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment