forked from BlaineEXE/dev-rook-ceph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (82 loc) · 3.46 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
include makelib.mk
# Make sure git doesn't track others' changes to developer-settings
$(shell git update-index --assume-unchanged developer-settings)
# The theory behind makefile targets is that targets (or target groups) should not share the same
# 3 letters so tab complete is useful for the user. Ideally, the first 2 letters.
.DEFAULT_GOAL := help
##
## CONFIGURATION
## There are many tunable parameters for changing how the dev cluster/environment is set up.
## Configuration is not requred, as sensible default values are already applied. If desired, the user
## should set their configuration overrides in the ${FIL}developer-settings${NON} file.
##
## QUICKSTART
## quickstart Perform all steps to set up a Kubernetes cluster ready for Rook development
## with params defined in ${FIL}developer-settings${NON}
quickstart:
@ $(MAKE) cluster.build cluster.setup k8s.install
##
## CLUSTER TARGETS
## cluster.build Stand up a cluster for development with params defined in ${FIL}developer-settings${NON}
cluster.build:
@ $(SUDO) $(PYTHON) scripts/libvirt/apply.py
@ $(SUDO) $(PYTHON) scripts/libvirt/generate-node-list.py
## cluster.destroy Destroy a previously-built development cluster
cluster.destroy:
@ NUM_MASTERS=0 NUM_WORKERS=0 $(SUDO) $(PYTHON) scripts/libvirt/apply.py
@ rm -f _node-list
@ rm -f $(KUBECONFIG)
@ $(MAKE) rook.destroy-hook.%
## cluster.setup Set up the cluster's basic user tooling
cluster.setup: $(OCTOPUS_TOOL)
@ $(BASH_CMD) -c "chmod 600 scripts/resources/.ssh/id_rsa"
@ $(BASH_CMD) scripts/cluster/config-octopus.sh
@ $(BASH_CMD) scripts/cluster/wait-for-up.sh
@ $(BASH_CMD) scripts/cluster/copy-octopus-to-cluster.sh
@ $(BASH_CMD) scripts/cluster/install-dependencies.sh
@ $(BASH_CMD) scripts/cluster/set-iptables-permissive.sh
@ $(BASH_CMD) scripts/cluster/exercise-ssh.sh
@ $(BASH_CMD) scripts/cluster/setup-bashrc.sh
@ $(BASH_CMD) scripts/cluster/verify.sh
##
## KUBERNETES TARGETS
## k8s.install Install Kubernetes on the cluster with params defined in ${FIL}developer-settings${NON}
k8s.install: $(OCTOPUS_TOOL)
@ $(BASH_CMD) scripts/kubernetes/install-kubeadm.sh
@ $(BASH_CMD) scripts/kubernetes/install-k8s.sh
@ $(BASH_CMD) scripts/kubernetes/download-kubeconfig.sh
@ $(BASH_CMD) scripts/kubernetes/wait-for-up.sh
@ $(BASH_CMD) scripts/kubernetes/untaint-master.sh
@ $(BASH_CMD) scripts/kubernetes/verify.sh
## k8s.dash-install Install kubernetes-dashboard with params defined in ${FIL}developer-settings${NON}
k8s.dash-install:
@ $(BASH_CMD) scripts/kubernetes/install-dashboard.sh
## k8s.fwd-dash Port forward the kubernetes-dashboard service to localhost:20443.
k8s.fwd-dash:
@ $(BASH_CMD) scripts/kubernetes/dashboard-port-forward.sh
##
## ROOK TARGETS
## rook.help Show all Rook targets
export ROOK_SYSTEM_NAMESPACE ?= rook-ceph
export ROOK_NAMESPACE ?= rook-ceph
include scripts/rook/Makefile
##
## CEPH TARGETS
## ceph.help Show all Ceph targets
include scripts/ceph/Makefile
##
## UPGRADE TARGETS
## upgrade.help Show all upgrade targets
include scripts/upgrade/Makefile
##
## ADVANCED
## Set ${ENV}DEBUG=1${NON} when using ${CMD}make${NON} to run dev env scripts with additional debug output.
# call.script.% SCRIPT=<script-path> - to call a single script with make's env vars set up
call.script.%:
@ $(BASH_CMD) $(SCRIPT)
#
# Help
#
.PHONY: help
# Use sed on this makefile to render all lines beginning with '##'
help: Makefile.help