Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script to bind FQDN (available) to the jupyterhub IP address #2

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions bind-jhub-fqdn2IP.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /bin/bash
############################################
# This script will help bind the fqdn
# to the Jupyterhub static IP address.
# This usefull on Azure. You probably have
# similar process on other cloud provide
#
# Original script from here
# https://docs.microsoft.com/en-us/azure/aks/ingress-tls
# Synopsis:
# ./bind-jhub-fqdn2IP.sh <IP> <NAME>
# CC 2023-04-11 Jacob Fosso Tande
#########################################
# configure an FQDN for the ingress controller IP address
# Public IP address of your ingress controller
IPADDRESS=$1
NAME=$2
IP="$IPADDRESS"

# Name to associate with public IP address
DNSNAME="$NAME"

# Get the resource-id of the public ip
PUBLICIPID=$(az network public-ip list --query "[?ipAddress!=null]|[?contains(ipAddress, '$IP')].[id]" --output tsv)

# Update public ip address with DNS name
az network public-ip update --ids $PUBLICIPID --dns-name $DNSNAME

# Display the FQDN
FQDN=$(az network public-ip show --ids $PUBLICIPID --query "[dnsSettings.fqdn]" --output tsv)

echo " "
echo " "
echo " Got FQDN "
echo " "
echo " "
echo $FQDN
echo " "
echo " "