istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/websockets/README.md (about) 1 # Tornado - Demo Websockets App 2 3 This is a sample application that demonstrates the use of an upgraded websockets connection on an ingress traffic when using Istio `VirtualService`. 4 The `app.yaml` creates a Kubernetes `Service` and a `Deployment` that is based on an existing Docker image for [Hiroakis's Tornado Websocket Example](https://github.com/hiroakis/tornado-websocket-example). 5 6 __Notice:__ The addition of websockets upgrade support in v1alpha3 routing rules has only been added after the release of `Istio v0.8.0`. 7 8 ## Prerequisites 9 10 Install Istio by following the [Istio Quick Start](https://istio.io/docs/setup/kubernetes/quick-start.html). 11 12 ## Installation 13 14 1. First install the application service: 15 16 - With manual sidecar injection: 17 18 ```command 19 kubectl create -f <(istioctl kube-inject -f samples/websockets/app.yaml) 20 ``` 21 22 - With automatic sidecar injection 23 24 ```command 25 kubectl create -f samples/websockets/app.yaml 26 ``` 27 28 1. Create the Ingress `Gateway` and `VirtualService` that enables the upgrade to Websocket for incoming traffic: 29 30 ```command 31 kubectl create -f samples/websockets/route.yaml 32 ``` 33 34 ## Test 35 36 - [Find your ingress gateway IP](https://istio.io/docs/tasks/traffic-management/ingress/#determining-the-ingress-ip-and-ports) 37 38 - Access <http://$GATEWAY_IP/> with your browser 39 40 - The `WebSocket status` should show a green `open` status which means that a websocket connection to the server has been established. 41 To see the websocket in action see the instructions in the _REST API examples_ section of the demo app webpage for updating the server-side data and getting the updated data through the open websocket to the table in the webpage (without refreshing). 42 43 ## Cleanup 44 45 ```command 46 kubectl delete -f samples/websockets/route.yaml 47 kubectl delete -f samples/websockets/app.yaml 48 ```