mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-04-04 17:55:12 -02:30
weave network plugin
This commit is contained in:
6
roles/network_plugin/weave/templates/docker
Normal file
6
roles/network_plugin/weave/templates/docker
Normal file
@@ -0,0 +1,6 @@
|
||||
# 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 %}
|
||||
28
roles/network_plugin/weave/templates/systemd-docker.service
Normal file
28
roles/network_plugin/weave/templates/systemd-docker.service
Normal file
@@ -0,0 +1,28 @@
|
||||
[Unit]
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.com
|
||||
{% if ansible_os_family == "RedHat" %}
|
||||
After=network.target
|
||||
Wants=docker-storage-setup.service
|
||||
{% elif ansible_os_family == "Debian" %}
|
||||
After=network.target docker.socket
|
||||
Requires=docker.socket
|
||||
{% endif %}
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
EnvironmentFile=-/etc/default/docker
|
||||
Environment=GOTRACEBACK=crash
|
||||
ExecStart=/usr/bin/docker daemon \
|
||||
$OPTIONS \
|
||||
$DOCKER_STORAGE_OPTIONS \
|
||||
$DOCKER_NETWORK_OPTIONS \
|
||||
$INSECURE_REGISTRY
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
LimitCORE=infinity
|
||||
MountFlags=slave
|
||||
TimeoutStartSec=1min
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
4
roles/network_plugin/weave/templates/weave
Normal file
4
roles/network_plugin/weave/templates/weave
Normal file
@@ -0,0 +1,4 @@
|
||||
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 %}
|
||||
6
roles/network_plugin/weave/templates/weave.j2
Normal file
6
roles/network_plugin/weave/templates/weave.j2
Normal file
@@ -0,0 +1,6 @@
|
||||
WEAVE_PEERS="{% for host in groups['k8s-cluster'] %}{{ hostvars[host]['ip'] | default( hostvars[host]['ansible_default_ipv4']['address']) }}{% if not loop.last %} {% endif %}{% endfor %}"
|
||||
WEAVEPROXY_ARGS="--rewrite-inspect --without-dns"
|
||||
WEAVE_SUBNET="--ipalloc-range {{ kube_pods_subnet }}"
|
||||
{% if weave_password is defined %}
|
||||
WEAVE_PASSWORD="{{ weave_password }}"
|
||||
{% endif %}
|
||||
16
roles/network_plugin/weave/templates/weave.service.j2
Normal file
16
roles/network_plugin/weave/templates/weave.service.j2
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Weave Network
|
||||
Documentation=http://docs.weave.works/weave/latest_release/
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/weave.env
|
||||
ExecStartPre={{ bin_dir }}/weave launch-router \
|
||||
$WEAVE_SUBNET \
|
||||
$WEAVE_PEERS
|
||||
ExecStart=/usr/bin/docker attach weave
|
||||
ExecStop={{ bin_dir }}/weave stop-router
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
18
roles/network_plugin/weave/templates/weaveexpose.service.j2
Normal file
18
roles/network_plugin/weave/templates/weaveexpose.service.j2
Normal file
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Documentation=http://docs.weave.works/
|
||||
Requires=docker.service
|
||||
Requires=weave.service
|
||||
After=weave.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
TimeoutStartSec=0
|
||||
EnvironmentFile=-/etc/weave.%H.env
|
||||
EnvironmentFile=-/etc/weave.env
|
||||
ExecStart={{ bin_dir }}/weave expose
|
||||
ExecStop={{ bin_dir }}/weave hide
|
||||
|
||||
[Install]
|
||||
WantedBy=weave-network.target
|
||||
16
roles/network_plugin/weave/templates/weaveproxy.service.j2
Normal file
16
roles/network_plugin/weave/templates/weaveproxy.service.j2
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Weave proxy for Docker API
|
||||
Documentation=http://docs.weave.works/
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/weave.%H.env
|
||||
EnvironmentFile=-/etc/weave.env
|
||||
ExecStartPre={{ bin_dir }}/weave launch-proxy $WEAVEPROXY_ARGS
|
||||
ExecStart=/usr/bin/docker attach weaveproxy
|
||||
Restart=on-failure
|
||||
ExecStop=/opt/bin/weave stop-proxy
|
||||
|
||||
[Install]
|
||||
WantedBy=weave-network.target
|
||||
Reference in New Issue
Block a user