From 42cec4594ea909cfd4f893427d04bdd7f379f2d4 Mon Sep 17 00:00:00 2001 From: Mathis Marcotte Date: Tue, 7 Jan 2025 14:56:43 +0000 Subject: [PATCH] updated keytab script --- docker-bits/4_CLI.Dockerfile | 2 +- .../ktutil-keytab.sh | 14 ++++++++++++++ output/jupyterlab-cpu/Dockerfile | 2 +- output/jupyterlab-cpu/ktutil-keytab.sh | 14 ++++++++++++++ output/jupyterlab-pytorch/Dockerfile | 2 +- output/jupyterlab-pytorch/ktutil-keytab.sh | 14 ++++++++++++++ output/jupyterlab-tensorflow/Dockerfile | 2 +- output/jupyterlab-tensorflow/ktutil-keytab.sh | 14 ++++++++++++++ output/remote-desktop/Dockerfile | 2 +- output/remote-desktop/ktutil-keytab.sh | 14 ++++++++++++++ output/rstudio/Dockerfile | 2 +- output/rstudio/ktutil-keytab.sh | 14 ++++++++++++++ output/sas/Dockerfile | 2 +- output/sas/ktutil-keytab.sh | 14 ++++++++++++++ resources/common/ktutil-keytab.sh | 14 ++++++++++++++ 15 files changed, 119 insertions(+), 7 deletions(-) diff --git a/docker-bits/4_CLI.Dockerfile b/docker-bits/4_CLI.Dockerfile index 06b433786..6ce1a7dd4 100644 --- a/docker-bits/4_CLI.Dockerfile +++ b/docker-bits/4_CLI.Dockerfile @@ -99,4 +99,4 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab diff --git a/output/docker-stacks-datascience-notebook/ktutil-keytab.sh b/output/docker-stacks-datascience-notebook/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/docker-stacks-datascience-notebook/ktutil-keytab.sh +++ b/output/docker-stacks-datascience-notebook/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/output/jupyterlab-cpu/Dockerfile b/output/jupyterlab-cpu/Dockerfile index e3897d667..f95d68be1 100644 --- a/output/jupyterlab-cpu/Dockerfile +++ b/output/jupyterlab-cpu/Dockerfile @@ -158,7 +158,7 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab ############################### ### docker-bits/5_DB-Drivers.Dockerfile diff --git a/output/jupyterlab-cpu/ktutil-keytab.sh b/output/jupyterlab-cpu/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/jupyterlab-cpu/ktutil-keytab.sh +++ b/output/jupyterlab-cpu/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/output/jupyterlab-pytorch/Dockerfile b/output/jupyterlab-pytorch/Dockerfile index 971d16dfb..1ab7edd08 100644 --- a/output/jupyterlab-pytorch/Dockerfile +++ b/output/jupyterlab-pytorch/Dockerfile @@ -180,7 +180,7 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab ############################### ### docker-bits/5_DB-Drivers.Dockerfile diff --git a/output/jupyterlab-pytorch/ktutil-keytab.sh b/output/jupyterlab-pytorch/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/jupyterlab-pytorch/ktutil-keytab.sh +++ b/output/jupyterlab-pytorch/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/output/jupyterlab-tensorflow/Dockerfile b/output/jupyterlab-tensorflow/Dockerfile index 03e8e61dc..b6c7527c3 100644 --- a/output/jupyterlab-tensorflow/Dockerfile +++ b/output/jupyterlab-tensorflow/Dockerfile @@ -287,7 +287,7 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab ############################### ### docker-bits/5_DB-Drivers.Dockerfile diff --git a/output/jupyterlab-tensorflow/ktutil-keytab.sh b/output/jupyterlab-tensorflow/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/jupyterlab-tensorflow/ktutil-keytab.sh +++ b/output/jupyterlab-tensorflow/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/output/remote-desktop/Dockerfile b/output/remote-desktop/Dockerfile index ceae97fbf..621f500e6 100644 --- a/output/remote-desktop/Dockerfile +++ b/output/remote-desktop/Dockerfile @@ -230,7 +230,7 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab ############################### ### docker-bits/6_remote-desktop.Dockerfile diff --git a/output/remote-desktop/ktutil-keytab.sh b/output/remote-desktop/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/remote-desktop/ktutil-keytab.sh +++ b/output/remote-desktop/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/output/rstudio/Dockerfile b/output/rstudio/Dockerfile index f92f64941..fa341f409 100644 --- a/output/rstudio/Dockerfile +++ b/output/rstudio/Dockerfile @@ -158,7 +158,7 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab ############################### ### docker-bits/5_DB-Drivers.Dockerfile diff --git a/output/rstudio/ktutil-keytab.sh b/output/rstudio/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/rstudio/ktutil-keytab.sh +++ b/output/rstudio/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/output/sas/Dockerfile b/output/sas/Dockerfile index c9fada73c..e1c667d00 100644 --- a/output/sas/Dockerfile +++ b/output/sas/Dockerfile @@ -158,7 +158,7 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \ && dpkg -i ./gcm.deb \ && rm ./gcm.deb -COPY ktutil-keytab.sh /home/$NB_USER/.local/bin/ktutil-keytab +COPY ktutil-keytab.sh /usr/local/bin/ktutil-keytab ############################### ### docker-bits/5_DB-Drivers.Dockerfile diff --git a/output/sas/ktutil-keytab.sh b/output/sas/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/output/sas/ktutil-keytab.sh +++ b/output/sas/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done diff --git a/resources/common/ktutil-keytab.sh b/resources/common/ktutil-keytab.sh index 10bfd2e02..63b197baa 100644 --- a/resources/common/ktutil-keytab.sh +++ b/resources/common/ktutil-keytab.sh @@ -30,3 +30,17 @@ kubectl create secret generic kerberos-keytab -n $NS --from-file=./client.keytab # apply the secret kubectl apply -f ./ktutil_keytab.yaml + + +#get the notebook name +nb_name=${NB_PREFIX##*/} + +# Prompt user for notebook restart +while true; do + read -p "In order to update the kerberos authentication, the notebook server needs to be restarted. Would you like to restart your notebook server?[Y/n]: " yn + case $yn in + [Yy]* ) echo "Your notebook server will now restart"; kubectl rollout restart statefulset $nb_name -n $NB_NAMESPACE; break;; + [Nn]* ) echo "Your notebook server will not be restarted"; exit;; + * ) echo "Only yes or no is an expected answer";; + esac +done