forked from Agarnier22/crossplane-demo0923
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (55 loc) · 2.18 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
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show help for all targets
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
startaws: ## Claims networks and clusters on AWS
@echo "Claim of AWS resources..."
@for i in $$(find demo/AWS/Demo/* -name "*.yaml" -type f | grep -vE "config|provider"); do kubectl apply -f $$i;done
@echo "Ressources successfully claimed!"
@echo ""
.PHONY:startaws
startazure: ## Claims networks and clusters on AZURE
@echo "Claim of Azure resources..."
@for i in $$(find demo/Azure/Demo/* -name "*.yaml" -type f | grep -vE "config|provider"); do kubectl apply -f $$i;done
@echo "Ressources successfully claimed!"
@echo ""
.PHONY:startazure
startgcp: ## Claims networks and clusters on GCP
@echo "Claim of GCP resources..."
@for i in $$(find demo/GCP/Demo/* -name "*.yaml" -type f | grep -vE "config|provider"); do kubectl apply -f $$i;done
@echo "Ressources successfully claimed!"
@echo ""
.PHONY:startgcp
startdemo: start startaws startazure startgcp end ## Claims networks and clusters on AWS, GCP and Azure
.PHONY:startdemo
start:
@echo "Starting Demo..."
@echo ""
.PHONY:start
end:
@echo "Demo successfully started!"
.PHONY:end
awsnuke: ##Claim deletion of AWS resources
@echo "Deletion of AWS resources..."
@kubectl get managed -l provider=AWS | awk '$$0 !~/NAME/ {print $$1}' | xargs kubectl delete
@echo "Ressources successfully deleted!"
@echo ""
.PHONY:awsnuke
azurenuke: ##Claim deletion of Azure resources
@echo "Deletion of Azure resources..."
@kubectl get managed -l provider=Azure | awk '$$0 !~/NAME/ {print $$1}' | xargs kubectl delete
@echo "Ressources successfully deleted!"
@echo ""
.PHONY:azurenuke
gcpnuke: ##Claim deletion of GCP resources
@echo "Deletion of GCP resources..."
@kubectl get managed -l provider=GCP | awk '$$0 !~/NAME/ {print $$1}' | xargs kubectl delete
@echo "Ressources successfully deleted!"
@echo ""
.PHONY:gcpnuke
managednuke: ## Delete all crossplane managed resources on cluster
@echo "Claim deletion..."
@kubectl get managed | awk '$$0 !~/NAME/ {print $$1}' | xargs kubectl delete
@echo "Resources successfully deleted!"
.PHONY:managednuke