-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (43 loc) · 1.68 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
.PHONY: help all port ip prepare create destroy start stop
.DEFAULT: help
ifndef VERBOSE
.SILENT:
endif
NO_COLOR=\033[0m
GREEN=\033[32;01m
YELLOW=\033[33;01m
RED=\033[31;01m
SHELL=bash
CWD:=$(shell pwd -P)
VERSION?=0.1.0
help:: ## Show this help
echo -e "\nVersion \033[32m$(VERSION)\033[0m"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-20s$(NO_COLOR) %s\n", $$1, $$2}'
prepare-minikube: ## Prepare minikube env
eval $(minikube docker-env)
kubectl config set-context minikube
port: ## Find the port used by the production service
kubectl -n production get services | grep /TCP | awk -F'80:' '{print $$2}' | awk -F'/TCP' '{print $$1}'
service: ## Find the external IP used by the production service`
kubectl -n production get services
create:
kubectl -n production create -f k8s/namespace-production.yaml
destroy:
kubectl -n production delete -f k8s/namespace-production.yaml
start:
kubectl -n production create -f k8s/cluster_roles.yaml
kubectl -n production create -f k8s/deployment.yaml
kubectl -n production create -f k8s/service.yaml
kubectl -n production create -f k8s/secrets.yaml
kubectl -n production create configmap vm-config \
--from-literal=name=${MY_BASENAME}@${MY_POD_IP} \
--from-literal=setcookie=${ERLANG_COOKIE} \
--from-literal=smp=auto
# kubectl -n production create -f k8s/ingress.yaml
stop:
kubectl -n production delete -f k8s/cluster_roles.yaml
kubectl -n production delete -f k8s/deployment.yaml
kubectl -n production delete -f k8s/service.yaml
kubectl -n production delete -f k8s/secrets.yaml
kubectl -n production delete configmap vm-config
# kubectl -n production delete -f k8s/ingress.yaml