-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (46 loc) · 2.16 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
%-development: clustername ?= terra
%-development: environment := development
terraform ?= docker-compose run terraform
kubeadm ?= docker-compose run kubeadm
f5er ?= docker-compose run f5er
shell ?= docker-compose run shell
token:
@echo "+++ Generating random kubeadm bootstrap token"
$(kubeadm) token generate
@echo "+++ Copy the above bootstrap token for use in your k8s_bootstrap_token variable"
plan-%:
@echo "+++ Running terraform plan for $(environment)"
$(terraform) plan -var-file global.tfvars -var-file=$(environment).tfvars -state=$(environment).tfstate kluster
apply-%:
@echo "+++ Running terraform apply for $(environment)"
$(terraform) apply -var-file global.tfvars -var-file=$(environment).tfvars -state=$(environment).tfstate kluster
show-%:
@echo "+++ Running terraform apply for $(environment)"
$(terraform) show $(environment).tfstate
output-%:
@echo "+++ Running terraform output for $(environment)"
$(terraform) output $(environment).tfstate
destroy-%:
@echo "+++ Running terraform apply for $(environment)"
$(terraform) destroy -var-file global.tfvars -var-file=$(environment).tfvars -state=$(environment).tfstate kluster
certs-%:
@echo "+++ Running certificate setup for $(environment)"
$(shell) ./bin/certs -e $(environment)
install-%:
@echo "+++ Installing base k8s components for $(environment)"
$(shell) ./bin/install $(clustername) $(environment)
f5er-apps-add-%:
@echo "+++ Adding f5 load balancer setup for apps $(clustername)-$(environment)"
$(f5er) add stack -i /f5/$(clustername)-$(environment)-apps.json
f5er-apps-delete-%:
@echo "+++ Deleting f5 load balancer setup for apps $(clustername)-$(environment)"
$(f5er) delete stack -i /f5/$(clustername)-$(environment)-apps.json
f5er-api-add-%:
@echo "+++ Adding f5 load balancer setup for api $(clustername)-$(environment)"
$(f5er) add stack -i /f5/$(clustername)-$(environment)-api.json
f5er-api-delete-%:
@echo "+++ Deleting f5 load balancer setup for api $(clustername)-$(environment)"
$(f5er) delete stack -i /f5/$(clustername)-$(environment)-api.json
deploy-%:
@echo "+++ Installing components for $(clustername)-$(environment)"
$(shell) ./bin/deploy.sh $(environment)