github.com/nginxinc/kubernetes-ingress@v1.12.5/examples/websocket/README.md (about)

     1  # WebSocket support
     2  
     3  To load balance a WebSocket application with NGINX Ingress controllers, you need to add the **nginx.org/websocket-services** annotation to your Ingress resource definition. The annotation specifies which services are websocket services. The annotation syntax is as follows:
     4  ```
     5  nginx.org/websocket-services: "service1[,service2,...]"
     6  ```
     7  
     8  In the following example we load balance three applications, one of which is using WebSocket:
     9  ```yaml
    10  apiVersion: networking.k8s.io/v1beta1
    11  kind: Ingress
    12  metadata:
    13    name: cafe-ingress
    14    annotations:
    15      nginx.org/websocket-services: "ws-svc"
    16  spec:
    17    rules:
    18    - host: cafe.example.com
    19      http:
    20        paths:
    21        - path: /tea
    22          backend:
    23            serviceName: tea-svc
    24            servicePort: 80
    25        - path: /coffee
    26          backend:
    27            serviceName: coffee-svc
    28            servicePort: 80
    29        - path: /ws
    30          backend:
    31            serviceName: ws-svc
    32            servicePort: 8008
    33  ```
    34  *ws-svc* is a service for the WebSocket application. The service becomes available at the `/ws` path. Note how we used the **nginx.org/websocket-services** annotation.