Dmytro Dovbii f666ae2b3f [K8s] Add units to make k8s working on debian
Change-Id: Iec45db413f0e88a68b435a13aa7a4b4a6fdfd818
2016-07-15 13:57:24 +03:00

18 lines
389 B
Bash

#!/bin/bash
count=30
echo "Adding flannel configuration to etcd"
command=$((/opt/bin/etcdctl set /coreos.com/network/config '{"Network":"10.200.0.0/16"}') 2>&1)
while [ $count -gt 0 ]; do
if [ $command ]; then
echo "Flannel is configured on master node" >> /tmp/etcd.log
exit 0
fi
echo "Flannel configuration was not added. Reason: $command"
((count-- ))
sleep 5
done
exit 1