Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 3 | - description: Temporary fix to untie k8s API from Opencontrail haproxy |
| 4 | That allows kube-api to be available over private network. |
| 5 | cmd: sed -i "s/vhost0/ens4/g" /srv/salt/reclass/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/control.yml |
| 6 | node_name: {{ HOSTNAME_CFG01 }} |
| 7 | retry: {count: 1, delay: 5} |
| 8 | skip_fail: true |
| 9 | |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 10 | # Install support services |
| 11 | - description: Create and distribute SSL certificates for services using salt state |
| 12 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls salt |
| 13 | node_name: {{ HOSTNAME_CFG01 }} |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 14 | retry: {count: 1, delay: 5} |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 15 | skip_fail: true |
| 16 | |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 17 | - description: Install glusterfs |
| 18 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 19 | -C 'I@glusterfs:server' state.sls glusterfs.server.service |
| 20 | node_name: {{ HOSTNAME_CFG01 }} |
| 21 | retry: {count: 1, delay: 5} |
| 22 | skip_fail: false |
| 23 | |
| 24 | - description: Setup glusterfs on primary controller |
| 25 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 26 | -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1 |
| 27 | node_name: {{ HOSTNAME_CFG01 }} |
| 28 | retry: {count: 1, delay: 5} |
| 29 | skip_fail: false |
| 30 | |
| 31 | - description: Check the gluster status |
| 32 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 33 | -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1 |
| 34 | node_name: {{ HOSTNAME_CFG01 }} |
| 35 | retry: {count: 1, delay: 5} |
| 36 | skip_fail: false |
| 37 | |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 38 | - description: Install haproxy |
| 39 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 40 | -C 'I@haproxy:proxy' state.sls haproxy |
| 41 | node_name: {{ HOSTNAME_CFG01 }} |
| 42 | retry: {count: 1, delay: 5} |
| 43 | skip_fail: false |
| 44 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 45 | - description: Check haproxy service |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 46 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 47 | -C 'I@haproxy:proxy' service.status haproxy |
| 48 | node_name: {{ HOSTNAME_CFG01 }} |
| 49 | retry: {count: 1, delay: 5} |
| 50 | skip_fail: false |
| 51 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 52 | - description: Restart rsyslog |
| 53 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 54 | -C 'I@haproxy:proxy' service.restart rsyslog |
| 55 | node_name: {{ HOSTNAME_CFG01 }} |
| 56 | retry: {count: 1, delay: 5} |
| 57 | skip_fail: false |
| 58 | |
| 59 | #Kubernetes |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 60 | - description: Install docker |
| 61 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 62 | -C 'I@docker:host' state.sls docker.host |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 5} |
| 65 | skip_fail: false |
| 66 | |
| 67 | - description: Check docker |
| 68 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 69 | -C 'I@docker:host' cmd.run 'docker ps' |
| 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 1, delay: 5} |
| 72 | skip_fail: false |
| 73 | |
| 74 | - description: Install etcd |
| 75 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 76 | -C 'I@etcd:server' state.sls etcd.server.service |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 1, delay: 5} |
| 79 | skip_fail: false |
| 80 | |
| 81 | - description: Check the etcd health |
| 82 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 83 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 5} |
| 86 | skip_fail: false |
| 87 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 88 | - description: Install keepalived on primary controller |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 89 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 90 | -C 'I@keepalived:cluster and *01*' state.sls keepalived |
| 91 | node_name: {{ HOSTNAME_CFG01 }} |
| 92 | retry: {count: 1, delay: 10} |
| 93 | skip_fail: true |
| 94 | |
| 95 | - description: Install keepalived on all controllers |
| 96 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 97 | -C 'I@keepalived:cluster' state.sls keepalived |
| 98 | node_name: {{ HOSTNAME_CFG01 }} |
| 99 | retry: {count: 1, delay: 10} |
| 100 | skip_fail: true |
| 101 | |
| 102 | - description: Install nginx |
| 103 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 104 | -C 'I@nginx:server' state.sls nginx |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 105 | node_name: {{ HOSTNAME_CFG01 }} |
| 106 | retry: {count: 1, delay: 5} |
| 107 | skip_fail: false |
| 108 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 109 | - description: Install Kubernetes Addons |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 110 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 111 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 112 | node_name: {{ HOSTNAME_CFG01 }} |
| 113 | retry: {count: 1, delay: 5} |
| 114 | skip_fail: true |
| 115 | |
| 116 | - description: Install Kubernetes components |
| 117 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 118 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 119 | node_name: {{ HOSTNAME_CFG01 }} |
| 120 | retry: {count: 1, delay: 5} |
| 121 | skip_fail: false |
| 122 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 123 | - description: Setup etcd server on primary controller |
| 124 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 125 | -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup |
| 126 | node_name: {{ HOSTNAME_CFG01 }} |
| 127 | retry: {count: 1, delay: 5} |
| 128 | skip_fail: false |
| 129 | |
| 130 | - description: Run Kubernetes master without setup |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 131 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 132 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 133 | node_name: {{ HOSTNAME_CFG01 }} |
| 134 | retry: {count: 1, delay: 5} |
| 135 | skip_fail: true |
| 136 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 137 | - description: Run Kubernetes master setup |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 138 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 139 | -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup |
| 140 | node_name: {{ HOSTNAME_CFG01 }} |
| 141 | retry: {count: 1, delay: 5} |
| 142 | skip_fail: true |
| 143 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 144 | - description: Restart Kubelet |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 145 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 146 | -C 'I@kubernetes:pool' service.restart 'kubelet' |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 147 | node_name: {{ HOSTNAME_CFG01 }} |
| 148 | retry: {count: 1, delay: 5} |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 149 | skip_fail: true |
| 150 | |
| 151 | # Opencontrail |
| 152 | - description: Install RabbitMQ |
| 153 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 154 | -C 'I@rabbitmq:server' state.sls rabbitmq |
| 155 | node_name: {{ HOSTNAME_CFG01 }} |
| 156 | retry: {count: 2, delay: 10} |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 157 | skip_fail: false |
| 158 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 159 | - description: Check RabbitMQ |
| 160 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 161 | -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status" |
| 162 | node_name: {{ HOSTNAME_CFG01 }} |
| 163 | retry: {count: 1, delay: 10} |
| 164 | skip_fail: false |
| 165 | |
| 166 | - description: Install Opencontrail db on ctl01 |
| 167 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 168 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.database |
| 169 | node_name: {{ HOSTNAME_CFG01 }} |
| 170 | retry: {count: 2, delay: 20} |
| 171 | skip_fail: false |
| 172 | |
| 173 | - description: Install Opencontrail db on all nodes |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 174 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 175 | -C 'I@opencontrail:database' state.sls opencontrail.database |
| 176 | node_name: {{ HOSTNAME_CFG01 }} |
| 177 | retry: {count: 2, delay: 20} |
| 178 | skip_fail: false |
| 179 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 180 | - description: Install Opencontrail control on ctl01 |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 181 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 182 | -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client |
| 183 | node_name: {{ HOSTNAME_CFG01 }} |
| 184 | retry: {count: 1, delay: 5} |
| 185 | skip_fail: false |
| 186 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 187 | - description: Install Opencontrail control on all nodes |
| 188 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 189 | -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| 190 | node_name: {{ HOSTNAME_CFG01 }} |
| 191 | retry: {count: 1, delay: 5} |
| 192 | skip_fail: false |
| 193 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 194 | - description: Install Opencontrail on collector |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 195 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 196 | -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client |
| 197 | node_name: {{ HOSTNAME_CFG01 }} |
| 198 | retry: {count: 1, delay: 5} |
| 199 | skip_fail: false |
| 200 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 201 | - description: Test Opencontrail |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 202 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 203 | -C 'I@opencontrail:control' cmd.run 'contrail-status' |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 204 | node_name: {{ HOSTNAME_CFG01 }} |
| 205 | retry: {count: 1, delay: 5} |
| 206 | skip_fail: false |
| 207 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 208 | - description: Install Opencontrail client |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 209 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 210 | -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client' |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 211 | node_name: {{ HOSTNAME_CFG01 }} |
| 212 | retry: {count: 1, delay: 5} |
| 213 | skip_fail: false |
| 214 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 215 | - description: Install Opencontrail client on computes |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 216 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 217 | -C 'I@opencontrail:compute' state.sls 'opencontrail.client' |
Tatyana Leontovich | 508d0cb | 2017-05-26 15:46:24 +0300 | [diff] [blame] | 218 | node_name: {{ HOSTNAME_CFG01 }} |
| 219 | retry: {count: 1, delay: 5} |
| 220 | skip_fail: false |
| 221 | |
Sergii Golovatiuk | 8f679ab | 2017-06-02 13:13:53 +0200 | [diff] [blame] | 222 | - description: Install Opencontrail on computes |
| 223 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 224 | -C 'I@opencontrail:compute' state.sls 'opencontrail' |
| 225 | node_name: {{ HOSTNAME_CFG01 }} |
| 226 | retry: {count: 1, delay: 5} |
| 227 | skip_fail: false |
| 228 | |
| 229 | - description: Reboot Opencontrail compute nodes |
| 230 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 231 | -C 'I@opencontrail:compute' system.reboot |
Tatyana Leontovich | bb6d1a7 | 2017-05-17 14:10:38 +0300 | [diff] [blame] | 232 | node_name: {{ HOSTNAME_CFG01 }} |
| 233 | retry: {count: 1, delay: 5} |
| 234 | skip_fail: false |