blob: d559d73d4fd7e0cd2ace13f8a61b62dd99e8ff8c [file] [log] [blame]
Dmitry Tyzhnenko7c7b7d82018-07-20 15:35:07 +03001{% from 'cookied-bm-mcp-pike-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
3- description: Install keepalived on primary controller
4 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
5 -C 'I@keepalived:cluster and *01*' state.sls keepalived
6 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 1, delay: 10}
8 skip_fail: false
9
10- description: Install keepalived
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@keepalived:cluster' state.sls keepalived
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 10}
15 skip_fail: false
16
17- description: Install haproxy
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@haproxy:proxy' state.sls haproxy
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 5}
22 skip_fail: false
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030023
24- description: Install etcd
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@etcd:server' state.sls etcd.server.service
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
Dmitry Tyzhnenko7c7b7d82018-07-20 15:35:07 +030031- description: Install certs
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudzc8e0f482018-08-22 22:42:07 +030033 -C 'I@etcd:server' salt.minion -b 1
Dmitry Tyzhnenko7c7b7d82018-07-20 15:35:07 +030034 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 2, delay: 5}
36 skip_fail: false
37
sgudzc8e0f482018-08-22 22:42:07 +030038- description: Install etcd
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@etcd:server' state.sls etcd.server.service
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030045- description: Check the etcd health
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: Install Kubernetes Addons
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
Dmitry Tyzhnenko7c7b7d82018-07-20 15:35:07 +030057 skip_fail: false
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030058
59- description: Install Kubernetes components
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@kubernetes:pool' state.sls kubernetes.pool
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 5, delay: 60}
64 skip_fail: false
65
66# Opencontrail Control Plane
67
68- description: Create configuration files for OpenContrail
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
70 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 1, delay: 5}
73 skip_fail: false
74
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030075- description: Configure OpenContrail as an add-on for Kubernetes
76 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
77 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
78 node_name: {{ HOSTNAME_CFG01 }}
79 retry: {count: 1, delay: 5}
80 skip_fail: true
81
82- description: Verify the status of the OpenContrail service
83 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
84 -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 5}
87 skip_fail: true
88
89- description: Set up the OpenContrail resources
90 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
91 -C 'I@opencontrail:database:id:1' state.sls opencontrail.client
92 node_name: {{ HOSTNAME_CFG01 }}
93 retry: {count: 1, delay: 5}
94 skip_fail: false
95
96# OpenContrail vrouters
97- description: Refresh pillars on cmp*
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
99 -C 'cmp*' saltutil.refresh_pillar
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 1, delay: 5}
102 skip_fail: false
103
104- description: Sync all on contrail computes
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
106 -C 'I@opencontrail:compute' saltutil.sync_all
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 1, delay: 5}
109 skip_fail: false
110
111- description: Apply highstate on contrail computes
112 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
113 -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client
114 node_name: {{ HOSTNAME_CFG01 }}
115 retry: {count: 1, delay: 5}
116 skip_fail: false
117
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +0300118- description: Reboot contrail computes
119 cmd: salt --timeout=600 -C 'I@opencontrail:compute' system.reboot
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 30}
122 skip_fail: true
123
124- description: Apply opencontrail.client on contrail computes
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@opencontrail:compute' state.sls opencontrail.client
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 1, delay: 5}
129 skip_fail: false
130
131- description: Run Kubernetes master without setup
132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
133 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 3, delay: 5}
136 skip_fail: true
137
138- description: Run Kubernetes master setup
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: true
144
145- description: Restart Kubelet
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@kubernetes:pool' service.restart 'kubelet'
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: true
151
152- description: Check nodes registrations
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@kubernetes:pool' cmd.run 'sleep 60; kubectl get nodes'
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: true
158
159- description: Renew hosts file on a whole cluster
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host;
161 node_name: {{ HOSTNAME_CFG01 }}
162 retry: {count: 1, delay: 5}
163 skip_fail: false