Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp11-k8s-calico/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
vrovachev | 8a882d8 | 2017-06-21 12:56:19 +0400 | [diff] [blame] | 3 | # Kubernetes |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 4 | - description: Install etcd |
| 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 6 | -C 'I@etcd:server' state.sls etcd.server.service |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 7 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 8 | retry: {count: 3, delay: 5} |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 9 | 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 Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 18 | - 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 Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 25 | - description: Install Kubernetes and Calico |
| 26 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 27 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 28 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | 3ffa2b4 | 2017-10-05 16:38:44 +0400 | [diff] [blame] | 29 | retry: {count: 3, delay: 5} |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 30 | skip_fail: false |
| 31 | |
| 32 | - description: Setup NAT for Calico |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 34 | -C 'I@etcd:server and *01*' state.sls etcd.server.setup |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 35 | 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 Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 46 | - 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 | |
akasatkin | 6a3c36e | 2017-08-21 19:25:00 +0300 | [diff] [blame] | 53 | - 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 Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 60 | - 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 Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 67 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 68 | -C 'I@kubernetes:control and *01*' cmd.run 'cat /etc/kubernetes/admin-kube-config && echo "Salt command execution success"' |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 1, delay: 5} |
| 71 | skip_fail: false |