blob: 725e21e35f996ffb5d69634a06638b318fe5bc8a [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
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +04006 cmd: sed -i "s/ipf_addresses:.*/ipf_addresses:\ \${_param:cluster_node01_address}/g"
7 /srv/salt/reclass/classes/system/opencontrail/client/resource/k8s_api.yml
Sergii Golovatiukf648ad42017-06-23 13:39:11 +02008 node_name: {{ HOSTNAME_CFG01 }}
9 retry: {count: 1, delay: 1}
10 skip_fail: false
11
12- description: Sync time on nodes
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +040013 cmd: salt '*' cmd.run "service ntp stop; ntpd -gq ;
14 service ntp start; ntp-wait || exit 1"
Sergii Golovatiukf648ad42017-06-23 13:39:11 +020015 node_name: {{ HOSTNAME_CFG01 }}
16 retry: {count: 2, delay: 1}
Tatyana Leontovich3b04e302017-07-11 19:01:35 +030017 skip_fail: true
Sergii Golovatiukf648ad42017-06-23 13:39:11 +020018
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
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400101- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@opencontrail:control' service.restart 'keepalived'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: false
107
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200108# OpenContrail vrouters
Artem Panchenko0594cd72017-06-12 13:25:26 +0300109- description: Install Opencontrail client
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
116- description: Install Opencontrail client on computes
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
119 node_name: {{ HOSTNAME_CFG01 }}
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400120 retry: {count: 2, delay: 5}
Artem Panchenko0594cd72017-06-12 13:25:26 +0300121 skip_fail: false
122
123- description: Install Opencontrail on computes
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@opencontrail:compute' state.sls 'opencontrail'
126 node_name: {{ HOSTNAME_CFG01 }}
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400127 retry: {count: 2, delay: 5}
Artem Panchenko0594cd72017-06-12 13:25:26 +0300128 skip_fail: false
129
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200130- description: Test Opencontrail
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@opencontrail:control' cmd.run 'contrail-status'
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 1, delay: 5}
135 skip_fail: false
136
137# Kubernetes
138- description: Install docker
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'I@docker:host' state.sls docker.host
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: false
144
145- description: Check docker
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@docker:host' cmd.run 'docker ps'
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: false
151
152- description: Install etcd
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@etcd:server' state.sls etcd.server.service
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: false
158
159- description: Check the etcd health
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 5}
164 skip_fail: false
165
166- description: Install Kubernetes Addons
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
168 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 1, delay: 5}
171 skip_fail: true
172
173- description: Install Kubernetes components
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
175 -C 'I@kubernetes:pool' state.sls kubernetes.pool
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 3, delay: 5}
178 skip_fail: false
179
180- description: Setup etcd server on primary controller
181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
182 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: false
186
Victor Ryzhenkin43c0d0e2017-07-07 19:53:25 +0400187- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
189 -C 'I@kubernetes:master' service.restart 'keepalived'
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: false
193
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200194- description: Run Kubernetes master without setup
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
196 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 1, delay: 5}
199 skip_fail: true
200
201- description: Run Kubernetes master setup
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
203 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 5}
206 skip_fail: true
207
208- description: Restart Kubelet
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
210 -C 'I@kubernetes:pool' service.restart 'kubelet'
211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 5}
213 skip_fail: true
214
Artem Panchenko0594cd72017-06-12 13:25:26 +0300215- description: Reboot Opencontrail compute nodes
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
217 -C 'I@opencontrail:compute' system.reboot
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 5}
Sergii Golovatiukf648ad42017-06-23 13:39:11 +0200220 skip_fail: true