-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
95 lines (75 loc) · 3.63 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
KB = kustomize build
MK = argocd
LOCAL_DOMAIN = test
ARGOCD_DEP_NAME = example-argocd
OLM_VERSION = v0.20.0
.PHONY: default omnibus mk-init mk-rm mk-stop mk-addons-list mk-ip mk-argocd-login-password mk-argocd-login mk-argocd-open install install-argocd-cli install-olm install-argocd-operator install-argocd-instance install-argocd-apps delete help
default: help
omnibus: mk-init install ## Omnibus installer
mk-init: ## Initialize olm, argocd operatorm, argocd, etc. deployed to minikube
@echo "#### Initializing minikube, enabling addons, and configuring dns ( this can take some time ) ..."
@vendir sync
@minikube start -p $(MK) --cpus=4 --disk-size=40gb --memory=8gb
@sleep 5
@minikube addons -p $(MK) enable ingress
@sleep 5
@minikube addons -p $(MK) enable ingress-dns
@sleep 5
@echo "#### Adding ingress-dns add on entry to dns resolvers. Allows you to resolve 'http://*.test'"
@echo "domain $(LOCAL_DOMAIN)\nnameserver `minikube ip -p $(MK)`\nsearch_order 1\ntimeout 5" | sudo tee /etc/resolver/minikube-$(MK)-test
@minikube addons list -p $(MK)
mk-rm: ## Delete the argocd minikube
@minikube delete -p $(MK)
mk-start: ## Start minikube
@minikube start -p $(MK)
mk-stop: ## Stop minikube
@minikube stop -p $(MK)
mk-addons-list: ## Dispaly minikube addons
@minikube addons list -p $(MK)
mk-ip: ## Dispaly minikube ip
@minikube ip -p $(MK)
mk-argocd-login-password: ## Dispaly the argocd login password deployed to minikube
@echo "admin"
@kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
mk-argocd-login: ## Login to argocd deployed to minikube
@argocd login argocd-grpc.test \
--insecure \
--username admin \
--password $(kubectl get pods -n argocd -l app.kubernetes.io/name=$(ARGOCD_DEP_NAME)-server -o name | cut -d'/' -f 2)
mk-argocd-open: mk-argocd-login-password ## Open ArgoCD UI deployed to minikube
open http://argocd.test/login
install: install-olm install-argocd-operator install-argocd-instance install-argocd-apps ## Install all resources olm, argocd operator, argo, etc.
install-argocd-cli: ## Install the argocd cli
@echo "#### Installing argocd-cli via homebrew"
@brew tap argoproj/tap
@brew install argoproj/tap/argocd
install-olm: ## Install operator lifecycle manager
@echo "#### Installing operator lifecycle manager (olm) ..."
@./olm-install.sh $(OLM_VERSION)
# @kubectl create -f ./install/olm-crds
# @sleep 2
# @kubectl apply -f ./install/olm-catalog
install-argocd-operator: ## Install the argocd operator
@echo "#### Installing argocd operator"
@echo "#### Checking olm is installed and ready"
@kubectl rollout status -w -n olm deployment/olm-operator
@kubectl rollout status -w -n olm deployment/catalog-operator
@$(KB) ./install/argocd-operator| kubectl apply -f -
# @kubectl wait --for=condition=ready --timeout=60s -n olm -l olm.catalogSource=argocd-catalog pod
@sleep 15
install-argocd-instance: ## Install the argocd instances
@echo "#### Installing argocd instance via argocd operator"
@$(KB) ./install/argocd | kubectl apply -f -
@sleep 5
install-argocd-apps: ## Install the argocd instances
@echo "#### Installing ArgoCD Apps"
@$(KB) ./argocd-conf/overlays | kubectl apply -f -
delete: ## Delete all k8s resources for argocd, the operator, and olm
@echo "#### To delete all argocd run the following"
$(KB) ./install/argocd | kubectl delete -f -
$(KB) ./install/argocd-operator | kubectl delete -f -
kubectl delete -f ./install/olm
flush-dns-cache:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'