-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (59 loc) · 2.33 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
#!/usr/bin/env make
.PHONY: setup sync apps proxy contexts current-context dashboard-proxy local minikube minikube-ingress minikube-ip certificate-issuers
default: sync
# Apply .env if it exists
ifneq (,$(wildcard ./.env))
include .env
export
endif
# ---------------------------------------------------------------------------------------------------------------------
# SETUP
# ---------------------------------------------------------------------------------------------------------------------
# run on first setup
setup:
helmfile sync
make create-dashboard-role
make apps
sync:
helmfile apply
make create-dashboard-role
make apps
create-dashboard-role:
kubectl delete --ignore-not-found=true clusterrolebinding kubernetes-dashboard
kubectl create clusterrolebinding kubernetes-dashboard \
--clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:kubernetes-dashboard
apps:
kubectl apply -n argocd -f ./applications/
# ---------------------------------------------------------------------------------------------------------------------
# MINIKUBE
# ---------------------------------------------------------------------------------------------------------------------
# Setup local cluster
local: minikube setup
minikube:
minikube start --addons=ingress
make minikube-ingress
# Allow access without proxy
minikube-ingress:
minikube addons enable ingress
# get the external IP of cluster
minikube-ip:
minikube ip
# ---------------------------------------------------------------------------------------------------------------------
# CERTIFICATE MANAGER
# ---------------------------------------------------------------------------------------------------------------------
certificate-issuers: certificate-issuer-staging certificate-issuer-prod
certificate-issuer-staging:
envsubst < ./certificate/staging-issuer.yaml | kubectl apply -f -
certificate-issuer-prod:
envsubst < ./certificate/production-issuer.yaml | kubectl apply -f -
# ---------------------------------------------------------------------------------------------------------------------
# USAGE
# ---------------------------------------------------------------------------------------------------------------------
proxy:
kubectl proxy
contexts:
kubectl config get-contexts
current-context:
kubectl config current-context
secrets:
kubectl get secrets