k8s-cluster/scripts/omega-tunnel.sh
2024-05-18 05:03:38 +03:00

17 lines
531 B
Bash
Executable file

#!/bin/sh
APP="$SSH_ORIGINAL_COMMAND"
case "$APP" in
omega-ps|omega-core|omega-tron|mssql)
;;
*)
echo "Usage: ssh omega@master01 -t <CONTAINER_NAME>\n"
echo "Available containers:\n omega-ps\n omega-core\n omega-tron\n mssql"
exit
esac
export KUBECONFIG=k8s-admin-sa-staging-conf
POD=`kubectl -n staging get pods --selector="app=$APP" --output=go-template --template='{{range .items}}{{.metadata.name}}{{end}}'`
exec kubectl -n staging exec -it "$POD" -- bash -c 'PATH="$PATH:/opt/mssql-tools/bin" bash'