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 | |
| 3 | #Kubernetes |
| 4 | - description: Install docker |
| 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 6 | -C 'I@docker:host' state.sls docker.host |
| 7 | node_name: {{ HOSTNAME_CFG01 }} |
| 8 | retry: {count: 1, delay: 5} |
| 9 | skip_fail: false |
| 10 | |
| 11 | - description: Check docker |
| 12 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 13 | -C 'I@docker:host' cmd.run 'docker ps' |
| 14 | node_name: {{ HOSTNAME_CFG01 }} |
| 15 | retry: {count: 1, delay: 5} |
| 16 | skip_fail: false |
| 17 | |
| 18 | - description: Install etcd |
| 19 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 20 | -C 'I@etcd:server' state.sls etcd.server.service |
| 21 | node_name: {{ HOSTNAME_CFG01 }} |
| 22 | retry: {count: 1, delay: 5} |
| 23 | skip_fail: false |
| 24 | |
| 25 | - description: Check the etcd health |
| 26 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 27 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 1, delay: 5} |
| 30 | skip_fail: false |
| 31 | |
| 32 | - description: Install keepalived on primary controller |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 34 | -C 'I@keepalived:cluster and *01*' state.sls keepalived |
| 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 10} |
| 37 | skip_fail: true |
| 38 | |
| 39 | - description: Install keepalived on all controllers |
| 40 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 41 | -C 'I@keepalived:cluster' state.sls keepalived |
| 42 | node_name: {{ HOSTNAME_CFG01 }} |
| 43 | retry: {count: 1, delay: 10} |
| 44 | skip_fail: true |
| 45 | |
| 46 | - description: Install nginx |
| 47 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 48 | -C 'I@nginx:server' state.sls nginx |
| 49 | node_name: {{ HOSTNAME_CFG01 }} |
| 50 | retry: {count: 1, delay: 5} |
| 51 | skip_fail: false |
| 52 | |
| 53 | - description: Install Kubernetes Addons |
| 54 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 55 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 5} |
| 58 | skip_fail: true |
| 59 | |
| 60 | - description: Install Kubernetes components |
| 61 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 62 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 5} |
| 65 | skip_fail: false |
| 66 | |
| 67 | - description: Setup etcd server on primary controller |
| 68 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 69 | -C 'I@kubernetes:master and *01*' state.sls etcd.server.setup |
| 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 1, delay: 5} |
| 72 | skip_fail: false |
| 73 | |
| 74 | - description: Run Kubernetes master without setup |
| 75 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 76 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 1, delay: 5} |
| 79 | skip_fail: true |
| 80 | |
| 81 | - description: Run Kubernetes master setup |
| 82 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 83 | -C 'I@kubernetes:master and *01*' state.sls kubernetes.master.setup |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 1, delay: 5} |
| 86 | skip_fail: true |
| 87 | |
| 88 | - description: Restart Kubelet |
| 89 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 90 | -C 'I@kubernetes:pool' service.restart 'kubelet' |
| 91 | node_name: {{ HOSTNAME_CFG01 }} |
| 92 | retry: {count: 1, delay: 5} |
| 93 | skip_fail: true |
| 94 | |
| 95 | # Opencontrail |
| 96 | - description: Install RabbitMQ |
| 97 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 98 | -C 'I@rabbitmq:server' state.sls rabbitmq |
| 99 | node_name: {{ HOSTNAME_CFG01 }} |
| 100 | retry: {count: 2, delay: 10} |
| 101 | skip_fail: false |
| 102 | |
| 103 | - description: Check RabbitMQ |
| 104 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 105 | -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status" |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 10} |
| 108 | skip_fail: false |
| 109 | |
| 110 | - description: Install Opencontrail db on ctl01 |
| 111 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 112 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.database |
| 113 | node_name: {{ HOSTNAME_CFG01 }} |
| 114 | retry: {count: 2, delay: 20} |
| 115 | skip_fail: false |
| 116 | |
| 117 | - description: Install Opencontrail db on all nodes |
| 118 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 119 | -C 'I@opencontrail:database' state.sls opencontrail.database |
| 120 | node_name: {{ HOSTNAME_CFG01 }} |
| 121 | retry: {count: 2, delay: 20} |
| 122 | skip_fail: false |
| 123 | |
| 124 | - description: Install Opencontrail control on ctl01 |
| 125 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 126 | -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client |
| 127 | node_name: {{ HOSTNAME_CFG01 }} |
| 128 | retry: {count: 1, delay: 5} |
| 129 | skip_fail: false |
| 130 | |
| 131 | - description: Install Opencontrail control on all nodes |
| 132 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 133 | -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| 134 | node_name: {{ HOSTNAME_CFG01 }} |
| 135 | retry: {count: 1, delay: 5} |
| 136 | skip_fail: false |
| 137 | |
| 138 | - description: Install Opencontrail on collector |
| 139 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 140 | -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client |
| 141 | node_name: {{ HOSTNAME_CFG01 }} |
| 142 | retry: {count: 1, delay: 5} |
| 143 | skip_fail: false |
| 144 | |
| 145 | - description: Test Opencontrail |
| 146 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 147 | -C 'I@opencontrail:control' cmd.run 'contrail-status' |
| 148 | node_name: {{ HOSTNAME_CFG01 }} |
| 149 | retry: {count: 1, delay: 5} |
| 150 | skip_fail: false |
| 151 | |
| 152 | - description: Install Opencontrail client |
| 153 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 154 | -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client' |
| 155 | node_name: {{ HOSTNAME_CFG01 }} |
| 156 | retry: {count: 1, delay: 5} |
| 157 | skip_fail: false |
| 158 | |
| 159 | - description: Install Opencontrail client on computes |
| 160 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 161 | -C 'I@opencontrail:compute' state.sls 'opencontrail.client' |
| 162 | node_name: {{ HOSTNAME_CFG01 }} |
| 163 | retry: {count: 1, delay: 5} |
| 164 | skip_fail: false |
| 165 | |
| 166 | - description: Install Opencontrail on computes |
| 167 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 168 | -C 'I@opencontrail:compute' state.sls 'opencontrail' |
| 169 | node_name: {{ HOSTNAME_CFG01 }} |
| 170 | retry: {count: 1, delay: 5} |
| 171 | skip_fail: false |
| 172 | |
| 173 | - description: Reboot Opencontrail compute nodes |
| 174 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 175 | -C 'I@opencontrail:compute' system.reboot |
| 176 | node_name: {{ HOSTNAME_CFG01 }} |
| 177 | retry: {count: 1, delay: 5} |
| 178 | skip_fail: false |
| 179 | |
| 180 | # Run conformance tests |
| 181 | - description: Run tests |
| 182 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run "docker run --rm --net=host -e API_SERVER='http://127.0.0.1:8080' docker-dev-virtual.docker.mirantis.net/mirantis/kubernetes/k8s-conformance:v1.6.1-1_1491395924598 >> e2e.output" |
| 183 | node_name: {{ HOSTNAME_CFG01 }} |
| 184 | retry: {count: 1, delay: 5} |
| 185 | skip_fail: false |