-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.4 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
POSTGRES_YAML := ./deployment/postgresql/deployment.yml
POSTGRES_SERVICE_YAML := ./deployment/postgresql/service.yml
REDIS_YAML := ./deployment/redis/deployment.yml
REDIS_SERVICE_YAML := ./deployment/redis/service.yml
GO_API_YAML := ./deployment/app/deployment.yml
GO_API_SERVICE_YAML := ./deployment/app/service.yml
HPA_YAML := ./deployment/hpa/hpa.yml
all: cluster apply
cluster:
minikube start
eval $(minikube docker-env)
minikube addons enable metrics-server
minikube addons enable dashboard
clean:
minikube stop
minikube delete
re: delete apply
apply:
kubectl apply -f $(POSTGRES_YAML)
kubectl apply -f $(POSTGRES_SERVICE_YAML)
kubectl apply -f $(REDIS_YAML)
kubectl apply -f $(REDIS_SERVICE_YAML)
kubectl wait --for=condition=available deployment/postgres --timeout=300s
kubectl wait --for=condition=available deployment/redis --timeout=300s
kubectl apply -f $(GO_API_YAML)
kubectl apply -f $(GO_API_SERVICE_YAML)
kubectl wait --for=condition=available deployment/go-api --timeout=300s
hpa:
minikube addons enable metrics-server
eval $(minikube docker-env)
kubectl apply -f $(HPA_YAML)
delete:
kubectl delete -f $(POSTGRES_YAML)
kubectl delete -f $(POSTGRES_SERVICE_YAML)
kubectl delete -f $(REDIS_YAML)
kubectl delete -f $(REDIS_SERVICE_YAML)
kubectl delete -f $(GO_API_YAML)
kubectl delete -f $(GO_API_SERVICE_YAML)
kubectl delete -f $(HPA_YAML)
PHONY: all cluster clean re apply delete hpa