Initial checkin

This commit is contained in:
Radar231 2021-08-27 14:14:56 -04:00
commit dcc8bf3c83
2 changed files with 38 additions and 0 deletions

6
README.md Normal file
View File

@ -0,0 +1,6 @@
# k8s-restart shell script
## Introduction
A simple shell script to restart a kubernetes deployment.

32
k8s-restart Executable file
View File

@ -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