Merge pull request #95 from Smana/fix_ha_apiserver

workaround_ha_apiserver
This commit is contained in:
Smaine Kahlouch 2016-01-25 13:01:03 +01:00
commit 87fa167efa
4 changed files with 22 additions and 17 deletions

View file

@ -5,7 +5,7 @@
dest: /lib/systemd/system/etcd.service dest: /lib/systemd/system/etcd.service
backup: yes backup: yes
when: init_system == "systemd" when: init_system == "systemd"
notify: restart systemd-etcd notify: restart etcd
- name: Configure | Write etcd initd script - name: Configure | Write etcd initd script
template: template:

View file

@ -58,15 +58,6 @@
backup: yes backup: yes
when: init_system == "sysvinit" and ansible_os_family == "Debian" when: init_system == "sysvinit" and ansible_os_family == "Debian"
- name: Restart apiserver
command: /bin/true
notify: restart kube-apiserver
changed_when: is_gentoken_calico|default(false) or kube_apiserver_copy.stdout_lines
- name: Allow apiserver to bind on both secure and insecure ports
shell: setcap cap_net_bind_service+ep {{ bin_dir }}/kube-apiserver
changed_when: false
- name: Write kube-apiserver config file - name: Write kube-apiserver config file
template: template:
src: "kube-apiserver.j2" src: "kube-apiserver.j2"
@ -74,11 +65,14 @@
backup: yes backup: yes
notify: restart kube-apiserver notify: restart kube-apiserver
# restart apiserver if calico tokens list has changed - name: Allow apiserver to bind on both secure and insecure ports
- name: Reload tokens (restart apiserver) shell: setcap cap_net_bind_service+ep {{ bin_dir }}/kube-apiserver
command: /bin/true changed_when: false
- name: Restart apiserver
command: "/bin/true"
notify: restart kube-apiserver notify: restart kube-apiserver
changed_when: is_gentoken_calico|default(false) when: is_gentoken_calico|default(false) or kube_apiserver_copy.stdout_lines
# reload-systemd # reload-systemd
- meta: flush_handlers - meta: flush_handlers
@ -105,7 +99,6 @@
- name: wait for the apiserver to be running - name: wait for the apiserver to be running
wait_for: wait_for:
port: "{{kube_apiserver_insecure_port}}" port: "{{kube_apiserver_insecure_port}}"
delay: 10
timeout: 60 timeout: 60
- name: Create 'kube-system' namespace - name: Create 'kube-system' namespace
@ -128,3 +121,15 @@
template: template:
src: manifests/kube-podmaster.manifest.j2 src: manifests/kube-podmaster.manifest.j2
dest: "{{ kube_manifest_dir }}/kube-podmaster.manifest" dest: "{{ kube_manifest_dir }}/kube-podmaster.manifest"
- name: restart kubelet
service:
name: kubelet
state: restarted
changed_when: false
- name: Enable apiserver
service:
name: kube-apiserver
enabled: yes
state: started

View file

@ -7,7 +7,7 @@
command: /bin/true command: /bin/true
notify: notify:
- reload systemd - reload systemd
- reload kubelet - restart kubelet
- name: set is_gentoken_calico fact - name: set is_gentoken_calico fact
set_fact: set_fact:

View file

@ -2,7 +2,7 @@
- name: install | Write kubelet systemd init file - name: install | Write kubelet systemd init file
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service backup=yes template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service backup=yes
when: init_system == "systemd" when: init_system == "systemd"
notify: restart systemd-kubelet notify: restart kubelet
- name: install | Write kubelet initd script - name: install | Write kubelet initd script
template: src=deb-kubelet.initd.j2 dest=/etc/init.d/kubelet owner=root mode=755 backup=yes template: src=deb-kubelet.initd.j2 dest=/etc/init.d/kubelet owner=root mode=755 backup=yes