-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (43 loc) · 1.55 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
cluster_name = cluster-dev
.PHONY: test
test:
@echo "\n🛠️ Running unit tests..."
go test ./...
.PHONY: build
build:
@echo "\n🔧 Building Go binaries..."
GOOS=darwin GOARCH=amd64 go build -o bin/image-annotator-webhook-darwin-amd64 .
GOOS=linux GOARCH=amd64 go build -o bin/image-annotator-webhook-linux-amd64 .
.PHONY: docker-build
docker-build:
@echo "\n📦 Building simple-kubernetes-webhook Docker image..."
docker build -t image-annotator-webhook:latest .
.PHONY: cluster
cluster:
@echo "\n🔧 Creating Kubernetes cluster..."
kind create cluster --name $(cluster_name)
.PHONY: delete-cluster
delete-cluster:
@echo "\n♻️ Deleting Kubernetes cluster..."
kind delete cluster --name $(cluster_name)
.PHONY: push
push: docker-build
@echo "\n📦 Pushing admission-webhook image into Kind's Docker daemon..."
kind load docker-image image-annotator-webhook:latest --name $(cluster_name)
.PHONY: deploy-webhook
deploy-webhook:
@echo "\n🪝 Deploying webhook manifests to Kind cluster..."
kubectl apply -f k8s-manifests/webhook/
.PHONY: push-deploy
push-deploy: push
@echo "\n Redeploying webhook pod"
kubectl delete pod -n image-annotator -l app.kubernetes.io/name=image-annotator-webhook
.PHONY: deploy-testing
deploy-testing: push-deploy
@echo "\n📦 Deploying webhook manifests to Kind cluster..."
kubectl delete ns testing --force --grace-period=0 || true
kubectl apply -f k8s-manifests/testing/
.PHONY: logs-webhook
logs-webhook:
kubectl logs -n image-annotator -l app.kubernetes.io/name=image-annotator-webhook
kubectl events -n testing