Skip to content

Instantly share code, notes, and snippets.

@yuri-tceretian
Last active November 20, 2017 16:49
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 yuri-tceretian/53e68dcd31ae761934d391d12fd814fd to your computer and use it in GitHub Desktop.
Save yuri-tceretian/53e68dcd31ae761934d391d12fd814fd to your computer and use it in GitHub Desktop.
The script that fixes the problem that occurs after ECE 1.0.x is upgraded to 1.1.0.
#!/bin/bash
#The script fixes the problem that occurs after ECE 1.0.x is upgraded to 1.1.0.
# 1. Make sure that 'jq' is installed on the host where you will run the script.
# 2. Change variables below.
# NODE_IP - IP address of the coordinator
# AUTH - credentials to access adminconsole. Use `root` user only
# 3. Run script
# 4. Remove service `frc-services-forwarders-services-forwarder` on every ECE host. The runner should re-create it immediately.
# 5. Check that the service is running.
# 0] Environment
#Coordinator IP address
export NODE_IP="192.168.44.10"
export URI_PREFIX="$NODE_IP:12400"
export AUTH="root:test"
# 1] Get service-forwarder config and add extra host
export UPDATED_CONTAINER=$(curl -u "$AUTH" "$URI_PREFIX/api/v0/regions/ece-region/container-sets/services-forwarders" | jq '.containers["services-forwarder"].data' | sed s/'"ExtraHosts": \[\]'/'"ExtraHosts": ["containerhost:${RUNNER_HOST_IP}"]'/)
# 2] Push container configuration back
curl -u "$AUTH" -X POST "$URI_PREFIX/api/v0/regions/ece-region/container-sets/services-forwarders/containers/services-forwarder" -d "$UPDATED_CONTAINER"
echo -e "\n\e[33mPlease execute 'docker rm -f frc-services-forwarders-services-forwarder' on every host that runs ECE\e[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment