Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Create kubectl.5s.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
drwatsno authored Mar 12, 2018
1 parent e49c783 commit 88eec2d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions kubectl.5s.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

echo "kubectl"
echo "---"

PODS=$(kubectl get pods | awk 'BEGIN { ORS="" };{
if ($1 != "NAME") {
print "-- " $1 " " $2 " " $3 " | bash=\"kubectl exec -it " $1 " sh\" | font=monospace"
if ($3 == "Running") {
print " | color=green"
} else {
print " | color=red"
}
print "\n"
}
}')

SERVICES=$(kubectl get services | awk 'BEGIN { ORS="" };{
if ($1 != "NAME") {
print "-- " $1 " " $2 " " $3 " " $5 " | font=monospace bash=kubectl"
print "\n"
}
}')


echo Pods
echo "$PODS"

echo Services
echo "$SERVICES"

0 comments on commit 88eec2d

Please sign in to comment.