Initial checkin
This commit is contained in:
commit
dcc8bf3c83
|
@ -0,0 +1,6 @@
|
|||
# k8s-restart shell script
|
||||
|
||||
## Introduction
|
||||
|
||||
A simple shell script to restart a kubernetes deployment.
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
##########################################################################
|
||||
#
|
||||
# A simple shell script to restart a k8s deployment
|
||||
#
|
||||
##########################################################################
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ];
|
||||
then
|
||||
echo ""
|
||||
echo "Missing deployment name!"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo ""
|
||||
echo " $0 <deployment>"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ns=$(kubectl get deployment -A | sed 's/ \+/ /g' | grep " $1 " | cut -d' ' -f1)
|
||||
|
||||
if [ -z "$ns" ];
|
||||
then
|
||||
echo ""
|
||||
echo "Unknown deployment: $1"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
kubectl rollout restart deployment $1 -n $ns
|
||||
|
||||
# EOF
|
Loading…
Reference in New Issue