Updated Expose Mizu Daemon Service (markdown)

Nimrod Gilboa Markevich
2021-11-11 15:42:38 +02:00
parent f652995372
commit 1a4f32bf33

@@ -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.
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:
```sh
mizu view
```
## Option 2: Port-Forward
### Option 2: Port-Forward
```sh
kubectl port-forward -n mizu deployment/mizu-api-server 8899:8899
@@ -32,3 +34,22 @@ kubectl expose -n mizu deployment mizu-api-server --name mizu-load-balancer --ty
```
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
```