Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add websocket support to an ingress resource in Kubernetes on IBM Bluemix?

When the client tries to connect our ingress defined endpoint via a wss:// request, the app returns 400 bad request, which according to socket.io docs is due to missing headers removed by load balancing proxies like nginx.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    nginx.org/websocket-services: service-name
spec:
  tls:
    - hosts:
        - www.myhost.com
  rules:
    - host: www.myhost.com
      http:
        paths:
          - path: /
            backend:
              serviceName: service-name
              servicePort: 80

From the logs in the IBM provided ingress controller it seems to be a fork of this nginx ingress controller. Which says that the annotation nginx.org/websocket-services adds support for websockets by adding directives to the generated nginx conf to pass the required headers. We have tried this as per above but to no avail.

Has anyone had any success making this annotation work? Any workarounds for adding to the generated nginx conf?

Any IBM people know if this functionality was intentionally removed from the fork? And if there is any way to add support for websockets in the IBM version of Kubernetes?

like image 261
JayAgl Avatar asked Jul 11 '17 09:07

JayAgl


1 Answers

Websockets is not currently supported, we are working on adding it and I will update here when it is available.

Thank you

Edit: Websocket support is available in all regions, the annotation for it is:

  annotations:
    ingress.bluemix.net/websocket-services: service-name
like image 72
Jacob Garcowski Avatar answered Oct 22 '22 21:10

Jacob Garcowski