-
Notifications
You must be signed in to change notification settings - Fork 145
/
Makefile
67 lines (50 loc) · 1.45 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
SHELL += -eu
AWS_REGION ?= us-west-1
COREOS_CHANNEL ?= stable
COREOS_VM_TYPE ?= hvm
CLUSTER_NAME ?= testing
AWS_EC2_KEY_NAME ?= k8s-$(CLUSTER_NAME)
DIR_KEY_PAIR := .keypair
DIR_SSL := .ssl
tt:
@echo CLUSTER_NAME = ${CLUSTER_NAME}
@echo AWS_EC2_KEY_NAME = ${AWS_EC2_KEY_NAME}
## generate key-pair, variables and then `terraform apply`
all: prereqs create-keypair ssl init apply
@printf "\nInitializing add-ons\n" && ./scripts/init-addons
## destroy and remove everything
clean: destroy delete-keypair
pkill -f "kubectl proxy" ||:
rm terraform.{tfvars,tfplan} ||:
rm -rf .terraform ||:
rm -rf tmp ||:
rm -rf .cfssl ||:
.cfssl: ; ./scripts/init-cfssl .cfssl ${AWS_REGION}
## start proxy and open kubernetes dashboard
dashboard: ; ./scripts/dashboard
## journalctl on etcd1 (10.0.0.10)
journal: ; @ssh -At core@`terraform output bastion-ip` ssh 10.0.0.10 journalctl -fl
module.%: get init
terraform plan -target $@
terraform apply -target $@
prereqs:
aws --version
@echo
cfssl version
@echo
jq --version
@echo
kubectl version --client
@echo
terraform --version
## ssh into etcd1 (10.0.0.10)
ssh: ; @ssh -A -t core@`terraform output bastion-ip` ssh 10.0.0.10
## ssh into bastion host
ssh-bastion: ; @ssh -A core@`terraform output bastion-ip`
## create tls artifacts
ssl: .cfssl
## smoke it
test: test-ssl test-route53 test-etcd pods dns
include makefiles/*.mk
.DEFAULT_GOAL := help
.PHONY: all clean journal module.% prereqs ssh ssh-bastion ssl test tt