Dmitry Tyzhnenko | 34595f8 | 2018-06-12 19:03:12 +0300 | [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 | - description: Install Kubernetes Addons |
| 18 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 19 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 20 | node_name: {{ HOSTNAME_CFG01 }} |
| 21 | retry: {count: 1, delay: 5} |
| 22 | skip_fail: true |
| 23 | |
| 24 | - description: Install Kubernetes components |
| 25 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 26 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 27 | node_name: {{ HOSTNAME_CFG01 }} |
| 28 | retry: {count: 5, delay: 60} |
| 29 | skip_fail: false |
| 30 | |
| 31 | # Opencontrail Control Plane |
| 32 | |
| 33 | - description: Create configuration files for OpenContrail |
| 34 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 35 | -C 'I@opencontrail:control' 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 db on ctl01 |
| 41 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 42 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.database |
| 43 | node_name: {{ HOSTNAME_CFG01 }} |
| 44 | retry: {count: 2, delay: 20} |
| 45 | skip_fail: false |
| 46 | |
| 47 | - description: Configure OpenContrail as an add-on for Kubernetes |
| 48 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 49 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 50 | node_name: {{ HOSTNAME_CFG01 }} |
| 51 | retry: {count: 1, delay: 5} |
| 52 | skip_fail: true |
| 53 | |
| 54 | - description: Verify the status of the OpenContrail service |
| 55 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 56 | -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status' |
| 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 5} |
| 59 | skip_fail: true |
| 60 | |
| 61 | - description: Set up the OpenContrail resources |
| 62 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 63 | -C 'I@opencontrail:database:id:1' state.sls opencontrail.client |
| 64 | node_name: {{ HOSTNAME_CFG01 }} |
| 65 | retry: {count: 1, delay: 5} |
| 66 | skip_fail: false |
| 67 | |
| 68 | # OpenContrail vrouters |
| 69 | - description: Refresh pillars on cmp* |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 71 | -C 'cmp*' saltutil.refresh_pillar |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 5} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Sync all on contrail computes |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 78 | -C 'I@opencontrail:compute' saltutil.sync_all |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 5} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Apply highstate on contrail computes |
| 84 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 85 | -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 5} |
| 88 | skip_fail: false |
| 89 | |
| 90 | # - description: Reboot contrail computes |
| 91 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 92 | # -C 'I@opencontrail:compute' cmd.run 'reboot' |
| 93 | # node_name: {{ HOSTNAME_CFG01 }} |
| 94 | # retry: {count: 1, delay: 5} |
| 95 | # skip_fail: false |
| 96 | |
| 97 | - description: Reboot contrail computes |
| 98 | cmd: salt --timeout=600 -C 'I@opencontrail:compute' system.reboot |
| 99 | node_name: {{ HOSTNAME_CFG01 }} |
| 100 | retry: {count: 1, delay: 30} |
| 101 | skip_fail: true |
| 102 | |
| 103 | - description: Apply opencontrail.client on contrail computes |
| 104 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 105 | -C 'I@opencontrail:compute' state.sls opencontrail.client |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 5} |
| 108 | skip_fail: false |
| 109 | |
| 110 | - description: Run Kubernetes master without setup |
| 111 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 112 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 113 | node_name: {{ HOSTNAME_CFG01 }} |
| 114 | retry: {count: 3, delay: 5} |
| 115 | skip_fail: true |
| 116 | |
| 117 | - description: Run Kubernetes master setup |
| 118 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 119 | -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup |
| 120 | node_name: {{ HOSTNAME_CFG01 }} |
| 121 | retry: {count: 1, delay: 5} |
| 122 | skip_fail: true |
| 123 | |
| 124 | - description: Restart Kubelet |
| 125 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 126 | -C 'I@kubernetes:pool' service.restart 'kubelet' |
| 127 | node_name: {{ HOSTNAME_CFG01 }} |
| 128 | retry: {count: 1, delay: 5} |
| 129 | skip_fail: true |
| 130 | |
| 131 | - description: Check nodes registrations |
| 132 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 133 | -C 'I@kubernetes:pool' cmd.run 'sleep 60; kubectl get nodes' |
| 134 | node_name: {{ HOSTNAME_CFG01 }} |
| 135 | retry: {count: 1, delay: 5} |
| 136 | skip_fail: true |
| 137 | |
| 138 | - description: Renew hosts file on a whole cluster |
| 139 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host; |
| 140 | node_name: {{ HOSTNAME_CFG01 }} |
| 141 | retry: {count: 1, delay: 5} |
| 142 | skip_fail: false |
| 143 | |
| 144 | # - description: Install Opencontrail db on all nodes |
| 145 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 146 | # -C 'I@opencontrail:database' state.sls opencontrail.database |
| 147 | # node_name: {{ HOSTNAME_CFG01 }} |
| 148 | # retry: {count: 2, delay: 20} |
| 149 | # skip_fail: false |
| 150 | |
| 151 | # - description: Install Opencontrail control on ctl01 |
| 152 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 153 | # -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client |
| 154 | # node_name: {{ HOSTNAME_CFG01 }} |
| 155 | # retry: {count: 1, delay: 5} |
| 156 | # skip_fail: false |
| 157 | |
| 158 | # - description: Install Opencontrail control on all nodes |
| 159 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 160 | # -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| 161 | # node_name: {{ HOSTNAME_CFG01 }} |
| 162 | # retry: {count: 1, delay: 5} |
| 163 | # skip_fail: false |
| 164 | |
| 165 | # - description: Install Opencontrail on collector |
| 166 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 167 | # -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client |
| 168 | # node_name: {{ HOSTNAME_CFG01 }} |
| 169 | # retry: {count: 1, delay: 5} |
| 170 | # skip_fail: false |
| 171 | |
| 172 | # # OpenContrail vrouters |
| 173 | # - description: Install Opencontrail client |
| 174 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 175 | # -C 'I@opencontrail:database:id:1' state.sls opencontrail.client |
| 176 | # node_name: {{ HOSTNAME_CFG01 }} |
| 177 | # retry: {count: 1, delay: 5} |
| 178 | # skip_fail: false |
| 179 | |
| 180 | # - description: Install Opencontrail on computes |
| 181 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 182 | # -C 'I@opencontrail:compute' state.sls opencontrail exclude=opencontrail.client |
| 183 | # node_name: {{ HOSTNAME_CFG01 }} |
| 184 | # retry: {count: 2, delay: 5} |
| 185 | # skip_fail: false |
| 186 | |
| 187 | # - description: Wake up vhost0 |
| 188 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 189 | # -C 'I@nova:compute' cmd.run 'exec 0>&-; exec 1>&-; exec 2>&-; |
| 190 | # nohup bash -c "ip link | grep vhost && echo no_reboot || sleep 5 && reboot & "' |
| 191 | # node_name: {{ HOSTNAME_CFG01 }} |
| 192 | # retry: {count: 1, delay: 5} |
| 193 | # skip_fail: false |
| 194 | |
| 195 | # - description: Install Opencontrail client on computes |
| 196 | # cmd: sleep 300 && salt --timeout=60 --hard-crash --state-output=mixed --state-verbose=False |
| 197 | # -C 'I@opencontrail:compute' state.sls 'opencontrail.client' |
| 198 | # node_name: {{ HOSTNAME_CFG01 }} |
| 199 | # retry: {count: 1, delay: 5} |
| 200 | # skip_fail: false |
| 201 | |
| 202 | # - description: Install Opencontrail on computes #2 |
| 203 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 204 | # -C 'I@opencontrail:compute' state.sls opencontrail |
| 205 | # node_name: {{ HOSTNAME_CFG01 }} |
| 206 | # retry: {count: 2, delay: 5} |
| 207 | # skip_fail: false |
| 208 | |
| 209 | # # Kubernetes |
| 210 | # - description: Install Kubernetes Addons |
| 211 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 212 | # -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 213 | # node_name: {{ HOSTNAME_CFG01 }} |
| 214 | # retry: {count: 1, delay: 5} |
| 215 | # skip_fail: true |
| 216 | |
| 217 | # - description: Check contrail status |
| 218 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 219 | # -C 'I@opencontrail:database' cmd.run contrail-status |
| 220 | # node_name: {{ HOSTNAME_CFG01 }} |
| 221 | # retry: {count: 1, delay: 5} |
| 222 | # skip_fail: false |
| 223 | |
| 224 | # - description: Install Kubernetes components |
| 225 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 226 | # -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 227 | # node_name: {{ HOSTNAME_CFG01 }} |
| 228 | # retry: {count: 5, delay: 60} |
| 229 | # skip_fail: false |
| 230 | |
| 231 | # # NOTE(vryzhenkin): There is nothing to setup at this model |
| 232 | # #- description: Setup etcd server on primary controller |
| 233 | # # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 234 | # # -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup |
| 235 | # # node_name: {{ HOSTNAME_CFG01 }} |
| 236 | # # retry: {count: 1, delay: 5} |
| 237 | # # skip_fail: false |
| 238 | |
| 239 | # - description: Run Kubernetes master without setup |
| 240 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 241 | # -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 242 | # node_name: {{ HOSTNAME_CFG01 }} |
| 243 | # retry: {count: 3, delay: 5} |
| 244 | # skip_fail: true |
| 245 | |
| 246 | # - description: Run Kubernetes master setup |
| 247 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 248 | # -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup |
| 249 | # node_name: {{ HOSTNAME_CFG01 }} |
| 250 | # retry: {count: 1, delay: 5} |
| 251 | # skip_fail: true |
| 252 | |
| 253 | # - description: Restart Kubelet |
| 254 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 255 | # -C 'I@kubernetes:pool' service.restart 'kubelet' |
| 256 | # node_name: {{ HOSTNAME_CFG01 }} |
| 257 | # retry: {count: 1, delay: 5} |
| 258 | # skip_fail: true |
| 259 | |
| 260 | # - description: Renew hosts file on a whole cluster |
| 261 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host; |
| 262 | # node_name: {{ HOSTNAME_CFG01 }} |
| 263 | # retry: {count: 1, delay: 5} |
| 264 | # skip_fail: false |