blob: 2f987448ff54b9940f1bc7b1962a0d9229b19d62 [file] [log] [blame]
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +03001{% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +02003- description: Temporary fix to untie k8s API from Opencontrail haproxy
4 That allows kube-api to be available over private network.
5 cmd: sed -i "s/vhost0/ens4/g" /srv/salt/reclass/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/control.yml
6 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 1, delay: 5}
8 skip_fail: true
9
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030010# Install support services
11- description: Create and distribute SSL certificates for services using salt state
12 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls salt
13 node_name: {{ HOSTNAME_CFG01 }}
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +020014 retry: {count: 1, delay: 5}
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030015 skip_fail: true
16
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +030017- description: Install glusterfs
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@glusterfs:server' state.sls glusterfs.server.service
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 5}
22 skip_fail: false
23
24- description: Setup glusterfs on primary controller
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
31- description: Check the gluster status
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 5}
36 skip_fail: false
37
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030038- description: Install haproxy
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@haproxy:proxy' state.sls haproxy
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +020045- description: Check haproxy service
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030046 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@haproxy:proxy' service.status haproxy
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +020052- description: Restart rsyslog
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@haproxy:proxy' service.restart rsyslog
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false
58
59#Kubernetes
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030060- description: Install docker
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
62 -C 'I@docker:host' state.sls docker.host
63 node_name: {{ HOSTNAME_CFG01 }}
64 retry: {count: 1, delay: 5}
65 skip_fail: false
66
67- description: Check docker
68 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
69 -C 'I@docker:host' cmd.run 'docker ps'
70 node_name: {{ HOSTNAME_CFG01 }}
71 retry: {count: 1, delay: 5}
72 skip_fail: false
73
74- description: Install etcd
75 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
76 -C 'I@etcd:server' state.sls etcd.server.service
77 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: false
80
81- description: Check the etcd health
82 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
83 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
84 node_name: {{ HOSTNAME_CFG01 }}
85 retry: {count: 1, delay: 5}
86 skip_fail: false
87
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +020088- description: Install keepalived on primary controller
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +030089 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +020090 -C 'I@keepalived:cluster and *01*' state.sls keepalived
91 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 10}
93 skip_fail: true
94
95- description: Install keepalived on all controllers
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@keepalived:cluster' state.sls keepalived
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 10}
100 skip_fail: true
101
102- description: Install nginx
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
104 -C 'I@nginx:server' state.sls nginx
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 5}
107 skip_fail: false
108
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200109- description: Install Kubernetes Addons
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200111 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: true
115
116- description: Install Kubernetes components
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@kubernetes:pool' state.sls kubernetes.pool
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 5}
121 skip_fail: false
122
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200123- description: Setup etcd server on primary controller
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 1, delay: 5}
128 skip_fail: false
129
130- description: Run Kubernetes master without setup
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 1, delay: 5}
135 skip_fail: true
136
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200137- description: Run Kubernetes master setup
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300139 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 1, delay: 5}
142 skip_fail: true
143
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200144- description: Restart Kubelet
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200146 -C 'I@kubernetes:pool' service.restart 'kubelet'
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200149 skip_fail: true
150
151# Opencontrail
152- description: Install RabbitMQ
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@rabbitmq:server' state.sls rabbitmq
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 2, delay: 10}
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300157 skip_fail: false
158
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200159- description: Check RabbitMQ
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status"
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 10}
164 skip_fail: false
165
166- description: Install Opencontrail db on ctl01
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
168 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 2, delay: 20}
171 skip_fail: false
172
173- description: Install Opencontrail db on all nodes
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300175 -C 'I@opencontrail:database' state.sls opencontrail.database
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 2, delay: 20}
178 skip_fail: false
179
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200180- description: Install Opencontrail control on ctl01
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300182 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: false
186
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200187- description: Install Opencontrail control on all nodes
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300189 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: false
193
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200194- description: Install Opencontrail on collector
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
196 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 1, delay: 5}
199 skip_fail: false
200
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200201- description: Test Opencontrail
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200203 -C 'I@opencontrail:control' cmd.run 'contrail-status'
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 5}
206 skip_fail: false
207
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200208- description: Install Opencontrail client
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200210 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 5}
213 skip_fail: false
214
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200215- description: Install Opencontrail client on computes
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200217 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
Tatyana Leontovich508d0cb2017-05-26 15:46:24 +0300218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 5}
220 skip_fail: false
221
Sergii Golovatiuk8f679ab2017-06-02 13:13:53 +0200222- description: Install Opencontrail on computes
223 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
224 -C 'I@opencontrail:compute' state.sls 'opencontrail'
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 5}
227 skip_fail: false
228
229- description: Reboot Opencontrail compute nodes
230 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
231 -C 'I@opencontrail:compute' system.reboot
Tatyana Leontovichbb6d1a72017-05-17 14:10:38 +0300232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 5}
234 skip_fail: false