-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
66 lines (50 loc) · 1.73 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
SHELL_PATH = /bin/ash
# ==============================================================================
# Testing running system
# expvarmon -ports=":4000" -vars="build,requests,goroutines,errors,panics,mem:memstats.Alloc"
# ==============================================================================
run:
@echo "Running..."
go run app/services/sales-api/main.go | go run app/tooling/logfmt/main.go
# Building containers
VERSION := 1.0.0
all: sales-api
sales-api:
docker build \
-f zarf/docker/dockerfile.sales-api \
-t sales-api-amd64:$(VERSION) \
--build-arg BUILD_REF=$(VERSION) \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
.
KIND_CLUSTER := tikaram-dev-cluster
KIND := kindest/node:v1.27.3
kind-up:
kind create cluster \
--image $(KIND) \
--name $(KIND_CLUSTER) \
--config zarf/k8s/kind/kind-config.yaml
kubectl config set-context --current --namespace=sales-system
kind-down:
kind delete cluster --name $(KIND_CLUSTER)
kind-load:
cd zarf/k8s/kind/sales-pod; kustomize edit set image sales-api-image=sales-api-amd64:$(VERSION)
kind load docker-image sales-api-amd64:$(VERSION) --name $(KIND_CLUSTER)
kind-apply:
kustomize build zarf/k8s/kind/sales-pod | kubectl apply -f -
kind-update: all kind-load kind-restart
kind-update-apply: all kind-load kind-apply
kind-status:
kubectl get nodes -o wide
kubectl get svc -o wide
kubectl get pods -o wide --watch --all-namespaces
kind-status-sales:
kubectl get pods -l app=sales -o wide --watch
kind-logs:
kubectl logs -f -l app=sales --all-containers=true -f --tail=100 | go run app/tooling/logfmt/main.go
kind-restart:
kubectl rollout restart deployment sales-pod
kind-describe:
kubectl describe pod -l app=sales
tidy:
go mod tidy
go mod vendor