committed by
GitHub
13 changed files with 161 additions and 149 deletions
Split View
Diff Options
-
3.gitlab-ci.yml
-
29roles/download/defaults/main.yml
-
3roles/kubernetes-apps/network_plugin/meta/main.yml
-
24roles/kubernetes-apps/network_plugin/weave/tasks/main.yml
-
2roles/network_plugin/weave/defaults/main.yml
-
36roles/network_plugin/weave/handlers/main.yml
-
5roles/network_plugin/weave/meta/main.yml
-
46roles/network_plugin/weave/tasks/main.yml
-
104roles/network_plugin/weave/templates/weave-kube.yml.j2
-
7roles/network_plugin/weave/templates/weave.j2
-
18roles/network_plugin/weave/templates/weave.service.j2
-
16roles/network_plugin/weave/templates/weaveexpose.service.j2
-
17roles/network_plugin/weave/templates/weaveproxy.service.j2
@ -0,0 +1,24 @@ |
|||
- name: Weave | Start Resources |
|||
run_once: true |
|||
kube: |
|||
name: "weave-kube" |
|||
kubectl: "{{ bin_dir }}/kubectl" |
|||
filename: "{{ kube_config_dir }}/weave-kube.yml" |
|||
resource: "ds" |
|||
namespace: "{{system_namespace}}" |
|||
state: "{{ item | ternary('latest','present') }}" |
|||
with_items: "{{ weave_manifest.changed }}" |
|||
|
|||
|
|||
- name: "Weave | wait for weave to become available" |
|||
uri: |
|||
url: http://127.0.0.1:6784/status |
|||
return_content: yes |
|||
register: weave_status |
|||
retries: 10 |
|||
delay: "{{ retry_stagger | random + 3 }}" |
|||
until: weave_status.status == 200 |
|||
|
|||
- name: "Weave | check if weave is ready" |
|||
fail: |
|||
when: "'Status: ready' not in weave_status.content" |
@ -1,36 +0,0 @@ |
|||
--- |
|||
- name: restart weave |
|||
command: /bin/true |
|||
notify: |
|||
- Weave | reload systemd |
|||
- reload weave |
|||
|
|||
- name : Weave | reload systemd |
|||
shell: systemctl daemon-reload |
|||
|
|||
- name: restart weaveproxy |
|||
command: /bin/true |
|||
notify: |
|||
- Weave | reload systemd |
|||
- reload weaveproxy |
|||
|
|||
- name: restart weaveexpose |
|||
command: /bin/true |
|||
notify: |
|||
- Weave | reload systemd |
|||
- reload weaveexpose |
|||
|
|||
- name: reload weave |
|||
service: |
|||
name: weave |
|||
state: restarted |
|||
|
|||
- name: reload weaveproxy |
|||
service: |
|||
name: weaveproxy |
|||
state: restarted |
|||
|
|||
- name: reload weaveexpose |
|||
service: |
|||
name: weaveexpose |
|||
state: restarted |
@ -1,5 +1,8 @@ |
|||
--- |
|||
dependencies: |
|||
- role: download |
|||
file: "{{ downloads.weave }}" |
|||
file: "{{ downloads.weave_kube }}" |
|||
tags: download |
|||
- role: download |
|||
file: "{{ downloads.weave_npc }}" |
|||
tags: download |
@ -0,0 +1,104 @@ |
|||
--- |
|||
apiVersion: extensions/v1beta1 |
|||
kind: DaemonSet |
|||
metadata: |
|||
name: weave-net |
|||
namespace: {{ system_namespace }} |
|||
labels: |
|||
version: {{ weave_version }} |
|||
spec: |
|||
template: |
|||
metadata: |
|||
labels: |
|||
name: weave-net |
|||
annotations: |
|||
scheduler.alpha.kubernetes.io/tolerations: | |
|||
[ |
|||
{ |
|||
"key": "dedicated", |
|||
"operator": "Equal", |
|||
"value": "master", |
|||
"effect": "NoSchedule" |
|||
} |
|||
] |
|||
spec: |
|||
hostNetwork: true |
|||
hostPID: true |
|||
containers: |
|||
- name: weave |
|||
image: {{ weave_kube_image_repo }}:{{ weave_kube_image_tag }} |
|||
imagePullPolicy: Always |
|||
command: |
|||
- /home/weave/launch.sh |
|||
env: |
|||
- name: IPALLOC_RANGE |
|||
value: {{ kube_pods_subnet }} |
|||
{% if weave_checkpoint_disable is defined %} |
|||
- name: CHECKPOINT_DISABLE |
|||
value: {{ weave_checkpoint_disable }} |
|||
{% endif %} |
|||
{% if weave_expect_npc is defined %} |
|||
- name: EXPECT_NPC |
|||
value: {{ weave_expect_npc }} |
|||
{% endif %} |
|||
{% if weave_kube_peers is defined %} |
|||
- name: KUBE_PEERS |
|||
value: {{ weave_kube_peers }} |
|||
{% endif %} |
|||
{% if weave_ipalloc_init is defined %} |
|||
- name: IPALLOC_INIT |
|||
value: {{ weave_ipalloc_init }} |
|||
{% endif %} |
|||
{% if weave_expose_ip is defined %} |
|||
- name: WEAVE_EXPOSE_IP |
|||
value: {{ weave_expose_ip }} |
|||
{% endif %} |
|||
livenessProbe: |
|||
initialDelaySeconds: 30 |
|||
httpGet: |
|||
host: 127.0.0.1 |
|||
path: /status |
|||
port: 6784 |
|||
securityContext: |
|||
privileged: true |
|||
volumeMounts: |
|||
- name: weavedb |
|||
mountPath: /weavedb |
|||
- name: cni-bin |
|||
mountPath: /opt |
|||
- name: cni-bin2 |
|||
mountPath: /host_home |
|||
- name: cni-conf |
|||
mountPath: /etc |
|||
resources: |
|||
requests: |
|||
cpu: {{ weave_cpu_requests }} |
|||
memory: {{ weave_memory_requests }} |
|||
limits: |
|||
cpu: {{ weave_cpu_limit }} |
|||
memory: {{ weave_memory_limit }} |
|||
- name: weave-npc |
|||
image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }} |
|||
imagePullPolicy: Always |
|||
resources: |
|||
requests: |
|||
cpu: {{ weave_cpu_requests }} |
|||
memory: {{ weave_memory_requests }} |
|||
limits: |
|||
cpu: {{ weave_cpu_limit }} |
|||
memory: {{ weave_memory_limit }} |
|||
securityContext: |
|||
privileged: true |
|||
restartPolicy: Always |
|||
volumes: |
|||
- name: weavedb |
|||
emptyDir: {} |
|||
- name: cni-bin |
|||
hostPath: |
|||
path: /opt |
|||
- name: cni-bin2 |
|||
hostPath: |
|||
path: /home |
|||
- name: cni-conf |
|||
hostPath: |
|||
path: /etc |
@ -1,7 +0,0 @@ |
|||
WEAVE_DOCKER_ARGS="--memory={{ weave_memory_limit|regex_replace('Mi', 'M') }} --cpu-shares={{ weave_cpu_limit|regex_replace('m', '') }}" |
|||
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" |
|||
WEAVE_SUBNET="--ipalloc-range {{ kube_pods_subnet }}" |
|||
{% if weave_password is defined %} |
|||
WEAVE_PASSWORD="{{ weave_password }}" |
|||
{% endif %} |
@ -1,18 +0,0 @@ |
|||
[Unit] |
|||
Description=Weave Network |
|||
Documentation=http://docs.weave.works/weave/latest_release/ |
|||
Wants=docker.socket |
|||
After=docker.service docker.socket |
|||
|
|||
[Service] |
|||
EnvironmentFile=-/etc/weave.env |
|||
ExecStartPre=-{{ docker_bin_dir }}/docker rm -f weave |
|||
ExecStartPre={{ bin_dir }}/weave launch-router \ |
|||
$WEAVE_SUBNET \ |
|||
$WEAVE_PEERS |
|||
ExecStart={{ docker_bin_dir }}/docker attach weave |
|||
ExecStop={{ bin_dir }}/weave stop |
|||
Restart=on-failure |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -1,16 +0,0 @@ |
|||
[Unit] |
|||
Documentation=http://docs.weave.works/ |
|||
Wants=docker.socket weave.service |
|||
After=docker.service docker.socket weave.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 |
@ -1,17 +0,0 @@ |
|||
[Unit] |
|||
Description=Weave proxy for Docker API |
|||
Documentation=http://docs.weave.works/ |
|||
Wants=docker.socket |
|||
After=docker.service docker.socket |
|||
|
|||
[Service] |
|||
EnvironmentFile=-/etc/weave.%H.env |
|||
EnvironmentFile=-/etc/weave.env |
|||
ExecStartPre=-{{ docker_bin_dir }}/docker rm -f weaveproxy |
|||
ExecStartPre={{ bin_dir }}/weave launch-proxy $WEAVEPROXY_ARGS |
|||
ExecStart={{ docker_bin_dir }}/docker attach weaveproxy |
|||
Restart=on-failure |
|||
ExecStop={{ bin_dir }}/weave stop-proxy |
|||
|
|||
[Install] |
|||
WantedBy=weave-network.target |
Write
Preview
Loading…
Cancel
Save