Victor Ryzhenkin | 42e2423 | 2017-11-15 08:01:20 -0400 | [diff] [blame] | 1 | {% from 'k8s-ha-calico/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | |
| 3 | # Kubernetes |
| 4 | - description: Install etcd |
| 5 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 6 | -C 'I@etcd:server' state.sls etcd.server.service |
| 7 | node_name: {{ HOSTNAME_CFG01 }} |
| 8 | retry: {count: 3, delay: 5} |
| 9 | skip_fail: false |
| 10 | |
| 11 | - description: Check the etcd health |
| 12 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 13 | -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health' |
| 14 | node_name: {{ HOSTNAME_CFG01 }} |
| 15 | retry: {count: 1, delay: 5} |
| 16 | skip_fail: false |
| 17 | |
| 18 | - description: Install Kubernetes addons |
| 19 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 20 | -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons |
| 21 | node_name: {{ HOSTNAME_CFG01 }} |
| 22 | retry: {count: 3, delay: 5} |
| 23 | skip_fail: false |
| 24 | |
| 25 | - description: Install Kubernetes and Calico |
| 26 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 27 | -C 'I@kubernetes:pool' state.sls kubernetes.pool |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 3, delay: 5} |
| 30 | skip_fail: false |
| 31 | |
| 32 | - description: Setup NAT for Calico |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 34 | -C 'I@etcd:server and *01*' state.sls etcd.server.setup |
| 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 5} |
| 37 | skip_fail: false |
| 38 | |
| 39 | - description: Run whole master to check consistency |
| 40 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 41 | -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup |
| 42 | node_name: {{ HOSTNAME_CFG01 }} |
| 43 | retry: {count: 1, delay: 5} |
| 44 | skip_fail: true |
| 45 | |
| 46 | - description: Register addons |
| 47 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 04eee85 | 2018-10-03 23:43:07 +0400 | [diff] [blame] | 48 | -C 'I@kubernetes:master' state.sls kubernetes.master.setup |
Victor Ryzhenkin | 42e2423 | 2017-11-15 08:01:20 -0400 | [diff] [blame] | 49 | node_name: {{ HOSTNAME_CFG01 }} |
| 50 | retry: {count: 1, delay: 5} |
| 51 | skip_fail: false |
| 52 | |
| 53 | - description: Restart kubelet |
| 54 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 55 | -C 'I@kubernetes:pool' service.restart kubelet |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 5} |
| 58 | skip_fail: false |
| 59 | |
| 60 | - description: Renew hosts file on a whole cluster |
| 61 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '*' state.sls linux.network.host; |
| 62 | node_name: {{ HOSTNAME_CFG01 }} |
| 63 | retry: {count: 1, delay: 5} |
| 64 | skip_fail: false |
| 65 | |
| 66 | - description: Get kubeconfig |
| 67 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Victor Ryzhenkin | 2a2cd8e | 2018-05-07 18:38:43 +0400 | [diff] [blame] | 68 | -C 'I@kubernetes:control and *01*' cmd.run 'cat /etc/kubernetes/admin-kube-config && echo "Salt command execution success"' |
Victor Ryzhenkin | 42e2423 | 2017-11-15 08:01:20 -0400 | [diff] [blame] | 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 1, delay: 5} |
| 71 | skip_fail: false |
| 72 | |
| 73 | - description: Install tiller client |
| 74 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 75 | -C 'I@helm:client' test.ping && salt --hard-crash --state-output=mixed --state-verbose=False |
| 76 | -C 'I@helm:client' state.sls helm |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 3, delay: 15} |
| 79 | skip_fail: true |