Skip to content
Permalink
Browse files

Added new kimage function

  • Loading branch information...
eko committed Oct 3, 2019
1 parent db45f83 commit bd95b3be029c76c70b355a68b0342e52b815652a
Showing with 7 additions and 0 deletions.
  1. +7 −0 .functions
@@ -425,6 +425,13 @@ function kforward {
done
}

# Kubernetes display current image deplyed for a pod
# Usage: kimage context namespace pod-name
function kimage {
podName=`kubectl --context $1 -n $2 get pods | grep $3 | cut -d' ' -f1 | head -1`
kubectl --context $1 -n $2 describe pod/$podName | grep Image: | head -1 | cut -d':' -f2- | tr -d ' '
}

function kubernetes_image_diff {
k describe pods -n $1 --context $2 | grep Image: | cut -d':' -f2 -f3 | cut -d'/' -f2- | tr -d ' ' > /tmp/$2.diff
}

0 comments on commit bd95b3b

Please sign in to comment.
You can’t perform that action at this time.