Browse Source

specify weave version

pull/133/head
Smana 8 years ago
parent
commit
793d665db4
7 changed files with 10 additions and 25 deletions
  1. 7
      README.md
  2. 2
      inventory/group_vars/all.yml
  3. 3
      roles/download/defaults/main.yml
  4. 11
      roles/network_plugin/weave/defaults/main.yml
  5. 6
      roles/network_plugin/weave/templates/docker
  6. 4
      roles/network_plugin/weave/templates/weave
  7. 2
      roles/network_plugin/weave/templates/weave.j2

7
README.md

@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/ansibl8s/setup-kubernetes.svg)](https://travis-ci.org/ansibl8s/setup-kubernetes)
[![Build Status](https://travis-ci.org/kubespray/setup-kubernetes.svg)](https://travis-ci.org/kubespray/setup-kubernetes)
kubernetes-ansible kubernetes-ansible
======== ========
@ -27,6 +27,7 @@ in order to avoid any issue during deployment you should disable your firewall
* [etcd](https://github.com/coreos/etcd/releases) v2.2.4 * [etcd](https://github.com/coreos/etcd/releases) v2.2.4
* [calicoctl](https://github.com/projectcalico/calico-docker/releases) v0.16.0 * [calicoctl](https://github.com/projectcalico/calico-docker/releases) v0.16.0
* [flanneld](https://github.com/coreos/flannel/releases) v0.5.5 * [flanneld](https://github.com/coreos/flannel/releases) v0.5.5
* [weave](http://weave.works/) v1.4.4
* [docker](https://www.docker.com/) v1.9.1 * [docker](https://www.docker.com/) v1.9.1
Quickstart Quickstart
@ -143,12 +144,14 @@ In order to do so, some variables have to be used '**loadbalancer_apiserver**' a
### Network Plugin ### Network Plugin
You can choose between 2 network plugins. Only one must be chosen.
You can choose between 3 network plugins. Only one must be chosen.
* **flannel**: gre/vxlan (layer 2) networking. ([official docs](https://github.com/coreos/flannel)) * **flannel**: gre/vxlan (layer 2) networking. ([official docs](https://github.com/coreos/flannel))
* **calico**: bgp (layer 3) networking. ([official docs](http://docs.projectcalico.org/en/0.13/)) * **calico**: bgp (layer 3) networking. ([official docs](http://docs.projectcalico.org/en/0.13/))
* **weave**: Weave is a lightweight container overlay network that doesn't require an external K/V database cluster. ([official docs](http://weave.works/docs/))
The choice is defined with the variable **kube_network_plugin** The choice is defined with the variable **kube_network_plugin**

2
inventory/group_vars/all.yml

@ -46,7 +46,7 @@ cluster_name: cluster.local
# but don't know about that address themselves. # but don't know about that address themselves.
# access_ip: 1.1.1.1 # access_ip: 1.1.1.1
# Choose network plugin (calico or flannel)
# Choose network plugin (calico, weave or flannel)
kube_network_plugin: calico kube_network_plugin: calico
# Kubernetes internal network for services, unused block of space. # Kubernetes internal network for services, unused block of space.

3
roles/download/defaults/main.yml

@ -6,6 +6,7 @@ kube_version: v1.1.4
etcd_version: v2.2.4 etcd_version: v2.2.4
calico_version: v0.16.0 calico_version: v0.16.0
calico_cni_version: v1.0.0 calico_cni_version: v1.0.0
weave_version: v1.4.4
# Download URL's # Download URL's
kube_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/amd64" kube_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/amd64"
@ -13,7 +14,7 @@ etcd_download_url: "https://github.com/coreos/etcd/releases/download/{{ etcd_ver
calico_download_url: "https://github.com/Metaswitch/calico-docker/releases/download/{{calico_version}}/calicoctl" calico_download_url: "https://github.com/Metaswitch/calico-docker/releases/download/{{calico_version}}/calicoctl"
calico_cni_download_url: "https://github.com/projectcalico/calico-cni/releases/download/{{calico_cni_version}}/calico" calico_cni_download_url: "https://github.com/projectcalico/calico-cni/releases/download/{{calico_cni_version}}/calico"
calico_cni_ipam_download_url: "https://github.com/projectcalico/calico-cni/releases/download/{{calico_cni_version}}/calico-ipam" calico_cni_ipam_download_url: "https://github.com/projectcalico/calico-cni/releases/download/{{calico_cni_version}}/calico-ipam"
weave_download_url: "http://git.io/weave"
weave_download_url: "https://github.com/weaveworks/weave/releases/download/{{weave_version}}/weave"
# Checksums # Checksums
calico_checksum: "cfbbcad4b3b7d79be9a25bcdc153ec1d139eecd54840914a363b0710eebc5c51" calico_checksum: "cfbbcad4b3b7d79be9a25bcdc153ec1d139eecd54840914a363b0710eebc5c51"

11
roles/network_plugin/weave/defaults/main.yml

@ -1,11 +0,0 @@
---
# Flannel public IP
# The address that flannel should advertise as how to access the system
flannel_public_ip: "{{ access_ip|default(ip|default(ansible_default_ipv4.address)) }}"
## interface that should be used for flannel operations
## This is actually an inventory node-level item
# flannel_interface:
# cloud_provider: no

6
roles/network_plugin/weave/templates/docker

@ -1,6 +1,2 @@
# Deployed by Ansible # Deployed by Ansible
{% if init_system == "sysvinit" and kube_network_plugin == "flannel" and ansible_os_family == "Debian" %}
DOCKER_OPTS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
{% elif kube_network_plugin == "flannel" %}
OPTIONS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
{% endif %}
DOCKER_OPTS=""

4
roles/network_plugin/weave/templates/weave

@ -1,4 +0,0 @@
PEERS="{% for host in groups['k8s-cluster'] %}{{ hostvars[host]['ip'] | default( hostvars[host]['ansible_default_ipv4']['address']) }}{% if not loop.last %} {% endif %}{% endfor %}"
{% if weave_password is defined %}
WEAVE_PASSWORD="{{ weave_password }}"
{% endif %}

2
roles/network_plugin/weave/templates/weave.j2

@ -1,4 +1,4 @@
WEAVE_PEERS="{% for host in groups['k8s-cluster'] %}{{ hostvars[host]['ip'] | default( hostvars[host]['ansible_default_ipv4']['address']) }}{% if not loop.last %} {% endif %}{% endfor %}"
WEAVE_PEERS="{% for host in groups['k8s-cluster'] %}{{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address'])) }}{% if not loop.last %} {% endif %}{% endfor %}"
WEAVEPROXY_ARGS="--rewrite-inspect --without-dns" WEAVEPROXY_ARGS="--rewrite-inspect --without-dns"
WEAVE_SUBNET="--ipalloc-range {{ kube_pods_subnet }}" WEAVE_SUBNET="--ipalloc-range {{ kube_pods_subnet }}"
{% if weave_password is defined %} {% if weave_password is defined %}

Loading…
Cancel
Save