-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
127 lines (103 loc) · 2.94 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.PHONY: up
up: rt-up client-up k8s-master-up k8s-nodes-up
.PHONY: provision
provision: rt-provision client-provision k8s-master-provision k8s-nodes-provision
.PHONY: down
down: rt-down client-down k8s-master-down k8s-nodes-down
.PHONY: clean
clean: rt-clean client-clean k8s-master-clean k8s-nodes-clean
# rt-01
.PHONY: rt-up
rt-up: rt.ssh.config
rt.ssh.config: Vagrantfile
vagrant up rt-01
vagrant ssh-config rt-01 > rt.ssh.config
.PHONY: rt-provision
rt-provision: rt.ssh.config
vagrant provision rt-01
.PHONY: rt-01-ssh
rt-01-ssh: rt.ssh.config
ssh -F rt.ssh.config rt-01
.PHONY: rt-down
rt-down:
vagrant halt rt-01
rm -f rt.ssh.config
.PHONY: rt-clean
rt-clean:
vagrant destroy -f rt-01
rm -f rt.ssh.config
# client-01
.PHONY: client-up
client-up: client.ssh.config
client.ssh.config: Vagrantfile
vagrant up client-01
vagrant ssh-config client-01 > client.ssh.config
.PHONY: client-provision
client-provision: client.ssh.config
vagrant provision client-01
.PHONY: client-01-ssh
client-01-ssh: client.ssh.config
ssh -F client.ssh.config client-01
.PHONY: client-down
client-down:
vagrant halt client-01
rm -f client.ssh.config
.PHONY: client-clean
client-clean:
vagrant destroy -f client-01
rm -f client.ssh.config
# k8s-cluster
.PHONY: k8s-cluster-up
k8s-cluster-up: k8s-master-up k8s-nodes-up
.PHONY: k8s-cluster-provision
k8s-cluster-provision: k8s-master-provision k8s-nodes-provision
.PHONY: k8s-cluster-down
k8s-cluster-down: k8s-master-down k8s-nodes-down
.PHONY: k8s-cluster-clean
k8s-cluster-clean: k8s-master-clean k8s-nodes-clean
# k8s-master-01
.PHONY: k8s-master-up
k8s-master-up: k8s-master.ssh.config
k8s-master.ssh.config: Vagrantfile
vagrant up k8s-master-01
vagrant ssh-config k8s-master-01 > k8s-master.ssh.config
.PHONY: k8s-master-provision
k8s-master-provision: k8s-master.ssh.config
vagrant provision k8s-master-01
.PHONY: k8s-master-01-ssh
k8s-master-01-ssh: k8s-master.ssh.config
ssh -F k8s-master.ssh.config k8s-master-01
.PHONY: k8s-master-down
k8s-master-down:
vagrant halt k8s-master-01
rm -f k8s-master.ssh.config
.PHONY: k8s-master-clean
k8s-master-clean:
vagrant destroy -f k8s-master-01
rm -f k8s-master.ssh.config
# k8s-node-XX
.PHONY: k8s-nodes-up
k8s-nodes-up: k8s-nodes.ssh.config
k8s-nodes.ssh.config: Vagrantfile
vagrant up --parallel /k8s-node/
vagrant ssh-config /k8s-node/ > k8s-nodes.ssh.config
.PHONY: k8s-nodes-provision
k8s-nodes-provision: k8s-nodes.ssh.config
vagrant up --parallel --provision /k8s-node/
.PHONY: k8s-node-01-ssh
k8s-node-01-ssh: k8s-nodes.ssh.config
ssh -F k8s-nodes.ssh.config k8s-node-01
.PHONY: k8s-node-02-ssh
k8s-node-02-ssh: k8s-nodes.ssh.config
ssh -F k8s-nodes.ssh.config k8s-node-02
.PHONY: k8s-node-03-ssh
k8s-node-03-ssh: k8s-nodes.ssh.config
ssh -F k8s-nodes.ssh.config k8s-node-03
.PHONY: k8s-nodes-down
k8s-nodes-down:
vagrant halt /k8s-node/
rm -f k8s-nodes.ssh.config
.PHONY: k8s-nodes-clean
k8s-nodes-clean:
vagrant destroy -f /k8s-node/
rm -f k8s-nodes.ssh.config