mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-20 17:48:20 +00:00
Merge branch 'develop' into fix/spawn-only-two-goroutines
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -53,3 +53,6 @@ tap/extensions/*/expect
|
|||||||
**/node_modules/**
|
**/node_modules/**
|
||||||
**/dist/**
|
**/dist/**
|
||||||
*.editorconfig
|
*.editorconfig
|
||||||
|
|
||||||
|
# Ignore *.log files
|
||||||
|
*.log
|
@@ -1,7 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
PREFIX=$HOME/local/bin
|
PREFIX=$HOME/local/bin
|
||||||
VERSION=v1.22.0
|
VERSION=v1.22.0
|
||||||
|
TUNNEL_LOG="tunnel.log"
|
||||||
|
PROXY_LOG="proxy.log"
|
||||||
|
|
||||||
echo "Attempting to install minikube and assorted tools to $PREFIX"
|
echo "Attempting to install minikube and assorted tools to $PREFIX"
|
||||||
|
|
||||||
@@ -11,7 +14,7 @@ if ! [ -x "$(command -v kubectl)" ]; then
|
|||||||
chmod +x kubectl
|
chmod +x kubectl
|
||||||
mv kubectl "$PREFIX"
|
mv kubectl "$PREFIX"
|
||||||
else
|
else
|
||||||
echo "kubetcl is already installed"
|
echo "kubectl is already installed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -x "$(command -v minikube)" ]; then
|
if ! [ -x "$(command -v minikube)" ]; then
|
||||||
@@ -27,35 +30,39 @@ echo "Starting minikube..."
|
|||||||
minikube start
|
minikube start
|
||||||
|
|
||||||
echo "Creating mizu tests namespaces"
|
echo "Creating mizu tests namespaces"
|
||||||
kubectl create namespace mizu-tests
|
kubectl create namespace mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
kubectl create namespace mizu-tests2
|
kubectl create namespace mizu-tests2 --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "Creating httpbin deployments"
|
echo "Creating httpbin deployments"
|
||||||
kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests
|
kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
kubectl create deployment httpbin2 --image=kennethreitz/httpbin -n mizu-tests
|
kubectl create deployment httpbin2 --image=kennethreitz/httpbin -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests2
|
kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests2 --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "Creating redis deployment"
|
echo "Creating redis deployment"
|
||||||
kubectl create deployment redis --image=redis -n mizu-tests
|
kubectl create deployment redis --image=redis -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "Creating rabbitmq deployment"
|
echo "Creating rabbitmq deployment"
|
||||||
kubectl create deployment rabbitmq --image=rabbitmq -n mizu-tests
|
kubectl create deployment rabbitmq --image=rabbitmq -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "Creating httpbin services"
|
echo "Creating httpbin services"
|
||||||
kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests
|
kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
kubectl expose deployment httpbin2 --type=NodePort --port=80 -n mizu-tests
|
kubectl expose deployment httpbin2 --type=NodePort --port=80 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests2
|
kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests2 --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "Creating redis service"
|
echo "Creating redis service"
|
||||||
kubectl expose deployment redis --type=LoadBalancer --port=6379 -n mizu-tests
|
kubectl expose deployment redis --type=LoadBalancer --port=6379 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "Creating rabbitmq service"
|
echo "Creating rabbitmq service"
|
||||||
kubectl expose deployment rabbitmq --type=LoadBalancer --port=5672 -n mizu-tests
|
kubectl expose deployment rabbitmq --type=LoadBalancer --port=5672 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
|
# TODO: need to understand how to fail if address already in use
|
||||||
echo "Starting proxy"
|
echo "Starting proxy"
|
||||||
kubectl proxy --port=8080 &
|
rm -f ${PROXY_LOG}
|
||||||
|
kubectl proxy --port=8080 > ${PROXY_LOG} &
|
||||||
|
PID1=$!
|
||||||
|
echo "kubectl proxy process id is ${PID1} and log of proxy in ${PROXY_LOG}"
|
||||||
|
|
||||||
if [[ -z "${CI}" ]]; then
|
if [[ -z "${CI}" ]]; then
|
||||||
echo "Setting env var of mizu ci image"
|
echo "Setting env var of mizu ci image"
|
||||||
@@ -71,5 +78,9 @@ minikube image load "${MIZU_CI_IMAGE}"
|
|||||||
echo "Build cli"
|
echo "Build cli"
|
||||||
cd cli && make build GIT_BRANCH=ci SUFFIX=ci
|
cd cli && make build GIT_BRANCH=ci SUFFIX=ci
|
||||||
|
|
||||||
|
# TODO: need to understand how to fail if password is asked (sudo)
|
||||||
echo "Starting tunnel"
|
echo "Starting tunnel"
|
||||||
minikube tunnel &
|
rm -f ${TUNNEL_LOG}
|
||||||
|
minikube tunnel > ${TUNNEL_LOG} &
|
||||||
|
PID2=$!
|
||||||
|
echo "Minikube tunnel process id is ${PID2} and log of tunnel in ${TUNNEL_LOG}"
|
||||||
|
@@ -274,25 +274,21 @@ export const EntryItem: React.FC<EntryProps> = ({entry, style, headingMode, name
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={outgoingIcon}
|
src={outgoingIcon}
|
||||||
alt="Ingoing traffic"
|
alt="Outgoing traffic"
|
||||||
title="Ingoing"
|
title="Outgoing"
|
||||||
/>
|
/>
|
||||||
</Queryable>
|
</Queryable>
|
||||||
:
|
:
|
||||||
<Queryable
|
<Queryable
|
||||||
query={`outgoing == true`}
|
query={`outgoing == false`}
|
||||||
displayIconOnMouseOver={true}
|
displayIconOnMouseOver={true}
|
||||||
flipped={true}
|
flipped={true}
|
||||||
iconStyle={{marginTop: "28px"}}
|
iconStyle={{marginTop: "28px"}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={ingoingIcon}
|
src={ingoingIcon}
|
||||||
alt="Outgoing traffic"
|
alt="Ingoing traffic"
|
||||||
title="Outgoing"
|
title="Ingoing"
|
||||||
onClick={() => {
|
|
||||||
const query = `outgoing == false`;
|
|
||||||
setQuery(queryState ? `${queryState} and ${query}` : query);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Queryable>
|
</Queryable>
|
||||||
}
|
}
|
||||||
|
@@ -240,7 +240,7 @@ export const TrafficViewer: React.FC<TrafficViewerProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={TrafficViewerStyles.TrafficPage}>
|
<div className={TrafficViewerStyles.TrafficPage}>
|
||||||
{tappingStatus && isShowStatusBar && <StatusBar isDemoBannerView={isDemoBannerView}/>}
|
{tappingStatus && isShowStatusBar && <StatusBar disabled={ws?.current?.readyState !== WebSocket.OPEN} isDemoBannerView={isDemoBannerView}/>}
|
||||||
<div className={TrafficViewerStyles.TrafficPageHeader}>
|
<div className={TrafficViewerStyles.TrafficPageHeader}>
|
||||||
<div className={TrafficViewerStyles.TrafficPageStreamStatus}>
|
<div className={TrafficViewerStyles.TrafficPageStreamStatus}>
|
||||||
<img className={TrafficViewerStyles.playPauseIcon}
|
<img className={TrafficViewerStyles.playPauseIcon}
|
||||||
|
@@ -5,6 +5,7 @@ import failIcon from 'assets/failed.svg';
|
|||||||
import successIcon from 'assets/success.svg';
|
import successIcon from 'assets/success.svg';
|
||||||
import {useRecoilValue} from "recoil";
|
import {useRecoilValue} from "recoil";
|
||||||
import tappingStatusAtom, {tappingStatusDetails} from "../../recoil/tappingStatus";
|
import tappingStatusAtom, {tappingStatusDetails} from "../../recoil/tappingStatus";
|
||||||
|
import Tooltip from "./Tooltip";
|
||||||
|
|
||||||
const pluralize = (noun: string, amount: number) => {
|
const pluralize = (noun: string, amount: number) => {
|
||||||
return `${noun}${amount !== 1 ? 's' : ''}`
|
return `${noun}${amount !== 1 ? 's' : ''}`
|
||||||
@@ -12,20 +13,22 @@ const pluralize = (noun: string, amount: number) => {
|
|||||||
|
|
||||||
interface StatusBarProps {
|
interface StatusBarProps {
|
||||||
isDemoBannerView: boolean;
|
isDemoBannerView: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const StatusBar: React.FC<StatusBarProps> = ({isDemoBannerView}) => {
|
export const StatusBar: React.FC<StatusBarProps> = ({isDemoBannerView, disabled}) => {
|
||||||
const tappingStatus = useRecoilValue(tappingStatusAtom);
|
const tappingStatus = useRecoilValue(tappingStatusAtom);
|
||||||
const [expandedBar, setExpandedBar] = useState(false);
|
const [expandedBar, setExpandedBar] = useState(false);
|
||||||
const {uniqueNamespaces, amountOfPods, amountOfTappedPods, amountOfUntappedPods} = useRecoilValue(tappingStatusDetails);
|
const {uniqueNamespaces, amountOfPods, amountOfTappedPods, amountOfUntappedPods} = useRecoilValue(tappingStatusDetails);
|
||||||
return <div className={`${isDemoBannerView ? `${style.banner}` : ''} ${style.statusBar} ${(expandedBar ? `${style.expandedStatusBar}` : "")}`} onMouseOver={() => setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar">
|
return <div style={{opacity: disabled ? 0.4 : 1}} className={`${isDemoBannerView ? `${style.banner}` : ''} ${style.statusBar} ${(expandedBar && !disabled ? `${style.expandedStatusBar}` : "")}`} onMouseOver={() => setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar">
|
||||||
<div className={style.podsCount}>
|
<div className={style.podsCount}>
|
||||||
{tappingStatus.some(pod => !pod.isTapped) && <img src={warningIcon} alt="warning"/>}
|
{tappingStatus.some(pod => !pod.isTapped) && <img src={warningIcon} alt="warning"/>}
|
||||||
|
{disabled && <Tooltip title={"Tapping status is not updated when streaming is paused"} isSimple><img src={warningIcon} alt="warning"/></Tooltip>}
|
||||||
<span className={style.podsCountText} data-cy="podsCountText">
|
<span className={style.podsCountText} data-cy="podsCountText">
|
||||||
{`Tapping ${amountOfUntappedPods > 0 ? amountOfTappedPods + " / " + amountOfPods : amountOfPods} ${pluralize('pod', amountOfPods)} in ${pluralize('namespace', uniqueNamespaces.length)} ${uniqueNamespaces.join(", ")}`}
|
{`Tapping ${amountOfUntappedPods > 0 ? amountOfTappedPods + " / " + amountOfPods : amountOfPods} ${pluralize('pod', amountOfPods)} in ${pluralize('namespace', uniqueNamespaces.length)} ${uniqueNamespaces.join(", ")}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{expandedBar && <div style={{marginTop: 20}}>
|
{expandedBar && !disabled && <div style={{marginTop: 20}}>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
Reference in New Issue
Block a user