Created
February 12, 2019 05:55
-
-
Save jsturtevant/25aee565396669eb8018f5b29c2133c1 to your computer and use it in GitHub Desktop.
runs netstat after a pod is killed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dt = (Get-Date).ToString("MM-dd-yyyy HH:mm:ss") | |
$events=(.\kubectl.exe --kubeconfig='config' get events -o json | ConvertFrom-Json).items | |
Write-output "processing events" | |
ForEach ($event in $events) { | |
Write-output $event.reason | |
if ($event.reason -eq "Killing"){ | |
#$message="found event at $dt" | |
Write-Output $dt | Out-File -FilePath test -Append | |
Write-output $event | Out-file -FilePath test -Append | |
netstat -p tcp -noa | Out-File -FilePath test -Append | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment