Browse Source

Merge pull request #45 from jcsirot/fix-calico-systemd

Fix calico with systemd
pull/57/head
Smaine Kahlouch 8 years ago
parent
commit
0b17a4c00f
3 changed files with 3 additions and 4 deletions
  1. 2
      roles/network_plugin/tasks/calico.yml
  2. 4
      roles/network_plugin/templates/calico/calico-node.service.j2
  3. 1
      roles/network_plugin/templates/calico/calico.conf.j2

2
roles/network_plugin/tasks/calico.yml

@ -57,7 +57,7 @@
- name: Calico | Write calico-node systemd init file
template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
when: init_system == "systemd"
notify: restart calico-node
notify: restart systemd-calico-node
- name: Calico | Write calico-node initd script
template: src=calico/deb-calico.initd.j2 dest=/etc/init.d/calico-node owner=root mode=755

4
roles/network_plugin/templates/calico/calico-node.service.j2

@ -8,9 +8,9 @@ After=docker.service etcd2.service
User=root
PermissionsStartOnly=true
{% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%}
ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip=${DEFAULT_IPV4} --as={{ local_as }} --detach=false
ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip={{ip | default(ansible_default_ipv4.address) }} --as={{ local_as }} --detach=false
{% else %}
ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip=${DEFAULT_IPV4} --detach=false
ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip={{ip | default(ansible_default_ipv4.address) }} --detach=false
{% endif %}
Restart=always
Restart=10

1
roles/network_plugin/templates/calico/calico.conf.j2

@ -1,6 +1,5 @@
[config]
CALICO_IPAM=true
DEFAULT_IPV4={{ip | default(ansible_default_ipv4.address) }}
# Location of etcd cluster used by Calico. By default, this uses the etcd
# instance running on the Kubernetes Master

Loading…
Cancel
Save