Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 3 | - description: Install etcd |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 4 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 5 | -C 'I@etcd:server' state.sls etcd.server.service |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 6 | node_name: {{ HOSTNAME_CFG01 }} |
| 7 | retry: {count: 1, delay: 5} |
| 8 | skip_fail: false |
| 9 | |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 10 | - description: Check the etcd health |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 11 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 12 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 13 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 14 | retry: {count: 1, delay: 5} |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 15 | skip_fail: false |
| 16 | |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 17 | # Opencontrail Control Plane |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 18 | |
| 19 | - description: Install Opencontrail db on ctl01 |
| 20 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 21 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.database |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | retry: {count: 2, delay: 20} |
| 24 | skip_fail: false |
| 25 | |
| 26 | - description: Install Opencontrail db on all nodes |
| 27 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 28 | -C 'I@opencontrail:database' state.sls opencontrail.database |
| 29 | node_name: {{ HOSTNAME_CFG01 }} |
| 30 | retry: {count: 2, delay: 20} |
| 31 | skip_fail: false |
| 32 | |
| 33 | - description: Install Opencontrail control on ctl01 |
| 34 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 35 | -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client |
| 36 | node_name: {{ HOSTNAME_CFG01 }} |
| 37 | retry: {count: 1, delay: 5} |
| 38 | skip_fail: false |
| 39 | |
| 40 | - description: Install Opencontrail control on all nodes |
| 41 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 42 | -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| 43 | node_name: {{ HOSTNAME_CFG01 }} |
| 44 | retry: {count: 1, delay: 5} |
| 45 | skip_fail: false |
| 46 | |
| 47 | - description: Install Opencontrail on collector |
| 48 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 49 | -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client |
| 50 | node_name: {{ HOSTNAME_CFG01 }} |
| 51 | retry: {count: 1, delay: 5} |
| 52 | skip_fail: false |
| 53 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 54 | # OpenContrail vrouters |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 55 | - description: Install Opencontrail client |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 57 | -C 'I@opencontrail:database:id:1' state.sls opencontrail.client |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 1, delay: 5} |
| 60 | skip_fail: false |
| 61 | |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 62 | - description: Install Opencontrail on computes |
| 63 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 64 | -C 'I@opencontrail:compute' state.sls opencontrail exclude=opencontrail.client |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 65 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 66 | retry: {count: 2, delay: 5} |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 67 | skip_fail: false |
| 68 | |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 69 | - description: Wake up vhost0 |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 71 | -C 'I@nova:compute' cmd.run 'exec 0>&-; exec 1>&-; exec 2>&-; |
| 72 | nohup bash -c "ip link | grep vhost && echo no_reboot || sleep 5 && reboot & "' && sleep 30 |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 73 | node_name: {{ HOSTNAME_CFG01 }} |
| 74 | retry: {count: 1, delay: 5} |
| 75 | skip_fail: false |
| 76 | |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 77 | - description: Wait for salt-minions wake up after restart |
| 78 | cmd: salt --timeout=15 --hard-crash --state-output=mixed --state-verbose=False '*' test.ping |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 25, delay: 30} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Install Opencontrail client on computes |
| 84 | cmd: sleep 15 && salt --timeout=60 --hard-crash --state-output=mixed --state-verbose=False |
| 85 | -C 'I@opencontrail:compute' state.sls 'opencontrail.client' |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 5} |
| 88 | skip_fail: false |
| 89 | |
| 90 | - description: Install Opencontrail on computes #2 |
| 91 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 92 | -C 'I@opencontrail:compute' state.sls opencontrail |
| 93 | node_name: {{ HOSTNAME_CFG01 }} |
| 94 | retry: {count: 2, delay: 5} |
| 95 | skip_fail: false |
| 96 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 97 | # Kubernetes |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 98 | - description: Install Kubernetes Addons |
| 99 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 100 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 101 | node_name: {{ HOSTNAME_CFG01 }} |
| 102 | retry: {count: 1, delay: 5} |
| 103 | skip_fail: true |
| 104 | |
| 105 | - description: Install Kubernetes components |
| 106 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 107 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 108 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 109 | retry: {count: 5, delay: 60} |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 110 | skip_fail: false |
| 111 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 112 | - description: Run Kubernetes master without setup |
| 113 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 114 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 115 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 116 | retry: {count: 3, delay: 5} |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 117 | skip_fail: true |
| 118 | |
| 119 | - description: Run Kubernetes master setup |
| 120 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 121 | -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup |
| 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 1, delay: 5} |
| 124 | skip_fail: true |
| 125 | |
| 126 | - description: Restart Kubelet |
| 127 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 128 | -C 'I@kubernetes:pool' service.restart 'kubelet' |
| 129 | node_name: {{ HOSTNAME_CFG01 }} |
| 130 | retry: {count: 1, delay: 5} |
| 131 | skip_fail: true |
| 132 | |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 133 | - description: Renew hosts file on a whole cluster |
| 134 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host; |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 135 | node_name: {{ HOSTNAME_CFG01 }} |
| 136 | retry: {count: 1, delay: 5} |
Victor Ryzhenkin | d93a448 | 2018-04-09 15:20:42 +0400 | [diff] [blame] | 137 | skip_fail: false |