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 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 3 | - description: Sync time on nodes |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 4 | cmd: salt '*' cmd.run "service ntp stop; ntpd -gq ; |
| 5 | service ntp start; ntp-wait || exit 1" |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 6 | node_name: {{ HOSTNAME_CFG01 }} |
| 7 | retry: {count: 2, delay: 1} |
Tatyana Leontovich | 3b04e30 | 2017-07-11 19:01:35 +0300 | [diff] [blame] | 8 | skip_fail: true |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 9 | |
Sergii Golovatiuk | ed97cb1 | 2017-08-11 21:09:38 +0200 | [diff] [blame] | 10 | # TODO Remove workaround when linklocal on kube-api VIP on ens3 works fine |
Sergii Golovatiuk | 7a7cef5 | 2017-08-11 16:45:12 +0200 | [diff] [blame] | 11 | - description: Replace kube-api VIP with IP of one controller |
Sergii Golovatiuk | ed97cb1 | 2017-08-11 21:09:38 +0200 | [diff] [blame] | 12 | cmd: | |
Dennis Dmitriev | 9d9ba9f | 2017-09-13 17:34:03 +0300 | [diff] [blame] | 13 | find /srv/salt/reclass/classes/ -type f -exec sed -i 's/ipf_addresses:\ \${_param:kubernetes_control_address}/ipf_addresses:\ \${_param:kubernetes_control_node01_address}/g' {} + |
| 14 | find /srv/salt/reclass/classes/ -type f -exec sed -i 's/ipf_port:\ 443/ipf_port:\ 6443/g' {} + |
Sergii Golovatiuk | 7a7cef5 | 2017-08-11 16:45:12 +0200 | [diff] [blame] | 15 | node_name: {{ HOSTNAME_CFG01 }} |
| 16 | retry: {count: 1, delay: 1} |
| 17 | skip_fail: false |
| 18 | |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 19 | - description: Install keepalived on primary controller |
| 20 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 21 | -C 'I@keepalived:cluster and *01*' state.sls keepalived |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | retry: {count: 1, delay: 10} |
| 24 | skip_fail: true |
| 25 | |
| 26 | - description: Install keepalived on all controllers |
| 27 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 28 | -C 'I@keepalived:cluster' state.sls keepalived |
| 29 | node_name: {{ HOSTNAME_CFG01 }} |
| 30 | retry: {count: 1, delay: 10} |
| 31 | skip_fail: true |
| 32 | |
| 33 | - description: Install nginx |
| 34 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 35 | -C 'I@nginx:server' state.sls nginx |
| 36 | node_name: {{ HOSTNAME_CFG01 }} |
| 37 | retry: {count: 1, delay: 5} |
| 38 | skip_fail: false |
| 39 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 40 | # Opencontrail Control Plane |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 41 | - description: Install RabbitMQ |
| 42 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 43 | -C 'I@rabbitmq:server' state.sls rabbitmq |
| 44 | node_name: {{ HOSTNAME_CFG01 }} |
| 45 | retry: {count: 2, delay: 10} |
| 46 | skip_fail: false |
| 47 | |
| 48 | - description: Check RabbitMQ |
| 49 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 50 | -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status" |
| 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 10} |
| 53 | skip_fail: false |
| 54 | |
| 55 | - description: Install Opencontrail db on ctl01 |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 57 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.database |
| 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 2, delay: 20} |
| 60 | skip_fail: false |
| 61 | |
| 62 | - description: Install Opencontrail db on all nodes |
| 63 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 64 | -C 'I@opencontrail:database' state.sls opencontrail.database |
| 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 2, delay: 20} |
| 67 | skip_fail: false |
| 68 | |
| 69 | - description: Install Opencontrail control on ctl01 |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 71 | -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 5} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Install Opencontrail control on all nodes |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 78 | -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 5} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Install Opencontrail on collector |
| 84 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 85 | -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 5} |
| 88 | skip_fail: false |
| 89 | |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 90 | - description: Workaround for https://mirantis.jira.com/browse/PROD-12798 |
| 91 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 92 | -C 'I@opencontrail:control' service.restart 'keepalived' |
| 93 | node_name: {{ HOSTNAME_CFG01 }} |
| 94 | retry: {count: 1, delay: 5} |
| 95 | skip_fail: false |
| 96 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 97 | # OpenContrail vrouters |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 98 | - description: Install Opencontrail client |
| 99 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 100 | -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client' |
| 101 | node_name: {{ HOSTNAME_CFG01 }} |
| 102 | retry: {count: 1, delay: 5} |
| 103 | skip_fail: false |
| 104 | |
| 105 | - description: Install Opencontrail client on computes |
| 106 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 107 | -C 'I@opencontrail:compute' state.sls 'opencontrail.client' |
| 108 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 109 | retry: {count: 2, delay: 5} |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 110 | skip_fail: false |
| 111 | |
| 112 | - description: Install Opencontrail on computes |
| 113 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 114 | -C 'I@opencontrail:compute' state.sls 'opencontrail' |
| 115 | node_name: {{ HOSTNAME_CFG01 }} |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 116 | retry: {count: 2, delay: 5} |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 117 | skip_fail: false |
| 118 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 119 | - description: Test Opencontrail |
| 120 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 121 | -C 'I@opencontrail:control' cmd.run 'contrail-status' |
| 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 1, delay: 5} |
| 124 | skip_fail: false |
| 125 | |
| 126 | # Kubernetes |
| 127 | - description: Install docker |
| 128 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 129 | -C 'I@docker:host' state.sls docker.host |
| 130 | node_name: {{ HOSTNAME_CFG01 }} |
| 131 | retry: {count: 1, delay: 5} |
| 132 | skip_fail: false |
| 133 | |
| 134 | - description: Check docker |
| 135 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 136 | -C 'I@docker:host' cmd.run 'docker ps' |
| 137 | node_name: {{ HOSTNAME_CFG01 }} |
| 138 | retry: {count: 1, delay: 5} |
| 139 | skip_fail: false |
| 140 | |
| 141 | - description: Install etcd |
| 142 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 143 | -C 'I@etcd:server' state.sls etcd.server.service |
| 144 | node_name: {{ HOSTNAME_CFG01 }} |
| 145 | retry: {count: 1, delay: 5} |
| 146 | skip_fail: false |
| 147 | |
| 148 | - description: Check the etcd health |
| 149 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 150 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| 151 | node_name: {{ HOSTNAME_CFG01 }} |
| 152 | retry: {count: 1, delay: 5} |
| 153 | skip_fail: false |
| 154 | |
| 155 | - description: Install Kubernetes Addons |
| 156 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 157 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 158 | node_name: {{ HOSTNAME_CFG01 }} |
| 159 | retry: {count: 1, delay: 5} |
| 160 | skip_fail: true |
| 161 | |
| 162 | - description: Install Kubernetes components |
| 163 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 164 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 165 | node_name: {{ HOSTNAME_CFG01 }} |
| 166 | retry: {count: 3, delay: 5} |
| 167 | skip_fail: false |
| 168 | |
| 169 | - description: Setup etcd server on primary controller |
| 170 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 171 | -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup |
| 172 | node_name: {{ HOSTNAME_CFG01 }} |
| 173 | retry: {count: 1, delay: 5} |
| 174 | skip_fail: false |
| 175 | |
Victor Ryzhenkin | 43c0d0e | 2017-07-07 19:53:25 +0400 | [diff] [blame] | 176 | - description: Workaround for https://mirantis.jira.com/browse/PROD-12798 |
| 177 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 178 | -C 'I@kubernetes:master' service.restart 'keepalived' |
| 179 | node_name: {{ HOSTNAME_CFG01 }} |
| 180 | retry: {count: 1, delay: 5} |
| 181 | skip_fail: false |
| 182 | |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 183 | - description: Run Kubernetes master without setup |
| 184 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 185 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 186 | node_name: {{ HOSTNAME_CFG01 }} |
| 187 | retry: {count: 1, delay: 5} |
| 188 | skip_fail: true |
| 189 | |
| 190 | - description: Run Kubernetes master setup |
| 191 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 192 | -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup |
| 193 | node_name: {{ HOSTNAME_CFG01 }} |
| 194 | retry: {count: 1, delay: 5} |
| 195 | skip_fail: true |
| 196 | |
| 197 | - description: Restart Kubelet |
| 198 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 199 | -C 'I@kubernetes:pool' service.restart 'kubelet' |
| 200 | node_name: {{ HOSTNAME_CFG01 }} |
| 201 | retry: {count: 1, delay: 5} |
| 202 | skip_fail: true |
| 203 | |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 204 | - description: Reboot Opencontrail compute nodes |
| 205 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 206 | -C 'I@opencontrail:compute' system.reboot |
| 207 | node_name: {{ HOSTNAME_CFG01 }} |
| 208 | retry: {count: 1, delay: 5} |
Sergii Golovatiuk | f648ad4 | 2017-06-23 13:39:11 +0200 | [diff] [blame] | 209 | skip_fail: true |