blob: bbe312662f0ec73dce50ad42e74184ff101e9c3f [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
33 -C 'I@etcd:server' salt.minion.cert,etcd.server.service -b 1
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 2, delay: 5}
36 skip_fail: false
37
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030038- 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 Kubernetes Addons
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
Dmitry Tyzhnenko7c7b7d82018-07-20 15:35:07 +030050 skip_fail: false
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030051
52- description: Install Kubernetes components
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@kubernetes:pool' state.sls kubernetes.pool
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 5, delay: 60}
57 skip_fail: false
58
59# Opencontrail Control Plane
60
61- description: Create configuration files for OpenContrail
62 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
63 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
66 skip_fail: false
67
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +030068- description: Configure OpenContrail as an add-on for Kubernetes
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
70 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 1, delay: 5}
73 skip_fail: true
74
75- description: Verify the status of the OpenContrail service
76 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
77 -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
78 node_name: {{ HOSTNAME_CFG01 }}
79 retry: {count: 1, delay: 5}
80 skip_fail: true
81
82- description: Set up the OpenContrail resources
83 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
84 -C 'I@opencontrail:database:id:1' state.sls opencontrail.client
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 5}
87 skip_fail: false
88
89# OpenContrail vrouters
90- description: Refresh pillars on cmp*
91 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
92 -C 'cmp*' saltutil.refresh_pillar
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 5}
95 skip_fail: false
96
97- description: Sync all on contrail computes
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
99 -C 'I@opencontrail:compute' saltutil.sync_all
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 1, delay: 5}
102 skip_fail: false
103
104- description: Apply highstate on contrail computes
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
106 -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 1, delay: 5}
109 skip_fail: false
110
Dmitry Tyzhnenko34595f82018-06-12 19:03:12 +0300111- description: Reboot contrail computes
112 cmd: salt --timeout=600 -C 'I@opencontrail:compute' system.reboot
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 30}
115 skip_fail: true
116
117- description: Apply opencontrail.client on contrail computes
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@opencontrail:compute' state.sls opencontrail.client
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
124- description: Run Kubernetes master without setup
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 3, delay: 5}
129 skip_fail: true
130
131- description: Run Kubernetes master setup
132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
133 -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 5}
136 skip_fail: true
137
138- description: Restart Kubelet
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'I@kubernetes:pool' service.restart 'kubelet'
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: true
144
145- description: Check nodes registrations
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@kubernetes:pool' cmd.run 'sleep 60; kubectl get nodes'
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: true
151
152- description: Renew hosts file on a whole cluster
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host;
154 node_name: {{ HOSTNAME_CFG01 }}
155 retry: {count: 1, delay: 5}
156 skip_fail: false