-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
43 lines (32 loc) · 1.71 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
# __ __
# __ ______ ____ ___ ____ _/ /____ ____ ____/ /
# / / / / __ \/ __ `__ \/ __ `/ __/ _ \/ __ \/ __ /
# / /_/ / /_/ / / / / / / /_/ / /_/ __/ /_/ / /_/ /
# \__, /\____/_/ /_/ /_/\__,_/\__/\___/\____/\__,_/
# /____ matthewdavis.io, holla!
#
include .make/Makefile.inc
NS ?= default
APP ?= ingress-controller-devops
USERNAME ?= user
PASSWORD ?= pass
LOADBALANCER_IP ?= 0
LOADBALANCER_NAME ?= mlfabric-dev-matthew-ingress-1
SERVICE_TYPE ?= LoadBalancer
export
issue: ingress-issue certificate-issue
revoke: ingress-delete certificate-delete
ingress-issue: guard-HOST guard-SERVICE_NAME guard-SERVICE_PORT; @envsubst < templates/ingress.yaml | kubectl -n $$NS apply -f -
ingress-delete: guard-HOST; @envsubst < templates/ingress.yaml | kubectl -n $$NS delete --ignore-not-found -f -
certificate-issue: guard-HOST; @envsubst < templates/certificate.yaml | kubectl -n $$NS apply -f -
certificate-delete: guard-HOST; @envsubst < templates/certificate.yaml | kubectl -n $$NS delete --ignore-not-found -f -
secret-create: ; @envsubst < templates/certificate.yaml | kubectl -n $$NS apply -f -
secret-delete: ; kubectl delete secret nginx-ingress-basic-auth | true
install: guard-LOADBALANCER_IP
htpasswd:
test ! -f /usr/bin/htpasswd || echo "htpasswd does not exist!"
# bcrypt is not supported within auth_basic, using md5
# docker run --rm appsoa/docker-alpine-htpasswd --entrypoint="htpasswd -b" $(USERNAME) $(PASSWORD) > auth
htpasswd -cb auth $(USERNAME) $(PASSWORD)
kubectl create secret generic nginx-ingress-basic-auth --from-file=auth
@rm -rf auth