forked from infraly/k8s-on-openstack
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsite.yaml
85 lines (76 loc) · 1.72 KB
/
site.yaml
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
---
- name: Launch k8s master
hosts: localhost
pre_tasks:
- name: Set variables
set_fact:
name: "{{ lookup('env','NAME') | default('k8s', true) }}"
state: "{{ lookup('env','STATE') | default('present', true) }}"
node_count: "{{ lookup('env', 'NODE_COUNT') | default(3, true) }}"
roles:
- { role: openstack-security-groups, when: state == 'present' }
- openstack-master
- name: Master preparation
hosts: master
pre_tasks:
- name: Set variables
set_fact:
name: "{{ lookup('env','NAME') | default('k8s', true) }}"
state: "{{ lookup('env','STATE') | default('present', true) }}"
tags:
- bootstrap
gather_facts: false
roles:
- common
- name: Launch k8s nodes
hosts: localhost
roles:
- openstack-nodes
- openstack-security-groups # HACK: needs to be called after instance creation when state==absent
- name: Nodes preparation
hosts: nodes
pre_tasks:
- name: Set variables
set_fact:
name: "{{ lookup('env','NAME') | default('k8s', true) }}"
state: "{{ lookup('env','STATE') | default('present', true) }}"
tags:
- bootstrap
gather_facts: false
roles:
- common
- name: Install repo and packages
hosts: all
tags:
- bootstrap
become: true
roles:
- kubeadm
- name: k8s master setup
hosts: master
tags:
- bootstrap
become: true
roles:
- kubeadm-master
- name: k8s nodes setup
hosts: nodes
become: true
tags:
- bootstrap
roles:
- kubeadm-nodes
- name: k8s addons
hosts: master
tags:
- bootstrap
roles:
- k8s-addons
- name: Health check
hosts: master
roles:
- healthcheck
- name: Local kubectl configuration
hosts: master
roles:
- kubectl