blob: d0f7f1bd1607490d2240f6893906029d99224cf5 [file] [log] [blame]
Victor Ryzhenkina95d1732017-11-16 19:02:19 +04001{% from 'k8s-ha-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
3- description: Install etcd
4 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
5 -C 'I@etcd:server' state.sls etcd.server.service
6 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 1, delay: 5}
8 skip_fail: false
9
10- description: Check the etcd health
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 5}
15 skip_fail: false
16
17 # Opencontrail Control Plane
18
19- description: Install Opencontrail db on ctl01
20 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
21 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
22 node_name: {{ HOSTNAME_CFG01 }}
23 retry: {count: 2, delay: 20}
24 skip_fail: false
25
26- description: Install Opencontrail db on all nodes
27 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
28 -C 'I@opencontrail:database' state.sls opencontrail.database
29 node_name: {{ HOSTNAME_CFG01 }}
30 retry: {count: 2, delay: 20}
31 skip_fail: false
32
33- description: Install Opencontrail control on ctl01
34 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
35 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
36 node_name: {{ HOSTNAME_CFG01 }}
37 retry: {count: 1, delay: 5}
38 skip_fail: false
39
40- description: Install Opencontrail control on all nodes
41 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
42 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
43 node_name: {{ HOSTNAME_CFG01 }}
44 retry: {count: 1, delay: 5}
45 skip_fail: false
46
47- description: Install Opencontrail on collector
48 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
49 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 1, delay: 5}
52 skip_fail: false
53
54# OpenContrail vrouters
55- description: Install Opencontrail client
56 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
57 -C 'I@opencontrail:database:id:1' state.sls opencontrail.client
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: false
61
62- description: Install Opencontrail on computes
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
64 -C 'I@opencontrail:compute' state.sls opencontrail exclude=opencontrail.client
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 2, delay: 5}
67 skip_fail: false
68
69- description: Wake up vhost0
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@nova:compute' cmd.run 'exec 0>&-; exec 1>&-; exec 2>&-;
72 nohup bash -c "ip link | grep vhost && echo no_reboot || sleep 5 && reboot & "'
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77- description: Install Opencontrail client on computes
78 cmd: sleep 300 && salt --timeout=60 --hard-crash --state-output=mixed --state-verbose=False
79 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 1, delay: 5}
82 skip_fail: false
83
84- description: Install Opencontrail on computes #2
85 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
86 -C 'I@opencontrail:compute' state.sls opencontrail
87 node_name: {{ HOSTNAME_CFG01 }}
88 retry: {count: 2, delay: 5}
89 skip_fail: false
90
91# Kubernetes
92- description: Install Kubernetes Addons
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
94 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 5}
97 skip_fail: true
98
99- description: Install Kubernetes components
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
101 -C 'I@kubernetes:pool' state.sls kubernetes.pool
102 node_name: {{ HOSTNAME_CFG01 }}
103 retry: {count: 5, delay: 60}
104 skip_fail: false
105
106- description: Setup etcd server on primary controller
107 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
108 -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 1, delay: 5}
111 skip_fail: false
112
113- description: Run Kubernetes master without setup
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
115 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 3, delay: 5}
118 skip_fail: true
119
120- description: Run Kubernetes master setup
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
122 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 5}
125 skip_fail: true
126
127- description: Restart Kubelet
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
129 -C 'I@kubernetes:pool' service.restart 'kubelet'
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: true
133
134- description: Renew hosts file on a whole cluster
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host;
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 5}
138 skip_fail: false