-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (42 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.PHONEY: build test deploy down clean \
kubespray _ks_init _ks_status _ks_update_vagrantfile
_DIR_KUBESPRAY=./roles/kubespray
_KUBESPRAY_RELEASE=release-2.13
# LOCAL DEPLOYMENT
build: kubespray
@cd $(_DIR_KUBESPRAY) && vagrant up
build: kubespray up
provision:
# Re Execute nominated vagrant provisioner (ansible)
@cd $(_DIR_KUBESPRAY) && vagrant provision
up:
@cd $(_DIR_KUBESPRAY) && vagrant up
kubespray: _ks_init _ks_status _ks_update_vagrantfile
_ks_init:
# Initialise submodule submodule
@git submodule update --init --recursive
_ks_status:
# Confirm Kubespray Release 2.13 commit 01dbc909
@cd $(_DIR_KUBESPRAY) && git branch
_ks_update_vagrantfile:
# Update OS image
@cat $(_DIR_KUBESPRAY)/Vagrantfile | sed 's/generic\/ubuntu1804/ubuntu\/bionic64/g' > tmp
# Update Container Network Interface
@cat tmp | sed 's/flannel/calico/g' > $(_DIR_KUBESPRAY)/Vagrantfile
@rm tmp
test:
# Perform api call to Kubernetes master
login_1:
@cd $(_DIR_KUBESPRAY) && vagrant ssh k8s-1
login_2:
@cd $(_DIR_KUBESPRAY) && vagrant ssh k8s-2
login_3:
@cd $(_DIR_KUBESPRAY) && vagrant ssh k8s-3
down:
# Suspend vagrant local cluster
@cd $(_DIR_KUBESPRAY) && vagrant suspend
clean:
# Destroy local cluster
@cd $(_DIR_KUBESPRAY) && vagrant destroy
# PRODUCTION OPERATIONS
# REFER TO KUBESPRAY DOCS