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
backup: yes
when: init_system == "systemd"
notify: restart systemd-etcd
notify: restart etcd
- name: Configure | Write etcd initd script
template:

View file

@ -58,15 +58,6 @@
backup: yes
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
template:
src: "kube-apiserver.j2"
@ -74,11 +65,14 @@
backup: yes
notify: restart kube-apiserver
# restart apiserver if calico tokens list has changed
- name: Reload tokens (restart apiserver)
command: /bin/true
- 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: Restart apiserver
command: "/bin/true"
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
- meta: flush_handlers
@ -105,7 +99,6 @@
- name: wait for the apiserver to be running
wait_for:
port: "{{kube_apiserver_insecure_port}}"
delay: 10
timeout: 60
- name: Create 'kube-system' namespace
@ -128,3 +121,15 @@
template:
src: manifests/kube-podmaster.manifest.j2
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
notify:
- reload systemd
- reload kubelet
- restart kubelet
- name: set is_gentoken_calico fact
set_fact:

View file

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