Deployed k8s on AWS with KOPS. I have created nginx ingress https://github.com/kubernetes/ingress-nginx nginx-ingress-controller image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.18.0
Everything is up and running and I could able to access applications externally using aws classic load balancer which is created by nginx service.
Recently we started working on websockets. I deployed my services in k8s and trying to access externally.
I created service and ingress for my application. Ingress is now pointing to loadbalancer(below json file).
I created route53 entry in aws and trying to connect to that but I am getting below error when I am trying to connect from my client application through chrome browser
WebSocket connection to 'wss://blockchain.aro/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
I tried creating Application load balancer but I could not able to connect to wss://<host>
Error:
WebSocket connection to 'wss://blockchain.aro/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
const config: SocketIoConfig = { url: 'wss://blockchain.aro',
options: { autoConnect: false, transports: ['websocket']} };
Ingress:
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"extensions/v1beta1\",\"kind\":\"Ingress\",\"metadata\":{\"annotations\":{},\"name\":\"blockchain\",\"namespace\":\"adapt\"},\"spec\":{\"rules\":[{\"host\":\"blockchain.aro\",\"http\":{\"paths\":[{\"backend\":{\"serviceName\":\"blockchain\",\"servicePort\":8097},\"path\":\"/\"},{\"backend\":{\"serviceName\":\"blockchain\",\"servicePort\":8097},\"path\":\"/socket.io\"},{\"backend\":{\"serviceName\":\"blockchain\",\"servicePort\":8097},\"path\":\"/ws/\"}]}}],\"tls\":[{\"hosts\":[\"blockchain.aro\"],\"secretName\":\"blockchain-tls-secret\"}]}}\n",
"nginx.ingress.kubernetes.io/proxy-read-timeout": "3600",
"nginx.ingress.kubernetes.io/proxy-send-timeout": "3600"
}
included tls
and secretname
and rules
in ingress file. I tried creating ApplicationLoadbalancer
but I could not able to connect with that too.