bypass a load balancer rule

2/7/2022

i have pod on which an app is running and exposing the port 6006

this pod is exposed by a service where i have :

- nodePort: 30017
    port: 6006
    protocol: TCP
    targetPort: 6006

The problem is that the url i use to access this app is based on a LB that only exposes externalIP:443 and i can't add a new policy for 6006.

My question is how can i do on my pod and/or service to match the pod's 6006 to the LB's 443 ?

-- mohamed wael thabet
google-cloud-platform
google-kubernetes-engine
kubernetes
load-balancing

1 Answer

2/9/2022

change your service type to loadblancer

 spec:
  type: loadblancer
  ports:
    - port: 6006
      targetPort: 6006
      protocol: TCP
      name: http

you can also add the option internal if you want to expose your service internally

annotations:
    cloud.google.com/load-balancer-type: Internal
-- M__
Source: StackOverflow