blob: c92152d9d195ec67b5d379f4d154ee8f5faeebd5 [file] [log] [blame]
Artem Panchenkoedf70ef2017-06-13 09:14:34 +03001{% from 'virtual-mcp11-k8s-calico/underlay.yaml' import HOSTNAME_CFG01 with context %}
2
Artem Panchenko501e67e2017-06-14 14:59:18 +03003- description: Set k8s deploy parameters
4 cmd: |
5 {% for k8s_opt, value in config.k8s_deploy.items() %}
6 {% if value|string() %}
7 salt-call reclass.cluster_meta_set {{ k8s_opt }} {{ value }};
8 {% endif %}
9 {% endfor %}
10 node_name: {{ HOSTNAME_CFG01 }}
11 retry: {count: 1, delay: 1}
12 skip_fail: false
13
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030014- description: Install etcd
15 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
16 -C 'I@etcd:server' state.sls etcd.server.service
17 node_name: {{ HOSTNAME_CFG01 }}
18 retry: {count: 1, delay: 5}
19 skip_fail: false
20
21- description: Check the etcd health
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
23 -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 1, delay: 5}
26 skip_fail: false
27
28- description: Install Kubernetes and Calico
29 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
30 -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons;
31 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' state.sls kubernetes.pool;
32 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@kubernetes:pool' cmd.run 'calicoctl node status';
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 5}
35 skip_fail: false
36
37- description: Setup NAT for Calico
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
39 -C 'I@etcd:server' --subset 1 state.sls etcd.server.setup
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 5}
42 skip_fail: false
43
44- description: Run whole master to check consistency
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: true
50
akasatkin6a3c36e2017-08-21 19:25:00 +030051- description: Restart kubelet
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@kubernetes:pool' service.restart kubelet
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030058- description: Register addons
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false