mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-20 09:39:14 +00:00
Update public_routes.go, tapRunner.go, and proxy.go
This commit is contained in:
@@ -21,5 +21,4 @@ func EntriesRoutes(fiberApp *fiber.App) {
|
||||
|
||||
routeGroup.Get("/tapStatus", controllers.GetTappingStatus) // get tapping status
|
||||
routeGroup.Get("/analyzeStatus", controllers.AnalyzeInformation)
|
||||
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"regexp"
|
||||
@@ -74,7 +75,6 @@ func RunMizuTap(podRegexQuery *regexp.Regexp, tappingOptions *MizuTapOptions) {
|
||||
go portForwardApiPod(ctx, kubernetesProvider, cancel, tappingOptions) // TODO convert this to job for built in pod ttl or have the running app handle this
|
||||
go watchPodsForTapping(ctx, kubernetesProvider, cancel, podRegexQuery, tappingOptions)
|
||||
go syncApiStatus(ctx, cancel, tappingOptions)
|
||||
//go spamHealthcheck(ctx, tappingOptions)
|
||||
|
||||
//block until exit signal or error
|
||||
waitForFinish(ctx, cancel)
|
||||
@@ -248,8 +248,18 @@ func portForwardApiPod(ctx context.Context, kubernetesProvider *kubernetes.Provi
|
||||
cancel()
|
||||
}
|
||||
}()
|
||||
fmt.Printf("Mizu is available at http://%s\n", kubernetes.GetMizuCollectorProxiesHostAndPath(tappingOptions.GuiPort, mizu.ResourcesNamespace, mizu.AggregatorPodName))
|
||||
mizuProxiedUrl := kubernetes.GetMizuCollectorProxiesHostAndPath(tappingOptions.GuiPort, mizu.ResourcesNamespace, mizu.AggregatorPodName)
|
||||
fmt.Printf("Mizu is available at http://%s\n", mizuProxiedUrl)
|
||||
|
||||
time.Sleep(time.Second * 5) // Waiting to be sure the proxy is ready
|
||||
if tappingOptions.Analyze {
|
||||
if _, err := http.Get(fmt.Sprintf("http://%s/api/uploadEntries?dest=%s", mizuProxiedUrl, tappingOptions.AnalyzeDestination)); err != nil {
|
||||
fmt.Println(err)
|
||||
} else {
|
||||
fmt.Printf(mizu.Purple, "Traffic is uploading to UP9 cloud for further analsys")
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
isPodReady = true
|
||||
}
|
||||
|
||||
|
@@ -28,8 +28,7 @@ func StartProxy(kubernetesProvider *Provider, mizuPort uint16, mizuNamespace str
|
||||
mux.Handle(k8sProxyApiPrefix, proxyHandler)
|
||||
//work around to make static resources available to the dashboard (all .svgs will not load without this)
|
||||
mux.Handle("/static/", getRerouteHttpHandler(proxyHandler, mizuProxiedUrl))
|
||||
|
||||
//l, err := server.Listen("127.0.0.1", int(mizuPort))
|
||||
|
||||
l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", "127.0.0.1", int(mizuPort)))
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user