blob: 1cd431a531b468493668325eb7c4a32b5497c435 [file] [log] [blame]
Tomáš Kukrálbd9af062017-05-02 23:16:44 +02001#!/bin/bash -xe
2exec > >(tee -i /tmp/"$(basename "$0" .sh)"_"$(date '+%Y-%m-%d_%H-%M-%S')".log) 2>&1
3
4# Create and distribute SSL certificates for services using salt state
Tomáš Kukrál509e06e2017-05-10 19:51:26 +02005salt '*' state.sls salt
Tomáš Kukrálbd9af062017-05-02 23:16:44 +02006
7# Install keepalived
Tomáš Kukrál509e06e2017-05-10 19:51:26 +02008salt -C 'I@keepalived:cluster' state.sls keepalived -b 1
Tomáš Kukrálbd9af062017-05-02 23:16:44 +02009
10# Install haproxy
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020011salt -C 'I@haproxy:proxy' state.sls haproxy
12salt -C 'I@haproxy:proxy' service.status haproxy
Tomáš Kukrálbd9af062017-05-02 23:16:44 +020013
14# Install docker
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020015salt -C 'I@docker:host' state.sls docker.host
16salt -C 'I@docker:host' cmd.run "docker ps"
Tomáš Kukrálbd9af062017-05-02 23:16:44 +020017
18# Install etcd
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020019salt -C 'I@etcd:server' state.sls etcd.server.service
20salt -C 'I@etcd:server' cmd.run ". /var/lib/etcd/configenv && etcdctl cluster-health"
Tomáš Kukrálbd9af062017-05-02 23:16:44 +020021
22# Install Kubernetes and Calico
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020023salt -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
24salt -C 'I@kubernetes:pool' state.sls kubernetes.pool
25salt -C 'I@kubernetes:pool' cmd.run "calicoctl node status"
26salt -C 'I@kubernetes:pool' cmd.run "calicoctl get ippool"
Tomáš Kukrálbd9af062017-05-02 23:16:44 +020027
28# Setup NAT for Calico
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020029salt -C 'I@kubernetes:master' --subset 1 state.sls etcd.server.setup
Tomáš Kukrálbd9af062017-05-02 23:16:44 +020030
31# Run whole master to check consistency
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020032salt -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
Tomáš Kukrálbd9af062017-05-02 23:16:44 +020033
34# Register addons
Tomáš Kukrál509e06e2017-05-10 19:51:26 +020035salt -C 'I@kubernetes:master' --subset 1 state.sls kubernetes.master.setup