Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Adding breaking lines into README and better INGRESS_HOST handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Feb 6, 2019
1 parent 3220a90 commit a8497d4
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

Find below few commands showing basics of [Istio](https://istio.io/)...

Full asciinema demo can be found here: [https://asciinema.org/a/ijQFeXdhOvptOtCVWIthLyJvb](https://asciinema.org/a/ijQFeXdhOvptOtCVWIthLyJvb)

## Requirements

* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) (kubernetes-client package)
Expand Down Expand Up @@ -788,6 +790,8 @@ helm install --wait --name istio --namespace istio-system install/kubernetes/hel
--set tracing.enabled=true
```

-----

See the Istio components:

```bash
Expand Down Expand Up @@ -848,6 +852,8 @@ pod/prometheus-76b7745b64-kwzj5 1/1 Running 0 15m
pod/servicegraph-5c4485945b-j9bp2 1/1 Running 0 15m 10.244.2.16 pruzicka-k8s-istio-demo-node02 <none> <none>
```

-----

Configure Istio with a new log type and send those logs to the FluentD:

```bash
Expand Down Expand Up @@ -976,6 +982,8 @@ kubectl describe pod -l app=productpage
kubectl logs $(kubectl get pod -l app=productpage -o jsonpath="{.items[0].metadata.name}") istio-proxy --tail=5
```

-----

Define the [Istio gateway](https://istio.io/docs/reference/config/istio.networking.v1alpha3/#Gateway) for the application:

```bash
Expand Down Expand Up @@ -1006,7 +1014,9 @@ Determining the ingress IP and ports when using a node port:
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath="{.spec.ports[?(@.name==\"http2\")].nodePort}")
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath="{.spec.ports[?(@.name==\"https\")].nodePort}")
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o "jsonpath={.items[0].status.hostIP}")
# export INGRESS_HOST=$(terraform output -json -state=../../terraform.tfstate | jq -r ".vms_public_ip.value[0]")
if test -f terraform.tfstate && grep -q vms_public_ip terraform.tfstate; then
export INGRESS_HOST=$(terraform output -json -state=../../terraform.tfstate | jq -r ".vms_public_ip.value[0]")
fi
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
echo "$INGRESS_PORT | $SECURE_INGRESS_PORT | $INGRESS_HOST | $GATEWAY_URL"
```
Expand All @@ -1017,6 +1027,8 @@ Output:
31380 | 31390 | 172.16.242.170 | 172.16.242.170:31380
```

-----

Confirm the app is running:

```bash
Expand Down Expand Up @@ -1063,6 +1075,8 @@ Open the browser with these pages:

![Istio Graph](images/istio_kiali_graph.gif "Istio Graph")

-----

### Configuring Request Routing

[https://istio.io/docs/tasks/traffic-management/request-routing/](https://istio.io/docs/tasks/traffic-management/request-routing/)
Expand Down Expand Up @@ -1146,6 +1160,8 @@ spec:

![Bookinfo v1](images/bookinfo_v1.jpg "Bookinfo v1")

-----

### Route based on user identity

[https://istio.io/docs/tasks/traffic-management/request-routing/#route-based-on-user-identity](https://istio.io/docs/tasks/traffic-management/request-routing/#route-based-on-user-identity)
Expand Down Expand Up @@ -1213,6 +1229,8 @@ You can do the same with `user-agent header` or `URI` for example:
...
```

-----

### Injecting an HTTP delay fault

[https://istio.io/docs/tasks/traffic-management/fault-injection/#injecting-an-http-delay-fault](https://istio.io/docs/tasks/traffic-management/fault-injection/#injecting-an-http-delay-fault)
Expand Down Expand Up @@ -1291,6 +1309,8 @@ spec:
subset: v1
```

-----

### Injecting an HTTP abort fault

[https://istio.io/docs/tasks/traffic-management/fault-injection/#injecting-an-http-abort-fault](https://istio.io/docs/tasks/traffic-management/fault-injection/#injecting-an-http-abort-fault)
Expand Down Expand Up @@ -1368,6 +1388,8 @@ spec:
subset: v1
```

-----

### Weight-based routing

[https://istio.io/docs/tasks/traffic-management/traffic-shifting/#apply-weight-based-routing](https://istio.io/docs/tasks/traffic-management/traffic-shifting/#apply-weight-based-routing)
Expand Down Expand Up @@ -1423,6 +1445,8 @@ spec:

![Weight-based routing Kiali Graph](images/istio_kiali_weight-based_routing.gif "Weight-based routing Kiali Graph")

-----

Assuming you decide that the `reviews:v3` microservice is stable, you can route **100%** of the traffic to `reviews:v3` by applying this virtual service.

```bash
Expand All @@ -1433,6 +1457,8 @@ kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-v3.yaml

![Bookinfo v3](images/bookinfo_v3.jpg "Bookinfo v3")

-----

### Mirroring

[https://istio.io/docs/tasks/traffic-management/mirroring/](https://istio.io/docs/tasks/traffic-management/mirroring/)
Expand Down Expand Up @@ -1470,6 +1496,8 @@ spec:
EOF
```

-----

Check the logs on both pods `reviews:v1` and `reviews:v2`:

```shell
Expand Down

0 comments on commit a8497d4

Please sign in to comment.