-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (66 loc) · 2.23 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Needed for shell expansion
SHELL = /bin/bash
CURRENT_DIR := $(CURDIR)
CONTAINER_NAME=kubeaid-bootstrap-script-dev
NETWORK_NAME=k3d-management-cluster
IMAGE_NAME=kubeaid-bootstrap-script-dev:latest
.PHONY: build-image-dev
build-image-dev:
@docker build -f ./build/Dockerfile.dev --build-arg CPU_ARCHITECTURE=arm64 -t $(IMAGE_NAME) .
.PHONY: remove-image-dev
remove-image-dev:
@docker rmi $(IMAGE_NAME)
.PHONY: run-container-dev
run-container-dev: build-image-dev
@if ! docker network ls | grep -q $(NETWORK_NAME); then \
docker network create $(NETWORK_NAME); \
fi
@docker run --name $(CONTAINER_NAME) \
--network $(NETWORK_NAME) \
--detach \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(CURRENT_DIR):/app \
$(IMAGE_NAME)
# -e SSH_AUTH_SOCK=/ssh-agent \
# -v /dev/bus/usb:/dev/bus/usb \
# -v $(SSH_AUTH_SOCK):/ssh-agent \
.PHONY: exec-container-dev
exec-container-dev:
@docker exec -it $(CONTAINER_NAME) /bin/sh
.PHONY: stop-container-dev
stop-container-dev:
@docker stop $(CONTAINER_NAME)
.PHONY: remove-container-dev
remove-container-dev: stop-container-dev
@docker rm $(CONTAINER_NAME)
.PHONY: generate-sample-config-aws-dev
generate-sample-config-aws-dev:
@go run ./cmd config generate aws
.PHONY: bootstrap-cluster-dev-aws
bootstrap-cluster-dev-aws:
@go run ./cmd cluster bootstrap aws \
--debug \
--config /app/outputs/kubeaid-bootstrap-script.config.yaml \
--skip-clusterctl-move
# --skip-kubeaid-config-setup
.PHONY: bootstrap-cluster-dev-hetzner
bootstrap-cluster-dev-hetzner:
@go run ./cmd cluster bootstrap hetzner \
--debug \
--config /app/outputs/kubeaid-bootstrap-script.config.yaml \
--skip-clusterctl-move
# --skip-kubeaid-config-setup
.PHONY: use-management-cluster
use-management-cluster:
export KUBECONFIG=./outputs/management-cluster.kubeconfig.yaml
.PHONY: use-provisioned-cluster
use-provisioned-cluster:
export KUBECONFIG=./outputs/provisioned-cluster.kubeconfig.yaml
.PHONY: delete-provisioned-cluster
delete-provisioned-cluster-dev:
@go run ./cmd cluster delete \
--config /app/outputs/kubeaid-bootstrap-script.config.yaml
.PHONY: delete-management-cluster
delete-management-cluster:
KUBECONFIG=./outputs/management-cluster.kubeconfig.yaml \
k3d cluster delete management-cluster