SignalR connection via K8S Ingress
Try:
annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/ssl-redirect: "false" nginx.ingress.kubernetes.io/affinity: cookie nginx.ingress.kubernetes.io/session-cookie-hash: sha1 nginx.ingress.kubernetes.io/session-cookie-name: REALTIMESERVERID
I wrote a sample project a while back, if you want a working example: DenisBiondic/RealTimeMicroservices
As a side note, consider using Azure SignalR Service, it should remove many headaches (also in the example above).
Not familiar with SignalR but there could be a couple of things.
- The nginx Ingress might be stripping some http headers that SignalR needs. Are you familiar with the http headers that the SignalR is supposed to receive?
After authenticating, is it possible that SignalR hub is trying to speak TLS? I see that you have this running on port 80 with not TLS. You would have to configure something like this:
apiVersion: extensions/v1beta1kind: Ingressmetadata: name: endpoints annotations: kubernetes.io/ingress.class: addon-http-application-routing ingress.kubernetes.io/ssl-redirect: "false" <== you may need to remove nginx.ingress.kubernetes.io/ssl-redirect: "false" <== you may need to remove nginx.org/websocket-services: "myservice"spec: rules: - host: api.[MY-DOMAIN].com http: paths: - backend: serviceName: myservice servicePort: 80 path: /myservice tls: - secretName: <your-tls-certs>
Hope it helps!