I have created a nodeport service for my tomcat app which is working on port 8080 using a yaml file , I have also created an internal loadbalancer in GCP and using this internal LB frontend static ip:port I want reach to my gke pods , but some how I am not able to.
I am suspecting that backend of the internal loadbalancer doesn't picking port 8080 , also I guess the backend of internal LB doesn't support named port in zonal network endpoint group
here is the service file for google kubernetes engine :-
apiVersion: v1
kind: Service
metadata:
name: stage-validation-service
namespace: stage-api
annotations:
cloud.google.com/app-protocols: '{"stage-validationapi-port":"TCP"}'
cloud.google.com/neg: '{"exposed_ports": {"8080":{"name": "validationapi-neg"}}}'
spec:
ports:
- name : stage-validationapi-port
port: 8080
targetPort: 8080
selector:
stage-api: stage-validation-api
type: NodePort
Note :- when I hit gke podip:8080 I am able to reach to the pod but when I hit internal LB ip with 8080 I am getting this error "stream timeout"
http://10.30.0.4:8080/validation/api/v1/lbhealth ----------------------------> 10.30.0.4:8080 is the frontend ip of internal LB http://10.80.9.36:8080/validation/api/v1/lbhealth -----------------------------> 10.80.9.36:8080 is the pod ip of my gke cluster
I just want reach my pods using internal Loadbalancer frontend IP
i have enabled firewall rule for internal LB subnet but not able to reach to my pods
here are some screenshots of Loadbalancer and Network endpoint group