Skip to content
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
4 changes: 3 additions & 1 deletion stacks/jupyterhub-keycloak/keycloak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ spec:
while :
do
echo "Determining Keycloak public reachable address"
KEYCLOAK_ADDRESS=$(kubectl get svc keycloak -o json | jq -r --argfile endpoints <(kubectl get endpoints keycloak -o json) --argfile nodes <(kubectl get nodes -o json) '($nodes.items[] | select(.metadata.name == $endpoints.subsets[].addresses[].nodeName) | .status.addresses | map(select(.type == "ExternalIP" or .type == "InternalIP")) | min_by(.type) | .address | tostring) + ":" + (.spec.ports[] | select(.name == "https") | .nodePort | tostring)')
ENDPOINTS=$(kubectl get endpoints keycloak -o json)
NODES=$(kubectl get nodes -o json)
KEYCLOAK_ADDRESS=$(kubectl get svc keycloak -o json | jq -r --argjson endpoints "$ENDPOINTS" --argjson nodes "$NODES" '($nodes.items[] | select(.metadata.name == $endpoints.subsets[].addresses[].nodeName) | .status.addresses | map(select(.type == "ExternalIP" or .type == "InternalIP")) | min_by(.type) | .address | tostring) + ":" + (.spec.ports[] | select(.name == "https") | .nodePort | tostring)')
echo "Found Keycloak running at $KEYCLOAK_ADDRESS"

if [ ! -z "$KEYCLOAK_ADDRESS" ]; then
Expand Down
Loading