2015-10-03 20:19:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Create calico bridge cbr0 if it doesn't exist
|
|
|
|
ifaces=$(ifconfig -a | sed 's/[ \t].*//;/^\(lo\|\)$/d' |tr '\n' ' ')
|
|
|
|
if ! [[ "${ifaces}" =~ "cbr0" ]];then
|
|
|
|
brctl addbr cbr0
|
|
|
|
ip link set cbr0 up
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Configure calico bridge ip
|
|
|
|
br_ips=$(ip addr list cbr0 |grep "inet " |cut -d' ' -f6)
|
2015-10-27 14:42:46 +00:00
|
|
|
if ! [[ "${br_ips}" =~ "{{ br_addr }}/{{ kube_network_node_prefix }}" ]];then
|
|
|
|
ip a add {{ br_addr }}/{{ kube_network_node_prefix }} dev cbr0
|
2015-10-03 20:19:50 +00:00
|
|
|
fi
|