-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
74 lines (64 loc) · 1.96 KB
/
Copy pathmakefile
File metadata and controls
74 lines (64 loc) · 1.96 KB
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
IMAGE_NAME=kubev
IMAGE_TAG=0.0.0
CONTAINER_NAME=kubermatic-virtualization-workshop
.PHONY: clear
clear:
docker rmi $(IMAGE_NAME):$(IMAGE_TAG)
.PHONY: lint
lint:
hadolint ./container-image/dockerfile
.PHONY: build
build:
docker build -t $(IMAGE_NAME):$(IMAGE_TAG) ./container-image/
.PHONY: run
run: build
docker run -it -d \
--name $(CONTAINER_NAME) \
--restart=always \
-p 8080:8080 \
--hostname jumphost \
-v /root/training-kubev:/training \
$(IMAGE_NAME):$(IMAGE_TAG)
.PHONY: verify
verify:
test -f /root/.trainingrc
grep "source /root/.trainingrc" /root/.zshrc
kubectl version --client
gcloud version
kubectx
helm version
test -n "$(GCP_PROJECT)"
test -n "$(TRAINEE_NAME)"
test -n "$(TRAINEE_EMAIL)"
test -n "$(JH_EXT_IP)"
test -n "$(JH_INT_IP)"
test -n "$(CP_EXT_IP)"
test -n "$(CP_INT_IP)"
test -n "$(W_EXT_IP)"
test -n "$(W_INT_IP)"
# TODO kubens => failing due no cluster yet
test -n "$(K8S_VERSION)"
test -e /training/.secrets/environment.sh
test -e /training/.secrets/gcp-kubev
test -e /training/.secrets/gcp-kubev-config
test -e /training/.secrets/gcp-kubev.pub
test -e /training/.secrets/gcp-service-account.json
test -e /training/.secrets/README.md
# TODO ensure that is the right ssh key - ssh-add -l | grep "$(ssh-keygen -lf .secrets/gce)"
# TODO test -v $(GOOGLE_CREDENTIALS)
# TODO verify gcp sa permissions
echo "Training Environment successfully verified"
# .PHONY: push
# push: lint
# docker push --platform linux/amd64 --tag ${IMAGE_NAME}:${IMAGE_TAG} --push .
# TODO compose? healthchecks?
# .PHONY: ssh-controlplane-node
# ssh-controlplane-node:
# ssh -F /training/.secrets/ssh-config controlplane-node
# .PHONY: ssh-worker-node
# ssh-worker-node:
# ssh -F /training/.secrets/ssh-config worker-node
# .PHONY: restart
# restart:
# ssh -F /training/.secrets/ssh-config controlplane-node 'bash -s' < /training/99_teardown/teardown.sh
# ssh -F /training/.secrets/ssh-config worker-node 'bash -s' < /training/99_teardown/teardown.sh