-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (47 loc) · 1.31 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
#####################
### General Settings
#####################
# Use Bash as default shell
SHELL := sh
# Set bash strict mode and enable warnings
.ONESHELL:
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# Making steps silent - don't print all the commands to stdout
.SILENT:
.PHONY: help
help:
$(info Creates a local cluster using Kind (Kubernetes in Docker))
$(info Usage: make <target>)
$(info )
$(info Available targets:)
$(info - cluster: creates the cluster with nginx ingress)
$(info - cluster-cilium: creates the cluster with Cilium enabled)
$(info - cluster-istio: creates the cluster with Istio enabled)
$(info - cleanup: deletes the cluster)
.PHONY: cluster
cluster: init
cd cluster
terraform apply -auto-approve $$MESH_OPTS
cd -
.PHONY: cluster-istio
cluster-istio:
@echo "Creating the cluster with Istio enabled"
$(MAKE) cluster MESH_OPTS="--var=enable_istio=true"
.PHONY: cluster-cilium
cluster-cilium:
@echo "Creating the cluster with Cilium enabled"
$(MAKE) cluster MESH_OPTS="--var=enable_cilium=true"
.PHONY: init
init:
cd cluster
terraform init -upgrade -reconfigure
terraform fmt -recursive
cd -
.PHONY: cleanup
cleanup:
cd cluster
terraform destroy -auto-approve
rm -f local-cluster-config || echo "File not found, skipping"
cd -