Ingress unable to connect to pod
h3mant-1 opened this issue · 0 comments
h3mant-1 commented
Server config:
@Bean
public SocketIOServer socketIOServer() {
com.corundumstudio.socketio.Configuration config = new com.corundumstudio.socketio.Configuration();
config.setHostname(host); localhost
config.setPort(port); 80
config.setStoreFactory(getRedissonStoreFactory());
config.setTransports(Transport.WEBSOCKET);
config.setOrigin("http://rtssocket.instireviews.com");
// SocketConfig socketConfig = config.getSocketConfig();
// socketConfig.setReuseAddress(true);
return new SocketIOServer(config);
}
Ingress config
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rts-socket-review-ingress
namespace: review
uid: 63c046dc-8e45-418d-9167-ca2c2076063b
resourceVersion: '796105840'
generation: 4
creationTimestamp: '2024-04-16T14:54:12Z'
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"networking.k8s.io/v1","kind":"Ingress","metadata":{"annotations":{"nginx.ingress.kubernetes.io/affinity":"cookie","nginx.ingress.kubernetes.io/affinity-mode":"persistent","nginx.ingress.kubernetes.io/configuration-snippet":"proxy_set_header
Upgrade \"websocket\";\nproxy_set_header Connection
\"Upgrade\";\n","nginx.ingress.kubernetes.io/force-ssl-redirect":"false","nginx.ingress.kubernetes.io/session-cookie-expires":"172800","nginx.ingress.kubernetes.io/session-cookie-max-age":"172800","nginx.ingress.kubernetes.io/session-cookie-name":"route","nginx.ingress.kubernetes.io/session-cookie-samesite":"None","nginx.ingress.kubernetes.io/ssl-redirect":"false"},"name":"rts-socket-review-ingress","namespace":"review"},"spec":{"ingressClassName":"nginx-stage","rules":[{"host":"rtssocket.instireviews.com","http":{"paths":[{"backend":{"service":{"name":"real-time-server-review","port":{"number":80}}},"path":"/","pathType":"ImplementationSpecific"}]}}],"tls":[{"hosts":["rtssocket.instireviews.com"],"secretName":"instireview-secret-tls"}]},"status":{"loadBalancer":{"ingress":[{"hostname":"ourhost"}]}}}
nginx.ingress.kubernetes.io/affinity: cookie
nginx.ingress.kubernetes.io/affinity-mode: persistent
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
nginx.ingress.kubernetes.io/force-ssl-redirect: 'false'
nginx.ingress.kubernetes.io/session-cookie-expires: '172800'
nginx.ingress.kubernetes.io/session-cookie-max-age: '172800'
nginx.ingress.kubernetes.io/session-cookie-name: route
nginx.ingress.kubernetes.io/session-cookie-samesite: None
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
managedFields:
- manager: nginx-ingress-controller
operation: Update
apiVersion: networking.k8s.io/v1
time: '2024-04-16T14:54:31Z'
fieldsType: FieldsV1
fieldsV1:
f:status:
f:loadBalancer:
f:ingress: {}
subresource: status
- manager: kubectl-client-side-apply
operation: Update
apiVersion: networking.k8s.io/v1
time: '2024-04-16T16:42:10Z'
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:kubectl.kubernetes.io/last-applied-configuration: {}
f:nginx.ingress.kubernetes.io/affinity: {}
f:nginx.ingress.kubernetes.io/affinity-mode: {}
f:nginx.ingress.kubernetes.io/configuration-snippet: {}
f:nginx.ingress.kubernetes.io/force-ssl-redirect: {}
f:nginx.ingress.kubernetes.io/session-cookie-expires: {}
f:nginx.ingress.kubernetes.io/session-cookie-max-age: {}
f:nginx.ingress.kubernetes.io/session-cookie-name: {}
f:nginx.ingress.kubernetes.io/session-cookie-samesite: {}
f:nginx.ingress.kubernetes.io/ssl-redirect: {}
f:spec:
f:ingressClassName: {}
f:rules: {}
f:tls: {}
selfLink: >-
/apis/networking.k8s.io/v1/namespaces/review/ingresses/rts-socket-review-ingress
status:
loadBalancer:
ingress:
- hostname: >-
ourhostname
spec:
ingressClassName: nginx-stage
tls:
- hosts:
- rtssocket.instireviews.com
secretName: instireview-secret-tls
rules:
- host: rtssocket.instireviews.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: real-time-server-review
port:
number: 80
Error logs:
2024/04/16 17:10:14 [error] 109#109: *33534 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.189.191, server: rtssocket.instireviews.com, request: "GET /socket.io/?EIO=4&transport=websocket HTTP/1.1", upstream: "http://192.168.116.18:80/socket.io/?EIO=4&transport=websocket", host: "rtssocket.instireviews.com"
2024/04/16 17:10:14 [error] 109#109: *33534 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.189.191, server: rtssocket.instireviews.com, request: "GET /socket.io/?EIO=4&transport=websocket HTTP/1.1", upstream: "http://192.168.98.251:80/socket.io/?EIO=4&transport=websocket", host: "rtssocket.instireviews.com"
2024/04/16 17:10:14 [warn] 109#109: *33534 [lua] sticky.lua:189: balance(): failed to get new upstream; using upstream nil while connecting to upstream, client: 162.158.189.191, server: rtssocket.instireviews.com, request: "GET /socket.io/?EIO=4&transport=websocket HTTP/1.1", upstream: "http://192.168.98.251:80/socket.io/?EIO=4&transport=websocket", host: "rtssocket.instireviews.com"
2024/04/16 17:10:14 [warn] 109#109: *33534 [lua] balancer.lua:335: balance(): no peer was returned, balancer: sticky_persistent while connecting to upstream, client: 162.158.189.191, server: rtssocket.instireviews.com, request: "GET /socket.io/?EIO=4&transport=websocket HTTP/1.1", upstream: "http://192.168.98.251:80/socket.io/?EIO=4&transport=websocket", host: "rtssocket.instireviews.com"
Can someone please help, if any more information is needed let me know.