diff --git a/stacks/jupyterhub-keycloak/keycloak.yaml b/stacks/jupyterhub-keycloak/keycloak.yaml index 120a9b9b..6b0fb827 100644 --- a/stacks/jupyterhub-keycloak/keycloak.yaml +++ b/stacks/jupyterhub-keycloak/keycloak.yaml @@ -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