Skip to content
Snippets Groups Projects
Commit d3f35e12 authored by Smaine Kahlouch's avatar Smaine Kahlouch
Browse files

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

parent d7b7db34
No related branches found
No related tags found
No related merge requests found
---
- 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
service:
name: docker
......
#!/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
......@@ -4,9 +4,7 @@
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
{% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"
{% endif %}
#DOCKER_OPTS=""
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment