-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster.yml.contiv
104 lines (94 loc) · 2.2 KB
/
cluster.yml.contiv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
- hosts: localhost
gather_facts: false
roles:
- role: admission_token
tags:
- token
tasks:
- debug:
var: admission_token
tags:
- token
- hosts: cluster
become: true
roles:
- role: nodes_prep
tags:
- master
- nodes
- hosts: master
become: true
roles:
- role: kubeadm_install
tags:
- master
tasks:
- debug:
var: kubeadm_install.stdout_lines
- hosts: devbox
become: true
tasks:
- name: copy certs to devbox
copy:
src: /root/admin.conf
dest: /root/
mode: 0666
register: certs_dup
tags:
- devbox
- debug:
var: certs_dup.stdout_lines
# Implements Step 3 of http://kubernetes.io/docs/getting-started-guides/kubeadm/
- hosts: nodes
become: true
tasks:
- name: Join nodes to cluster
command: kubeadm join --token {{ hostvars.localhost.admission_token }} {{ master_ip }}:6443 --skip-preflight-checks
args:
creates: /etc/kubernetes/kubelet.conf
register: node_join
ignore_errors: true
- debug:
var: node_join.stdout_lines
- name: reload kubelet service
command: service kubelet restart
register: node_kubelet
ignore_errors: true
tags:
- nodes
- master
- hosts: master
become: true
roles:
- { role: contiv_install, tags: master }
tasks:
- debug:
var: contiv_install.stdout_lines
- hosts: master
become: true
tasks:
- name: start kubectl proxy
command: kubectl proxy --kubeconfig /etc/kubernetes/admin.conf --address=0.0.0.0 --port=8001 --accept-hosts=^*$ &
async: 2592000
poll: 0
register: kube_proxy
tags:
- master
- name: Wait for Kube-DNS pod running
shell: "kubectl --kubeconfig /etc/kubernetes/admin.conf get pods --all-namespaces | grep kube-dns"
register: result
until: result.stdout.find("Running") != -1
retries: 30
delay: 10
tags:
- master
- hosts: master
become: true
roles:
- role: kube_dashboard
tags: master
- hosts: master
become: true
roles:
- role: istio_install
tags: master