blob: ea906cf809290971409cf0a37a3540a9bc2af094 [file] [log] [blame]
Artem Panchenko0594cd72017-06-12 13:25:26 +03001{% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
vrovachev8a882d82017-06-21 12:56:19 +04003# Change environment configuration before deploy
4
Sergii Golovatiukf648ad42017-06-23 13:39:11 +02005- description: Add workaround for linklocal incorrect installation
6 cmd: perl -pi -e 's/ipf_addresses:.*/ipf_addresses: \${_param:cluster_node01_address}/g'
7 /srv/salt/reclass/classes/system/opencontrail/client/resource/k8s_api.yml
8 node_name: {{ HOSTNAME_CFG01 }}
9 retry: {count: 1, delay: 1}
10 skip_fail: false
11
12- description: Sync time on nodes
13 cmd: salt '*' cmd.run 'service ntp stop; ntpd -gq ;
14 service ntp start; ntp-wait || exit 1'
15 node_name: {{ HOSTNAME_CFG01 }}
16 retry: {count: 2, delay: 1}
17 skip_fail: false
18
vrovachev8a882d82017-06-21 12:56:19 +040019- description: Set k8s deploy parameters
20 cmd: |
21 {% for k8s_opt, value in config.k8s_deploy.items() %}
22 {% if value|string() %}
23 salt-call reclass.cluster_meta_set {{ k8s_opt }} {{ value }};
24 {% endif %}
25 {% endfor %}
26 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 1, delay: 1}
28 skip_fail: false
29
Artem Panchenko0594cd72017-06-12 13:25:26 +030030- description: Install keepalived on primary controller
31 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
32 -C 'I@keepalived:cluster and *01*' state.sls keepalived
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 10}
35 skip_fail: true
36
37- description: Install keepalived on all controllers
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
39 -C 'I@keepalived:cluster' state.sls keepalived
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 10}
42 skip_fail: true
43
44- description: Install nginx
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@nginx:server' state.sls nginx
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
Sergii Golovatiukf648ad42017-06-23 13:39:11 +020051# Opencontrail Control Plane
Artem Panchenko0594cd72017-06-12 13:25:26 +030052- description: Install RabbitMQ
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@rabbitmq:server' state.sls rabbitmq
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 2, delay: 10}
57 skip_fail: false
58
59- description: Check RabbitMQ
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status"
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 10}
64 skip_fail: false
65
66- description: Install Opencontrail db on ctl01
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 2, delay: 20}
71 skip_fail: false
72
73- description: Install Opencontrail db on all nodes
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@opencontrail:database' state.sls opencontrail.database
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 2, delay: 20}
78 skip_fail: false
79
80- description: Install Opencontrail control on ctl01
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 5}
85 skip_fail: false
86
87- description: Install Opencontrail control on all nodes
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 5}
92 skip_fail: false
93
94- description: Install Opencontrail on collector
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 5}
99 skip_fail: false
100
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200101# OpenContrail vrouters
Artem Panchenko0594cd72017-06-12 13:25:26 +0300102- description: Install Opencontrail client
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
104 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 5}
107 skip_fail: false
108
109- description: Install Opencontrail client on computes
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
116- description: Install Opencontrail on computes
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@opencontrail:compute' state.sls 'opencontrail'
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 5}
121 skip_fail: false
122
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200123- description: Test Opencontrail
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@opencontrail:control' cmd.run 'contrail-status'
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 1, delay: 5}
128 skip_fail: false
129
130# Kubernetes
131- description: Install docker
132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
133 -C 'I@docker:host' state.sls docker.host
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 5}
136 skip_fail: false
137
138- description: Check docker
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'I@docker:host' cmd.run 'docker ps'
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: false
144
145- description: Install etcd
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@etcd:server' state.sls etcd.server.service
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: false
151
152- description: Check the etcd health
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: false
158
159- description: Install Kubernetes Addons
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 5}
164 skip_fail: true
165
166- description: Install Kubernetes components
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
168 -C 'I@kubernetes:pool' state.sls kubernetes.pool
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 3, delay: 5}
171 skip_fail: false
172
173- description: Setup etcd server on primary controller
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
175 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 1, delay: 5}
178 skip_fail: false
179
180- description: Run Kubernetes master without setup
181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
182 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: true
186
187- description: Run Kubernetes master setup
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
189 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: true
193
194- description: Restart Kubelet
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
196 -C 'I@kubernetes:pool' service.restart 'kubelet'
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 1, delay: 5}
199 skip_fail: true
200
Artem Panchenko0594cd72017-06-12 13:25:26 +0300201- description: Reboot Opencontrail compute nodes
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
203 -C 'I@opencontrail:compute' system.reboot
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 5}
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200206 skip_fail: true