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 | |
| 3 | # Install support services |
| 4 | - description: Create and distribute SSL certificates for services using salt state |
| 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' state.sls salt |
| 6 | node_name: {{ HOSTNAME_CFG01 }} |
| 7 | retry: {count: 1, delay: 10} |
| 8 | skip_fail: true |
| 9 | |
| 10 | - description: Install keepalived |
| 11 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 12 | -C 'I@keepalived:cluster' state.sls keepalived -b 1 |
| 13 | node_name: {{ HOSTNAME_CFG01 }} |
| 14 | retry: {count: 1, delay: 10} |
| 15 | skip_fail: true |
| 16 | |
| 17 | - description: Check the VIP |
| 18 | cmd: | |
| 19 | OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`; |
| 20 | echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}"; |
| 21 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keepalived:cluster' cmd.run "ip a | grep ${OPENSTACK_CONTROL_ADDRESS}" | grep -B1 ${OPENSTACK_CONTROL_ADDRESS} |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | retry: {count: 1, delay: 5} |
| 24 | skip_fail: false |
| 25 | |
| 26 | |
| 27 | - description: Install haproxy |
| 28 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 29 | -C 'I@haproxy:proxy' state.sls haproxy |
| 30 | node_name: {{ HOSTNAME_CFG01 }} |
| 31 | retry: {count: 1, delay: 5} |
| 32 | skip_fail: false |
| 33 | |
| 34 | - description: Install haproxy.service |
| 35 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 36 | -C 'I@haproxy:proxy' service.status haproxy |
| 37 | node_name: {{ HOSTNAME_CFG01 }} |
| 38 | retry: {count: 1, delay: 5} |
| 39 | skip_fail: false |
| 40 | |
| 41 | - description: Install docker |
| 42 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 43 | -C 'I@docker:host' state.sls docker.host |
| 44 | node_name: {{ HOSTNAME_CFG01 }} |
| 45 | retry: {count: 1, delay: 5} |
| 46 | skip_fail: false |
| 47 | |
| 48 | - description: Check docker |
| 49 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 50 | -C 'I@docker:host' cmd.run 'docker ps' |
| 51 | node_name: {{ HOSTNAME_CFG01 }} |
| 52 | retry: {count: 1, delay: 5} |
| 53 | skip_fail: false |
| 54 | |
| 55 | - description: Install etcd |
| 56 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 57 | -C 'I@etcd:server' state.sls etcd.server.service |
| 58 | node_name: {{ HOSTNAME_CFG01 }} |
| 59 | retry: {count: 1, delay: 5} |
| 60 | skip_fail: false |
| 61 | |
| 62 | - description: Check the etcd health |
| 63 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 64 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| 65 | node_name: {{ HOSTNAME_CFG01 }} |
| 66 | retry: {count: 1, delay: 5} |
| 67 | skip_fail: false |
| 68 | |
| 69 | - description: Install Kubernetes and Calico |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 71 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons; |
| 72 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' state.sls kubernetes.pool; |
| 73 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' cmd.run 'calicoctl node status'; |
| 74 | node_name: {{ HOSTNAME_CFG01 }} |
| 75 | retry: {count: 1, delay: 5} |
| 76 | skip_fail: false |
| 77 | |
| 78 | - description: Setup NAT for Calico |
| 79 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 80 | -C 'I@etcd:server' --subset 1 state.sls etcd.server.setup |
| 81 | node_name: {{ HOSTNAME_CFG01 }} |
| 82 | retry: {count: 1, delay: 5} |
| 83 | skip_fail: false |
| 84 | |
| 85 | - description: Run whole master to check consistency |
| 86 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 87 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 88 | node_name: {{ HOSTNAME_CFG01 }} |
| 89 | retry: {count: 1, delay: 5} |
| 90 | skip_fail: true |
| 91 | |
| 92 | |
| 93 | - description: Register addons |
| 94 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 95 | -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup |
| 96 | node_name: {{ HOSTNAME_CFG01 }} |
| 97 | retry: {count: 1, delay: 5} |
| 98 | skip_fail: false |
| 99 | |
| 100 | - description: Install contrail |
| 101 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 102 | -C 'I@opencontrail:compute' state.sls opencontrail |
| 103 | node_name: {{ HOSTNAME_CFG01 }} |
| 104 | retry: {count: 1, delay: 5} |
| 105 | skip_fail: false |
| 106 | |
| 107 | - description: Reboot computes |
| 108 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 109 | -C 'I@opencontrail:compute' system.reboot |
| 110 | node_name: {{ HOSTNAME_CFG01 }} |
| 111 | retry: {count: 1, delay: 5} |
| 112 | skip_fail: false |