You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. ---
  2. - include: pre-upgrade.yml
  3. - name: Copy kubectl bash completion
  4. copy:
  5. src: kubectl_bash_completion.sh
  6. dest: /etc/bash_completion.d/kubectl.sh
  7. when: ansible_os_family in ["Debian","RedHat"]
  8. - name: Copy kubectl from hyperkube container
  9. command: "/usr/bin/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp /hyperkube /systembindir/kubectl"
  10. changed_when: false
  11. register: kubectl_launcher
  12. - meta: flush_handlers
  13. - name: Write kube-apiserver manifest
  14. template:
  15. src: manifests/kube-apiserver.manifest.j2
  16. dest: "{{ kube_manifest_dir }}/kube-apiserver.manifest"
  17. register: apiserver_manifest
  18. notify: Master | restart kubelet
  19. - name: wait for the apiserver to be running
  20. uri: url=http://localhost:8080/healthz
  21. register: result
  22. until: result.status == 200
  23. retries: 10
  24. delay: 6
  25. # Create kube-system namespace
  26. - name: copy 'kube-system' namespace manifest
  27. copy: src=namespace.yml dest=/etc/kubernetes/kube-system-ns.yml
  28. run_once: yes
  29. when: inventory_hostname == groups['kube-master'][0]
  30. - name: Check if kube-system exists
  31. command: "{{ bin_dir }}/kubectl get ns kube-system"
  32. register: 'kubesystem'
  33. changed_when: False
  34. failed_when: False
  35. run_once: yes
  36. - name: Create 'kube-system' namespace
  37. command: "{{ bin_dir }}/kubectl create -f /etc/kubernetes/kube-system-ns.yml"
  38. changed_when: False
  39. when: kubesystem|failed and inventory_hostname == groups['kube-master'][0]
  40. # Write other manifests
  41. - name: Write kube-controller-manager manifest
  42. template:
  43. src: manifests/kube-controller-manager.manifest.j2
  44. dest: "{{ kube_manifest_dir }}/kube-controller-manager.manifest"
  45. notify: wait for kube-controller-manager
  46. - name: Write kube-scheduler manifest
  47. template:
  48. src: manifests/kube-scheduler.manifest.j2
  49. dest: "{{ kube_manifest_dir }}/kube-scheduler.manifest"
  50. notify: wait for kube-scheduler