From 16e501027a7e5b9745c583743e156f30e543100b Mon Sep 17 00:00:00 2001 From: Mohammed Abu Taleb Date: Wed, 5 Oct 2022 16:33:21 +0300 Subject: [PATCH] fixed windows node ssh credentials passing --- kubectl-exec | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/kubectl-exec b/kubectl-exec index 0c69669..305efd3 100755 --- a/kubectl-exec +++ b/kubectl-exec @@ -99,8 +99,10 @@ fi WINDOWSNODES () { echo "SSH into windows VM" -read -p "Enter the windows node ssh user: " WINDOWSSSHUSER - IMAGE="alpine" +read -p "Enter your windows node ssh user: " WINDOWSSSHUSER +read -s -p "Enter your windows ssh password: " WINDOWSSSHPASSWORD + + IMAGE="mohatb/alpine:latest" POD="$NODE-exec-$(env LC_CTYPE=C tr -dc a-z0-9 < /dev/urandom | head -c 6)" # Check the node existance and IP @@ -111,10 +113,9 @@ read -p "Enter the windows node ssh user: " WINDOWSSSHUSER OVERRIDES="$(cat < Node:" echo "kubectl cp /etc/hostname default/$POD:/mnt/winsows_share/c/tmp/hostname.txt" echo "" echo "From Node -> Local" -echo "kubectl cp default/$POD:/mnt/winsows_share/c/Windows/System32/drivers/etc/hosts /tmp/hosts" +echo "kubectl cp default/$POD:/mnt/windows_share/c/Windows/System32/drivers/etc/hosts /tmp/hosts" echo "" @@ -327,7 +335,7 @@ echo "Run the below port-farward command to access the filemanager in your brows echo "" echo -e "> ${BLUE}kubectl port-forward $POD 8002:80${NC}" echo "" -echo -e "> ${BLUE}Go to http://127.0.0.1:8002${NC}" +echo -e "${BLUE}Go to http://127.0.0.1:8002${NC}" if [ $use_generator = true ] then @@ -393,7 +401,7 @@ echo "Run the below port-farward command to access the filemanager in your brows echo "" echo -e "> ${BLUE}kubectl port-forward $POD 8002:80${NC}" echo "" -echo -e "> ${BLUE}Go to http://127.0.0.1:8002${NC}" +echo -e "${BLUE}Go to http://127.0.0.1:8002${NC}" if [ $use_generator = true ] then