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