mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Install Kubernetes 1.11 and go back to Ubuntu Xenial until Bionic is officially supported
This commit is contained in:
parent
5acc7652a9
commit
bf83e675f2
26 changed files with 765 additions and 7 deletions
31
roles/kubernetes/tasks/kubeadm-worker.yml
Normal file
31
roles/kubernetes/tasks/kubeadm-worker.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
- name: Checking if kube-proxy is Running
|
||||
shell: "ps -ef | grep [k]ube-proxy"
|
||||
register: kube_proxy_running
|
||||
ignore_errors: True
|
||||
|
||||
- block:
|
||||
- name: Joining cluster on other nodes
|
||||
shell: |
|
||||
kubeadm join \
|
||||
--token="{{ hostvars[initial_master].kubeadm_token }}" \
|
||||
{{ item.ipv4 }}:{{ item.port }} \
|
||||
{%- if kubeadm_ignore_preflight_errors | length > 0 %}
|
||||
--ignore-preflight-errors={{ kubeadm_ignore_preflight_errors }} \
|
||||
{% endif %}
|
||||
--discovery-token-unsafe-skip-ca-verification
|
||||
register: kubeadm_output
|
||||
failed_when: "'This node has joined the cluster' not in kubeadm_output.stdout"
|
||||
when: item.when | bool == True
|
||||
with_items:
|
||||
- ipv4: "{{ api_floating_ip }}"
|
||||
port: "{{ api_floating_port }}"
|
||||
when: "{{ groups.k8s_masters | length > 1 }}"
|
||||
- ipv4: "{{ hostvars[initial_master].vpn_ip }}"
|
||||
port: 6443
|
||||
when: "{{ groups.k8s_masters | length == 1 }}"
|
||||
|
||||
- name: Kubeadm output
|
||||
debug: var=kubeadm_output
|
||||
|
||||
when: "'/usr/local/bin/kube-proxy' not in kube_proxy_running.stdout"
|
||||
Loading…
Add table
Add a link
Reference in a new issue