blob: 51984cc314ae0812977a934fa8de52280e149d28 [file] [log] [blame]
Artem Panchenko0594cd72017-06-12 13:25:26 +03001{% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
Sergii Golovatiukf648ad42017-06-23 13:39:11 +02003- description: Sync time on nodes
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +04004 cmd: salt '*' cmd.run "service ntp stop; ntpd -gq ;
5 service ntp start; ntp-wait || exit 1"
Sergii Golovatiukf648ad42017-06-23 13:39:11 +02006 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 2, delay: 1}
Tatyana Leontovich3b04e302017-07-11 19:01:35 +03008 skip_fail: true
Sergii Golovatiukf648ad42017-06-23 13:39:11 +02009
vrovachev8a882d82017-06-21 12:56:19 +040010- description: Set k8s deploy parameters
11 cmd: |
12 {% for k8s_opt, value in config.k8s_deploy.items() %}
13 {% if value|string() %}
14 salt-call reclass.cluster_meta_set {{ k8s_opt }} {{ value }};
15 {% endif %}
16 {% endfor %}
17 node_name: {{ HOSTNAME_CFG01 }}
18 retry: {count: 1, delay: 1}
19 skip_fail: false
20
Artem Panchenko0594cd72017-06-12 13:25:26 +030021- description: Install keepalived on primary controller
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
23 -C 'I@keepalived:cluster and *01*' state.sls keepalived
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 1, delay: 10}
26 skip_fail: true
27
28- description: Install keepalived on all controllers
29 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
30 -C 'I@keepalived:cluster' state.sls keepalived
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 10}
33 skip_fail: true
34
35- description: Install nginx
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@nginx:server' state.sls nginx
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
Sergii Golovatiukf648ad42017-06-23 13:39:11 +020042# Opencontrail Control Plane
Artem Panchenko0594cd72017-06-12 13:25:26 +030043- description: Install RabbitMQ
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@rabbitmq:server' state.sls rabbitmq
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 2, delay: 10}
48 skip_fail: false
49
50- description: Check RabbitMQ
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
52 -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status"
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 10}
55 skip_fail: false
56
57- description: Install Opencontrail db on ctl01
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
59 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 2, delay: 20}
62 skip_fail: false
63
64- description: Install Opencontrail db on all nodes
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
66 -C 'I@opencontrail:database' state.sls opencontrail.database
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 2, delay: 20}
69 skip_fail: false
70
71- description: Install Opencontrail control on ctl01
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 1, delay: 5}
76 skip_fail: false
77
78- description: Install Opencontrail control on all nodes
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 1, delay: 5}
83 skip_fail: false
84
85- description: Install Opencontrail on collector
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 1, delay: 5}
90 skip_fail: false
91
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +040092- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
94 -C 'I@opencontrail:control' service.restart 'keepalived'
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 5}
97 skip_fail: false
98
Sergii Golovatiukf648ad42017-06-23 13:39:11 +020099# OpenContrail vrouters
Artem Panchenko0594cd72017-06-12 13:25:26 +0300100- description: Install Opencontrail client
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107- description: Install Opencontrail client on computes
108 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
109 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
110 node_name: {{ HOSTNAME_CFG01 }}
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400111 retry: {count: 2, delay: 5}
Artem Panchenko0594cd72017-06-12 13:25:26 +0300112 skip_fail: false
113
114- description: Install Opencontrail on computes
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
116 -C 'I@opencontrail:compute' state.sls 'opencontrail'
117 node_name: {{ HOSTNAME_CFG01 }}
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400118 retry: {count: 2, delay: 5}
Artem Panchenko0594cd72017-06-12 13:25:26 +0300119 skip_fail: false
120
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200121- description: Test Opencontrail
122 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
123 -C 'I@opencontrail:control' cmd.run 'contrail-status'
124 node_name: {{ HOSTNAME_CFG01 }}
125 retry: {count: 1, delay: 5}
126 skip_fail: false
127
128# Kubernetes
129- description: Install docker
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
131 -C 'I@docker:host' state.sls docker.host
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 5}
134 skip_fail: false
135
136- description: Check docker
137 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
138 -C 'I@docker:host' cmd.run 'docker ps'
139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 5}
141 skip_fail: false
142
143- description: Install etcd
144 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
145 -C 'I@etcd:server' state.sls etcd.server.service
146 node_name: {{ HOSTNAME_CFG01 }}
147 retry: {count: 1, delay: 5}
148 skip_fail: false
149
150- description: Check the etcd health
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
152 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 5}
155 skip_fail: false
156
157- description: Install Kubernetes Addons
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
159 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 1, delay: 5}
162 skip_fail: true
163
164- description: Install Kubernetes components
165 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
166 -C 'I@kubernetes:pool' state.sls kubernetes.pool
167 node_name: {{ HOSTNAME_CFG01 }}
168 retry: {count: 3, delay: 5}
169 skip_fail: false
170
171- description: Setup etcd server on primary controller
172 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
173 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 5}
176 skip_fail: false
177
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400178- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
180 -C 'I@kubernetes:master' service.restart 'keepalived'
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: false
184
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200185- description: Run Kubernetes master without setup
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
187 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 5}
190 skip_fail: true
191
192- description: Run Kubernetes master setup
193 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
194 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 1, delay: 5}
197 skip_fail: true
198
199- description: Restart Kubelet
200 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
201 -C 'I@kubernetes:pool' service.restart 'kubelet'
202 node_name: {{ HOSTNAME_CFG01 }}
203 retry: {count: 1, delay: 5}
204 skip_fail: true
205
Artem Panchenko0594cd72017-06-12 13:25:26 +0300206- description: Reboot Opencontrail compute nodes
207 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
208 -C 'I@opencontrail:compute' system.reboot
209 node_name: {{ HOSTNAME_CFG01 }}
210 retry: {count: 1, delay: 5}
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200211 skip_fail: true