Last active
April 27, 2022 15:56
-
-
Save danhawkins/830494be232be440b3f7f4472763e01b to your computer and use it in GitHub Desktop.
Start Livebook Pod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Name of our app/service and executable name from the release | |
SVC_NAME="test-svc" | |
EXEC_NAME="test_svc" | |
# Name for the pod | |
LIVEBOOK_NAME="danny-livebook" | |
# Fetch the require env from the service pod | |
POD_NAME=`kubectl get pod -l app=${SVC_NAME} -o=name` | |
RELEASE_NODE=`kubectl exec ${POD_NAME} -- ./bin/${EXEC_NAME} eval 'IO.puts(System.get_env("RELEASE_NODE"))'` | |
RELEASE_COOKIE=`kubectl exec ${POD_NAME} -- ./bin/${EXEC_NAME} eval 'IO.puts(System.get_env("RELEASE_COOKIE"))'` | |
echo "Found $RELEASE_NODE for pod ${POD_NAME}" | |
echo "Starting connected livebook" | |
kubectl run $LIVEBOOK_NAME \ | |
--image=livebook/livebook \ | |
--env LIVEBOOK_DEFAULT_RUNTIME="attached:${RELEASE_NODE}:${RELEASE_COOKIE}" \ | |
--env RELEASE_DISTRIBUTION="name" \ | |
--env RELEASE_NODE="[email protected]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment