blob: 8fc7977dca73896771bf22b55cf8c4e786ec37cf [file] [log] [blame]
{% from 'virtual-mcp11-k8s-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
- description: Sync time on nodes
cmd: salt '*' cmd.run "service ntp stop; ntpd -gq ;
service ntp start; ntp-wait || exit 1"
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 1}
skip_fail: true
- description: Set k8s deploy parameters
cmd: |
{% for k8s_opt, value in config.k8s_deploy.items() %}
{% if value|string() %}
salt-call reclass.cluster_meta_set {{ k8s_opt }} {{ value }};
{% endif %}
{% endfor %}
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 1}
skip_fail: false
# TODO Remove workaround when linklocal on kube-api VIP on ens3 works fine
- description: Replace kube-api VIP with IP of one controller
cmd: |
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' {} +
find /srv/salt/reclass/classes/ -type f -exec sed -i 's/ipf_port:\ 443/ipf_port:\ 6443/g' {} +
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 1}
skip_fail: false
- 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: true
- description: Install keepalived on all controllers
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: true
- description: Install nginx
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@nginx:server' state.sls nginx
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
# Opencontrail Control Plane
- description: Install RabbitMQ
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@rabbitmq:server' state.sls rabbitmq
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 10}
skip_fail: false
- description: Check RabbitMQ
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status"
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 10}
skip_fail: false
- description: Install Opencontrail db on ctl01
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:database and *01*' state.sls opencontrail.database
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 20}
skip_fail: false
- description: Install Opencontrail db on all nodes
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:database' state.sls opencontrail.database
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 20}
skip_fail: false
- description: Install Opencontrail control on ctl01
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
- description: Install Opencontrail control on all nodes
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: Install Opencontrail on collector
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:control' service.restart 'keepalived'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
# OpenContrail vrouters
- description: Install Opencontrail client
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
- description: Install Opencontrail client on 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: 2, delay: 5}
skip_fail: false
- description: Install Opencontrail on computes
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:compute' state.sls 'opencontrail'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 2, delay: 5}
skip_fail: false
- description: Test Opencontrail
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:control' cmd.run 'contrail-status'
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
# Kubernetes
- description: Install docker
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@docker:host' state.sls docker.host
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
- description: Check docker
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@docker:host' cmd.run 'docker ps'
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: 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: true
- 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: 3, delay: 5}
skip_fail: false
- description: Setup etcd server on primary controller
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@kubernetes:master and *01*' state.sls etcd.server.setup
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: false
- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@kubernetes:master' service.restart 'keepalived'
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: 1, delay: 5}
skip_fail: true
- description: Run Kubernetes master setup
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@kubernetes:master and *01*' 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: Reboot Opencontrail compute nodes
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@opencontrail:compute' system.reboot
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
skip_fail: true