blob: dd06454fe0190493aac198bca328d923c451ef3e [file] [log] [blame]
Tatyana Leontovichc8b8ca22017-05-19 13:37:05 +03001{% from 'virtual-mcp11-k8s-calico/underlay.yaml' import HOSTNAME_CFG01 with context %}
Sergii Golovatiuk57bb8e72017-05-16 19:49:49 +02002
3# Install support services
4- description: Create and distribute SSL certificates for services using salt state
5 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls salt
6 node_name: {{ HOSTNAME_CFG01 }}
7 retry: {count: 1, delay: 10}
8 skip_fail: true
9
10- description: Install keepalived
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@keepalived:cluster' state.sls keepalived -b 1
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 10}
15 skip_fail: true
16
Sergii Golovatiuk57bb8e72017-05-16 19:49:49 +020017- 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
23
24- description: Install haproxy.service
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@haproxy:proxy' service.status haproxy
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
31- description: Install docker
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@docker:host' state.sls docker.host
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 5}
36 skip_fail: false
37
38- description: Check docker
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@docker:host' cmd.run 'docker ps'
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
45- description: Install etcd
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@etcd:server' state.sls etcd.server.service
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: Check the etcd health
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false
58
59- description: Install Kubernetes and Calico
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons;
62 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' state.sls kubernetes.pool;
63 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' cmd.run 'calicoctl node status';
64 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitriev0c5f2cd2017-05-25 10:59:58 -040065 retry: {count: 1, delay: 5}
Sergii Golovatiuk57bb8e72017-05-16 19:49:49 +020066 skip_fail: false
67
68- description: Setup NAT for Calico
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
70 -C 'I@etcd:server' --subset 1 state.sls etcd.server.setup
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 1, delay: 5}
73 skip_fail: false
74
75- description: Run whole master to check consistency
76 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
77 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
78 node_name: {{ HOSTNAME_CFG01 }}
79 retry: {count: 1, delay: 5}
80 skip_fail: true
81
82
83- description: Register addons
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
85 -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 5}
88 skip_fail: false
Tatyana Leontovich5acc82a2017-05-23 15:41:35 +030089
90# Isntall SL core services
91- description: Install glusterfs
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
93 -C 'I@glusterfs:server' state.sls glusterfs.server.service
94 node_name: {{ HOSTNAME_CFG01 }}
95 retry: {count: 1, delay: 5}
96 skip_fail: false
97
98- description: Setup glusterfs on primary controller
99 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
100 -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 1, delay: 5}
103 skip_fail: false
104
105- description: Check the gluster status
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
107 -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 1, delay: 5}
110 skip_fail: false
111
112- description: Install gluserfs client
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
114 -C 'I@glusterfs:client' state.sls glusterfs.client
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 5}
117 skip_fail: false
118
119- description: Install Galera on first server
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C 'I@galera:master' state.sls galera
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: false
125
126- description: Install Galera on other servers
127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
128 -C 'I@galera:slave' state.sls galera
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 1, delay: 5}
131 skip_fail: false
132
133- description: Check mysql status
134 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
135 -C 'I@galera:*' mysql.status | grep -A1 -e "wsrep_incoming_addresses\|wsrep_cluster_size"
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 5}
138 skip_fail: false
139
140- description: Install nginx
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
142 -C 'I@nginx:server' state.sls nginx
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: false