| {% from 'cookied-bm-mcp-pike-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| |
| - description: Install keepalived on primary controller |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keepalived:cluster and *01*' state.sls keepalived |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: Install keepalived |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@keepalived:cluster' state.sls keepalived |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 10} |
| skip_fail: false |
| |
| - description: Install haproxy |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@haproxy:proxy' state.sls haproxy |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install etcd |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@etcd:server' state.sls etcd.server.service |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install certs |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@etcd:server' salt.minion -b 1 |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 5} |
| skip_fail: false |
| |
| - description: Install etcd |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@etcd:server' state.sls etcd.server.service |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Check the etcd health |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install Kubernetes Addons |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Install Kubernetes components |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 5, delay: 60} |
| skip_fail: false |
| |
| # Opencontrail Control Plane |
| |
| - description: Create configuration files for OpenContrail |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Configure OpenContrail as an add-on for Kubernetes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Verify the status of the OpenContrail service |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Set up the OpenContrail resources |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@opencontrail:database:id:1' state.sls opencontrail.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| # OpenContrail vrouters |
| - description: Refresh pillars on cmp* |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'cmp*' saltutil.refresh_pillar |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Sync all on contrail computes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@opencontrail:compute' saltutil.sync_all |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Apply highstate on contrail computes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Reboot contrail computes |
| cmd: salt --timeout=600 -C 'I@opencontrail:compute' system.reboot |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: true |
| |
| - description: Apply opencontrail.client on contrail computes |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@opencontrail:compute' state.sls opencontrail.client |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |
| |
| - description: Run Kubernetes master without setup |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 3, delay: 5} |
| skip_fail: true |
| |
| - description: Run Kubernetes master setup |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Restart Kubelet |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:pool' service.restart 'kubelet' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Check nodes registrations |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| -C 'I@kubernetes:pool' cmd.run 'sleep 60; kubectl get nodes' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: true |
| |
| - description: Renew hosts file on a whole cluster |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host; |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 5} |
| skip_fail: false |