-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (28 loc) · 1.06 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
CONTAINER := k8sage
DIND_VOLUME := k8sage
setup:
@docker build --progress=plain -f Containerfile -t $(CONTAINER) $(CURDIR)
@docker volume create $(DIND_VOLUME)
@test -s applications.yml || cp applications.yml.example applications.yml
destroy:
@$(MAKE) down
@docker volume rm $(DIND_VOLUME) || true
up: ARGOCD_PORT = 443
up: KUBERNETES_PORT = 6445
up:
@docker run --rm -d --name $(CONTAINER) \
--privileged \
--mount "type=bind,source=$(CURDIR)/applications.yml,target=/mnt/config/applications.yml" \
-v $(CURDIR)/applications:/mnt/applications \
-v $(DIND_VOLUME):/mnt/docker \
-p $(ARGOCD_PORT):443 \
-p $(KUBERNETES_PORT):6445 \
k8sage
@docker logs -fn0 $(CONTAINER)
@while [ $$(docker ps -q -f "name=$(CONTAINER)" -f "health=healthy" | wc -l) -eq 0 ]; do sleep 1; done
@docker cp $(CONTAINER):/etc/k8sage/cluster-config/kube/config.yaml $(CURDIR)/kubeconfig.yaml
down:
@docker stop -t=-1 $(CONTAINER) || true
@while [ $$(docker ps -q -f "name=$(CONTAINER)" -f "status=removing" | wc -l) -gt 0 ]; do sleep 1; done
shell:
@docker exec -it $(CONTAINER) bash