-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
47 lines (34 loc) · 1.57 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
.PHONY: help
help: ## Prints help (only for targets with comments)
@grep -E '^[a-zA-Z0-9._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
up:
vagrant up --no-provision
.PHONY: validate
validate: ## Validate the configuration
./validate
use.virtualbox: ## Use virtualbox as provider
ln -fs cluster.vb.yaml cluster.yaml
use.digitalocean: ## Use digitalocean as provider
ln -fs cluster.do.yaml cluster.yaml
provision.basic: up ## Create necessary VMs and install necessary binaries
K8S_PLAYBOOK="basic" vagrant provision
provision.manual: up ## Create necessary VMs and provision the VMs and install necessary binaries for manual setup
K8S_PLAYBOOK="manual-setup" vagrant provision
provision.cluster: up ## Create necessary VMs and provision the VMs with K8s cluster
K8S_PLAYBOOK="kubernetes" vagrant provision
destroy.vm:
-vagrant destroy --force
destroy: destroy.vm ## Destroy all the Vms
rm -rf ${VAGRANT_DOTFILE_PATH}
rm -f ${HOME}/.kube/configs/${USER}-${CLUSTER_NAME_PREFIX}.conf
status: ## Prints the VMs status
$(info Status for "${CLUSTER_NAME_PREFIX}" cluster)
vagrant status
reset: ## Reset the kubernetes cluster
ansible-playbook -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory playbook/kubernetes-reset.yaml
switch.k8s: ## Switch to k8s cluster
sed -i'' -e 's/CLUSTER_NAME_PREFIX="systems"/CLUSTER_NAME_PREFIX="k8s"/g' .envrc
direnv allow
switch.systems: ## Switch to systems cluster
sed -i'' -e 's/CLUSTER_NAME_PREFIX="k8s"/CLUSTER_NAME_PREFIX="systems"/g' .envrc
direnv allow