mirror of
https://gitlab.com/deepcypher/dc-kc.git
synced 2026-01-27 11:12:08 +00:00
35 lines
908 B
Makefile
35 lines
908 B
Makefile
TUNNEL_NAME=homelab
|
|
NAMESPACE=cloudflared
|
|
TUNNEL_ID=$(cloudflared tunnel list | grep "${TUNNEL_NAME}" | cut -d ' ' -f 1)
|
|
|
|
.PHONY: all
|
|
all: create
|
|
|
|
.PHONY: create
|
|
create:
|
|
cloudflared tunnel login
|
|
cloudflared tunnel create ${TUNNEL_NAME}
|
|
|
|
.PHONY: secret
|
|
secret:
|
|
cloudflared tunnel list | grep "${TUNNEL_NAME}" | cut -d ' ' -f 1
|
|
echo ${TUNNEL_ID}
|
|
kubectl create secret generic tunnel-credentials -n ${NAMESPACE} --from-file=credentials.json="/home/archer/.cloudflared/${TUNNEL_ID}.json" --dry-run -o yaml > ${TUNNEL_NAME}-secret.yaml
|
|
|
|
.PHONY: install
|
|
install:
|
|
kubectl create namespace ${NAMESPACE}
|
|
kubectl apply -f ${TUNNEL_NAME}-secret.yaml
|
|
helm install cloudflared . -n ${NAMESPACE}
|
|
|
|
.PHONY: upgrade
|
|
upgrade:
|
|
helm upgrade cloudflared . -n ${NAMESPACE}
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
cloudflared tunnel delete ${TUNNEL_NAME}
|
|
helm uninstall cloudflared -n ${NAMESPACE}
|
|
kubectl delete namespace ${NAMESPACE}
|
|
|