Skip to content

Instantly share code, notes, and snippets.

@cmattoon
Created February 21, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmattoon/62e3c1ec985eb1dc14d86527043f90fd to your computer and use it in GitHub Desktop.
Save cmattoon/62e3c1ec985eb1dc14d86527043f90fd to your computer and use it in GitHub Desktop.
Configure Fission Router
#!/bin/bash
# fission.io router config for CoreOS
# v0.1.0
#
# Usage:
# source fission_router_config.sh
# Or:
# eval $(./fission_router_config.sh)
ports=$(kubectl -n fission get svc | grep -e 'controller\|router' | cut -d: -f 2 | cut -d/ -f 1 | xargs echo)
export FISSION_URL=http://$COREOS_PRIVATE_IPV4:$(echo $ports | cut -d' ' -f1)
export FISSION_ROUTER=$COREOS_PRIVATE_IPV4:$(echo $ports | cut -d' ' -f2)
# If this was exec'd, echo the statements for `eval`
if [ "${0}" != "-bash" ]; then
echo "export FISSION_URL=$FISSION_URL"
echo "export FISSION_ROUTER=$FISSION_ROUTER"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment