blob: 9813f3230f11f0274620e4289795ededd92e3498 [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
5- description: Set k8s deploy parameters
6 cmd: |
7 {% for k8s_opt, value in config.k8s_deploy.items() %}
8 {% if value|string() %}
9 salt-call reclass.cluster_meta_set {{ k8s_opt }} {{ value }};
10 {% endif %}
11 {% endfor %}
12 node_name: {{ HOSTNAME_CFG01 }}
13 retry: {count: 1, delay: 1}
14 skip_fail: false
15
Artem Panchenko0594cd72017-06-12 13:25:26 +030016#Kubernetes
17- description: Install docker
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@docker:host' state.sls docker.host
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 5}
22 skip_fail: false
23
24- description: Check docker
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@docker:host' cmd.run 'docker ps'
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
31- description: Install etcd
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@etcd:server' state.sls etcd.server.service
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 5}
36 skip_fail: false
37
38- description: Check the etcd health
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
45- description: Install keepalived on primary controller
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@keepalived:cluster and *01*' state.sls keepalived
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 10}
50 skip_fail: true
51
52- description: Install keepalived on all controllers
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@keepalived:cluster' state.sls keepalived
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 10}
57 skip_fail: true
58
59- description: Install nginx
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@nginx:server' state.sls nginx
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: Install Kubernetes Addons
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 5}
71 skip_fail: true
72
73- description: Install Kubernetes components
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@kubernetes:pool' state.sls kubernetes.pool
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
80- description: Setup etcd server on primary controller
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 5}
85 skip_fail: false
86
87- description: Run Kubernetes master without setup
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 5}
92 skip_fail: true
93
94- description: Run Kubernetes master setup
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 5}
99 skip_fail: true
100
101- description: Restart Kubelet
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@kubernetes:pool' service.restart 'kubelet'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: true
107
108# Opencontrail
109- description: Install RabbitMQ
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@rabbitmq:server' state.sls rabbitmq
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 2, delay: 10}
114 skip_fail: false
115
116- description: Check RabbitMQ
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status"
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 10}
121 skip_fail: false
122
123- description: Install Opencontrail db on ctl01
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 2, delay: 20}
128 skip_fail: false
129
130- description: Install Opencontrail db on all nodes
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@opencontrail:database' state.sls opencontrail.database
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 2, delay: 20}
135 skip_fail: false
136
137- description: Install Opencontrail control on ctl01
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
139 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 1, delay: 5}
142 skip_fail: false
143
144- description: Install Opencontrail control on all nodes
145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
146 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
149 skip_fail: false
150
151- description: Install Opencontrail on collector
152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
153 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
154 node_name: {{ HOSTNAME_CFG01 }}
155 retry: {count: 1, delay: 5}
156 skip_fail: false
157
158- description: Test Opencontrail
159 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
160 -C 'I@opencontrail:control' cmd.run 'contrail-status'
161 node_name: {{ HOSTNAME_CFG01 }}
162 retry: {count: 1, delay: 5}
163 skip_fail: false
164
165- description: Install Opencontrail client
166 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
167 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
168 node_name: {{ HOSTNAME_CFG01 }}
169 retry: {count: 1, delay: 5}
170 skip_fail: false
171
172- description: Install Opencontrail client on computes
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
174 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
175 node_name: {{ HOSTNAME_CFG01 }}
176 retry: {count: 1, delay: 5}
177 skip_fail: false
178
179- description: Install Opencontrail on computes
180 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
181 -C 'I@opencontrail:compute' state.sls 'opencontrail'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 5}
184 skip_fail: false
185
186- description: Reboot Opencontrail compute nodes
187 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
188 -C 'I@opencontrail:compute' system.reboot
189 node_name: {{ HOSTNAME_CFG01 }}
190 retry: {count: 1, delay: 5}
191 skip_fail: false
192
193# Run conformance tests
194- description: Run tests
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run "docker run --rm --net=host -e API_SERVER='http://127.0.0.1:8080' docker-dev-virtual.docker.mirantis.net/mirantis/kubernetes/k8s-conformance:v1.6.1-1_1491395924598 >> e2e.output"
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 5}
198 skip_fail: false