Calico is not a network overlay

This commit is contained in:
Smaine Kahlouch
2015-10-27 15:42:46 +01:00
parent b98227e9a4
commit f216302f95
24 changed files with 86 additions and 45 deletions

View File

@@ -1,11 +1,11 @@
---
- name: Write script for calico/docker bridge configuration
template: src=create_cbr.j2 dest=/etc/network/if-up.d/create_cbr mode=u+x
when: overlay_network_plugin is defined and overlay_network_plugin == "calico"
when: kube_network_plugin is defined and kube_network_plugin == "calico"
- name: Configure calico/docker bridge
shell: /etc/network/if-up.d/create_cbr
when: overlay_network_plugin is defined and overlay_network_plugin == "calico"
when: kube_network_plugin is defined and kube_network_plugin == "calico"
- name: Configure docker to use cbr0 bridge
lineinfile:
@@ -14,7 +14,7 @@
line='DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"'
notify:
- restart docker
when: overlay_network_plugin is defined and overlay_network_plugin == "calico"
when: kube_network_plugin is defined and kube_network_plugin == "calico"
- name: enable docker
service:

View File

@@ -13,7 +13,7 @@
with_items:
- aufs-tools
- cgroupfs-mount
- docker-engine=1.8.2-0~{{ ansible_distribution_release }}
- docker-engine=1.8.3-0~{{ ansible_distribution_release }}
- name: Copy default docker configuration
template: src=default-docker.j2 dest=/etc/default/docker

View File

@@ -9,6 +9,6 @@ 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
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,7 +4,7 @@
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
{% if overlay_network_plugin is defined and overlay_network_plugin == "calico" %}
{% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
DOCKER_OPTS="--bridge=cbr0 --iptables=false --ip-masq=false"
{% endif %}