Simplify docker role, cbr0 for calico isn't required anymore

This commit is contained in:
Smaine Kahlouch 2015-11-22 13:33:13 +01:00
parent d7b7db34fa
commit d3f35e12a2
3 changed files with 1 additions and 25 deletions

View file

@ -1,12 +1,4 @@
--- ---
- name: Write script for calico/docker bridge configuration
template: src=create_cbr.j2 dest=/etc/network/if-up.d/create_cbr mode=u+x backup=yes
when: kube_network_plugin is defined and kube_network_plugin == "calico"
- name: Configure calico/docker bridge
command: /etc/network/if-up.d/create_cbr
when: kube_network_plugin is defined and kube_network_plugin == "calico"
- name: enable docker - name: enable docker
service: service:
name: docker name: docker

View file

@ -1,14 +0,0 @@
#!/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 }}/{{ kube_network_node_prefix }}" ]];then
ip a add {{ br_addr }}/{{ kube_network_node_prefix }} dev cbr0
fi

View file

@ -4,9 +4,7 @@
#DOCKER="/usr/local/bin/docker" #DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options. # Use DOCKER_OPTS to modify the daemon startup options.
{% if kube_network_plugin is defined and kube_network_plugin == "calico" %} #DOCKER_OPTS=""
DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"
{% endif %}
# If you need Docker to use an HTTP proxy, it can also be specified here. # If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/" #export http_proxy="http://127.0.0.1:3128/"