mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-20 17:48:20 +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("/tapStatus", controllers.GetTappingStatus) // get tapping status
|
||||||
routeGroup.Get("/analyzeStatus", controllers.AnalyzeInformation)
|
routeGroup.Get("/analyzeStatus", controllers.AnalyzeInformation)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"regexp"
|
"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 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 watchPodsForTapping(ctx, kubernetesProvider, cancel, podRegexQuery, tappingOptions)
|
||||||
go syncApiStatus(ctx, cancel, tappingOptions)
|
go syncApiStatus(ctx, cancel, tappingOptions)
|
||||||
//go spamHealthcheck(ctx, tappingOptions)
|
|
||||||
|
|
||||||
//block until exit signal or error
|
//block until exit signal or error
|
||||||
waitForFinish(ctx, cancel)
|
waitForFinish(ctx, cancel)
|
||||||
@@ -248,8 +248,18 @@ func portForwardApiPod(ctx context.Context, kubernetesProvider *kubernetes.Provi
|
|||||||
cancel()
|
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
|
isPodReady = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,6 @@ func StartProxy(kubernetesProvider *Provider, mizuPort uint16, mizuNamespace str
|
|||||||
//work around to make static resources available to the dashboard (all .svgs will not load without this)
|
//work around to make static resources available to the dashboard (all .svgs will not load without this)
|
||||||
mux.Handle("/static/", getRerouteHttpHandler(proxyHandler, mizuProxiedUrl))
|
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)))
|
l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", "127.0.0.1", int(mizuPort)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user