Commit 17954ee0 authored by Yuji Itadori's avatar Yuji Itadori

Update service-deregistration.sh

parent f06d29fd
#!/bin/bash
for i in 1 2 3 4 5
CATALOG_ENDPOINT="http://consul.vnetcloud.com/v1/catalog/service/$1"
CONSUL_COMMAND=""
curl $CATALOG_ENDPOINT | jq -r '.[].ServiceID' > service.lists
cat service.lists | while read line
do
kubectl exec -it hedgehog-consul-server-0 -n jx -- /bin/sh -c "consul services deregister -id=go.micro.srv.news"
done
\ No newline at end of file
CONSUL_COMMAND="$CONSUL_COMMAND consul services deregister -id=$line;"
echo $CONSUL_COMMAND > consul.sh
done
kubectl exec -it hedgehog-consul-server-0 -n jx -- /bin/sh -c "$(cat consul.sh)"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment