From b9ca1bb149073fa89451f896e5490afe7c2607b1 Mon Sep 17 00:00:00 2001 From: Andrew Kostka Date: Thu, 25 Jul 2024 08:22:43 +0000 Subject: [PATCH] chore(make): use kubectl port-forward for local cluster traffic --- Makefile | 4 ++-- bin/minikube-tunnel | 13 ------------- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100755 bin/minikube-tunnel diff --git a/Makefile b/Makefile index 1fa3b7edf..9d298ac57 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ minikube-dashboard: minikube --profile minikube-wbaas dashboard .PHONY: minikube-tunnel -minikube-tunnel: # @HELP Open a tunnel to the local cluster and expose it on an IP on the host system +minikube-tunnel: # @HELP Open a tunnel to the local ingress via kubectl and expose it at port 80 on the host system minikube-tunnel: - ./bin/minikube-tunnel + sudo -E kubectl --context minikube-wbaas port-forward -n kube-system service/ingress-nginx-controller 80:80 .PHONY: helmfile-fetch helmfile-fetch: # @HELP Fetch all charts defined in the Helmfile. This works across all environments diff --git a/bin/minikube-tunnel b/bin/minikube-tunnel deleted file mode 100755 index 13176119d..000000000 --- a/bin/minikube-tunnel +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -EXTERNAL_IP=$(minikube --profile minikube-wbaas kubectl -- -n kube-system get service ingress-nginx-controller -o template='{{.spec.clusterIP}}') - -trap 'kill -15 $kids; exit 143' EXIT HUP INT TERM - -sudo socat tcp-listen:80,reuseaddr,fork tcp:"$EXTERNAL_IP":80 & -kids=$! - -minikube --profile minikube-wbaas tunnel & -kids="$kids $!" - -wait \ No newline at end of file