mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-06 18:17:47 +03:00
Initial commit
This commit is contained in:
14
roles/docker/templates/create_cbr.j2
Normal file
14
roles/docker/templates/create_cbr.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/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)
|
||||
if ! [[ "${br_ips}" =~ "{{ br_addr }}/{{ overlay_network_host_prefix }}" ]];then
|
||||
ip a add {{ br_addr }}/{{ overlay_network_host_prefix }} dev cbr0
|
||||
fi
|
||||
Reference in New Issue
Block a user