I'm trying to deploy Spring boot websocket application to AWS EKS with ALB ingress controller. The application works fine when deployed on aws elastic beanstalk with aws classic load balancer. On AWS EKS cluster, the deployed pod is up and running, but it can't connect to the websocket - health checks are failing with timeout. I'm sending ingress, service and deployment yaml files. Does anyone know if I'm missing something from the setup?
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: xxxxx-dev-ws-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=600
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/backend-protocol: TCP
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:xxxxxxxxxx:certificate/110a2314-db4e-46ed-bbfa-c09345754794
alb.ingress.kubernetes.io/target-type: ip
spec:
rules:
- host: dev-ws.xxx.com
- http:
paths:
- path: /ws-chat/*
pathType: Prefix
backend:
service:
name: wschatapi
port:
number: 80
apiVersion: v1
kind: Service
metadata:
name: wschatapi
spec:
selector:
app: wschatapi
ports:
- port: 80
protocol: TCP
targetPort: 5000
nodePort: 31012
type: NodePort
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-chatapi
spec:
replicas: 1
selector:
matchLabels:
app: ws-chatapi
environment: dev
template:
metadata:
labels:
app: ws-chatapi
environment: dev
spec:
containers:
- name: ws-chatapi
image: xxxxxxx.dkr.ecr.xxxx.amazonaws.com/ws-chatapi
imagePullPolicy: Always
ports:
- containerPort: 5000