Last active
May 8, 2019 22:30
-
-
Save sl1pm4t/b74a43033226148b1aa6fb08a0afa1b2 to your computer and use it in GitHub Desktop.
Revisions
-
sl1pm4t revised this gist
May 8, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ ADMIN_PORT=$ADMIN_PORT_START # Get list of sidecars for SVC in $(consul catalog services -node=$HOSTNAME | grep sidecar-proxy) do echo $SVC ADMIN_PORT=$[$ADMIN_PORT +1] svcname="${SVC/-sidecar-proxy/}" -
sl1pm4t created this gist
May 8, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ #!/bin/bash set -eu readonly ADMIN_PORT_START=19000 # Start sidecars function start_consul_envoy_sidecar { local -r sidecar_for="$1" local -r admin_bind_port="$2" echo "Start consul sidecar for $sidecar_for" /usr/local/bin/consul connect envoy \ -sidecar-for ${sidecar_for} \ -admin-bind=127.0.0.1:${admin_bind_port} \ -- -l info pids[${i}]=$! } ADMIN_PORT=$ADMIN_PORT_START # Get list of sidecars for SVC in $(consul catalog services -node=$HOSTNAME | grep sidecar-proxy) do echo $SVC ADMIN_PORT=$[$ADMIN_PORT +1] svcname="${SVC/-sidecar-proxy/}" start_consul_envoy_sidecar "$svcname" "$ADMIN_PORT" & done # Wait for subprocesses for job in `jobs -p` do echo $job wait $job done