blob: 04b46a34b8ba6fb959860a6996544d5394e1edfc [file] [log] [blame]
Artem Panchenkoedf70ef2017-06-13 09:14:34 +03001{% from 'virtual-mcp11-k8s-calico/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
vrovachev8a882d82017-06-21 12:56:19 +04003# Kubernetes
Artem Panchenkoedf70ef2017-06-13 09:14:34 +03004- description: Install etcd
5 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +04006 -C 'I@etcd:server' state.sls etcd.server.service
Artem Panchenkoedf70ef2017-06-13 09:14:34 +03007 node_name: {{ HOSTNAME_CFG01 }}
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +04008 retry: {count: 3, delay: 5}
Artem Panchenkoedf70ef2017-06-13 09:14:34 +03009 skip_fail: false
10
11- description: Check the etcd health
12 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
13 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
14 node_name: {{ HOSTNAME_CFG01 }}
15 retry: {count: 1, delay: 5}
16 skip_fail: false
17
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +040018- description: Install Kubernetes addons
19 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
20 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
21 node_name: {{ HOSTNAME_CFG01 }}
22 retry: {count: 3, delay: 5}
23 skip_fail: false
24
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030025- description: Install Kubernetes and Calico
26 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +040027 -C 'I@kubernetes:pool' state.sls kubernetes.pool
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030028 node_name: {{ HOSTNAME_CFG01 }}
Victor Ryzhenkin3ffa2b42017-10-05 16:38:44 +040029 retry: {count: 3, delay: 5}
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030030 skip_fail: false
31
32- description: Setup NAT for Calico
33 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +040034 -C 'I@etcd:server and *01*' state.sls etcd.server.setup
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030035 node_name: {{ HOSTNAME_CFG01 }}
36 retry: {count: 1, delay: 5}
37 skip_fail: false
38
39- description: Run whole master to check consistency
40 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
41 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
42 node_name: {{ HOSTNAME_CFG01 }}
43 retry: {count: 1, delay: 5}
44 skip_fail: true
45
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +040046- description: Register addons
47 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
48 -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 5}
51 skip_fail: false
52
akasatkin6a3c36e2017-08-21 19:25:00 +030053- description: Restart kubelet
54 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
55 -C 'I@kubernetes:pool' service.restart kubelet
56 node_name: {{ HOSTNAME_CFG01 }}
57 retry: {count: 1, delay: 5}
58 skip_fail: false
59
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +040060- description: Renew hosts file on a whole cluster
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host;
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: Get kubeconfig
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030067 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Victor Ryzhenkin2a2cd8e2018-05-07 18:38:43 +040068 -C 'I@kubernetes:control and *01*' cmd.run 'cat /etc/kubernetes/admin-kube-config && echo "Salt command execution success"'
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030069 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 5}
71 skip_fail: false