Victor Ryzhenkin | a95d173 | 2017-11-16 19:02:19 +0400 | [diff] [blame] | 1 | {% from 'k8s-ha-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
| 3 | - description: Install etcd |
| 4 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 5 | -C 'I@etcd:server' state.sls etcd.server.service |
| 6 | node_name: {{ HOSTNAME_CFG01 }} |
| 7 | retry: {count: 1, delay: 5} |
| 8 | skip_fail: false |
| 9 | |
| 10 | - description: Check the etcd health |
| 11 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 12 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| 13 | node_name: {{ HOSTNAME_CFG01 }} |
| 14 | retry: {count: 1, delay: 5} |
| 15 | skip_fail: false |
| 16 | |
| 17 | # Opencontrail Control Plane |
| 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 | |
| 54 | # OpenContrail vrouters |
| 55 | - description: Install Opencontrail client |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 57 | -C 'I@opencontrail:database:id:1' state.sls opencontrail.client |
| 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 1, delay: 5} |
| 60 | skip_fail: false |
| 61 | |
| 62 | - description: Install Opencontrail on computes |
| 63 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 64 | -C 'I@opencontrail:compute' state.sls opencontrail exclude=opencontrail.client |
| 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 2, delay: 5} |
| 67 | skip_fail: false |
| 68 | |
| 69 | - description: Wake up vhost0 |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 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 & "' |
| 73 | node_name: {{ HOSTNAME_CFG01 }} |
| 74 | retry: {count: 1, delay: 5} |
| 75 | skip_fail: false |
| 76 | |
| 77 | - description: Install Opencontrail client on computes |
| 78 | cmd: sleep 300 && salt --timeout=60 --hard-crash --state-output=mixed --state-verbose=False |
| 79 | -C 'I@opencontrail:compute' state.sls 'opencontrail.client' |
| 80 | node_name: {{ HOSTNAME_CFG01 }} |
| 81 | retry: {count: 1, delay: 5} |
| 82 | skip_fail: false |
| 83 | |
| 84 | - description: Install Opencontrail on computes #2 |
| 85 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 86 | -C 'I@opencontrail:compute' state.sls opencontrail |
| 87 | node_name: {{ HOSTNAME_CFG01 }} |
| 88 | retry: {count: 2, delay: 5} |
| 89 | skip_fail: false |
| 90 | |
| 91 | # Kubernetes |
| 92 | - description: Install Kubernetes Addons |
| 93 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 94 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 95 | node_name: {{ HOSTNAME_CFG01 }} |
| 96 | retry: {count: 1, delay: 5} |
| 97 | skip_fail: true |
| 98 | |
| 99 | - description: Install Kubernetes components |
| 100 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 101 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 102 | node_name: {{ HOSTNAME_CFG01 }} |
| 103 | retry: {count: 5, delay: 60} |
| 104 | skip_fail: false |
| 105 | |
Victor Ryzhenkin | 0a3babf | 2018-04-16 16:41:31 +0400 | [diff] [blame] | 106 | # NOTE(vryzhenkin): There is nothing to setup at this model |
| 107 | #- description: Setup etcd server on primary controller |
| 108 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 109 | # -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup |
| 110 | # node_name: {{ HOSTNAME_CFG01 }} |
| 111 | # retry: {count: 1, delay: 5} |
| 112 | # skip_fail: false |
Victor Ryzhenkin | a95d173 | 2017-11-16 19:02:19 +0400 | [diff] [blame] | 113 | |
| 114 | - description: Run Kubernetes master without setup |
| 115 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 116 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 117 | node_name: {{ HOSTNAME_CFG01 }} |
| 118 | retry: {count: 3, delay: 5} |
| 119 | skip_fail: true |
| 120 | |
| 121 | - description: Run Kubernetes master setup |
| 122 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 123 | -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup |
| 124 | node_name: {{ HOSTNAME_CFG01 }} |
| 125 | retry: {count: 1, delay: 5} |
| 126 | skip_fail: true |
| 127 | |
| 128 | - description: Restart Kubelet |
| 129 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 130 | -C 'I@kubernetes:pool' service.restart 'kubelet' |
| 131 | node_name: {{ HOSTNAME_CFG01 }} |
| 132 | retry: {count: 1, delay: 5} |
| 133 | skip_fail: true |
| 134 | |
| 135 | - description: Renew hosts file on a whole cluster |
| 136 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host; |
| 137 | node_name: {{ HOSTNAME_CFG01 }} |
| 138 | retry: {count: 1, delay: 5} |
| 139 | skip_fail: false |