mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-16 23:03:51 +00:00
Updated Expose Mizu Daemon Service (markdown)
@@ -1,15 +1,17 @@
|
|||||||
Mizu is created in Daemon (long-living) mode by using the `tap` command with the `--daemon` flag. After Mizu is successfully deployed, Mizu GUI is accessible on port 8899 of `mizu-api-server` pod. In order to access Mizu from outside the Kubernetes cluster (e.g., from your local machine), the deployment needs to be exposed. This could be done in any of the standard ways that Kubernetes offers.
|
Mizu is created in Daemon (long-living) mode by using the `tap` command with the `--daemon` flag. After Mizu is successfully deployed, Mizu GUI is accessible on port 8899 of `mizu-api-server` pod. In order to access Mizu from outside the Kubernetes cluster (e.g., from your local machine), the deployment needs to be exposed. This could be done in any of the standard ways that Kubernetes offers.
|
||||||
|
|
||||||
The following examples assume that Mizu is run in `mizu` namespace. If you are running Mizu in a namespace other than `mizu` (by changing `mizu-resources-namespace` setting), replace `-n mizu` with `-n <MIZU_NAMESPACE>`.
|
## How-To
|
||||||
|
|
||||||
## Option 1: Proxy
|
The following code excerpt assume that Mizu is run in `mizu` namespace. If you are running Mizu in a namespace other than `mizu` (by changing `mizu-resources-namespace` setting), replace `-n mizu` with `-n <MIZU_NAMESPACE>`.
|
||||||
|
|
||||||
|
### Option 1: Proxy
|
||||||
In a machine that can access both the cluster and the browser, the `view` command is used to create a proxy from localhost to `mizu-api-server`. Start the proxy by running:
|
In a machine that can access both the cluster and the browser, the `view` command is used to create a proxy from localhost to `mizu-api-server`. Start the proxy by running:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mizu view
|
mizu view
|
||||||
```
|
```
|
||||||
|
|
||||||
## Option 2: Port-Forward
|
### Option 2: Port-Forward
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
kubectl port-forward -n mizu deployment/mizu-api-server 8899:8899
|
kubectl port-forward -n mizu deployment/mizu-api-server 8899:8899
|
||||||
@@ -31,4 +33,23 @@ Mizu's IP is the IP of any node (`get the IP with kubectl get nodes -o wide`) an
|
|||||||
kubectl expose -n mizu deployment mizu-api-server --name mizu-load-balancer --type LoadBalancer --port 80 --target-port 8899
|
kubectl expose -n mizu deployment mizu-api-server --name mizu-load-balancer --type LoadBalancer --port 80 --target-port 8899
|
||||||
```
|
```
|
||||||
|
|
||||||
Access Mizu on the load balancer service's external ip (`kubectl get services -n mizu mizu-load-balancer`). Note that this method will expose Mizu to public access if your nodes are public. LoadBalancer services only work on supported clusters (usually cloud providers) and might incur extra costs.
|
Access Mizu on the load balancer service's external ip (`kubectl get services -n mizu mizu-load-balancer`). Note that this method will expose Mizu to public access if your nodes are public. LoadBalancer services only work on supported clusters (usually cloud providers) and might incur extra costs.
|
||||||
|
|
||||||
|
## Example: LoadBalancer
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ mizu tap "^ca.*" --daemon
|
||||||
|
Mizu will store up to 200MB of traffic, old traffic will be cleared once the limit is reached.
|
||||||
|
Tapping pods in namespaces "sock-shop"
|
||||||
|
Waiting for mizu to be ready... (may take a few minutes)
|
||||||
|
..
|
||||||
|
|
||||||
|
$ kubectl expose deployment -n mizu --port 80 --target-port 8899 mizu-api-server --type=LoadBalancer --name=mizu-lb
|
||||||
|
service/mizu-lb exposed
|
||||||
|
..
|
||||||
|
|
||||||
|
$ kubectl get services -n mizu
|
||||||
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||||
|
mizu-api-server ClusterIP 10.107.200.100 <none> 80/TCP 5m5s
|
||||||
|
mizu-lb LoadBalancer 10.107.200.101 34.77.120.116 80:30141/TCP 76s
|
||||||
|
```
|
Reference in New Issue
Block a user