0
votes

I have a workload in GKE cluster and I need to expose one port with both TCP and UDP protocols externally. The complication is that egress and ingress should go through the same external IP in order to make P2P protocol working.

Currently, my cluster is public and I use a trick with hostNetwork: true described here https://stackoverflow.com/a/47887571/803403, but considering moving to a private cluster and using Cloud NAT. However, I did not find a way how to expose that port in this case. I tried to expose it via ClusterIP, but in firewall rules could not map the external port to that ClusterIP port since the last one does not have network tags. And also I'm not sure if firewall rules can be applied to Cloud Router that is bonded to Cloud NAT.

Does anybody have an idea?

Thanks!

1
Why you don't expose it with a LoadBalancer?guillaume blaquiere
Checking this article, you will need to use nodeport instead. See if it fits your use case.Alex G
@guillaumeblaquiere LoadBalancer does not support multiple protocols on the same port.azhurb
@AlexG unfortunately the main condition for nodeport is it is needed to have external IP address assigned to one of the nodes in cluster Which is not the case for the private cluster.azhurb

1 Answers

1
votes

You are in a dead end! Today you expose your service through a public IP of one of your node. If you go private, you will no longer have a public IP, only private IP. Thus, you need something that bridge the private world and the public internet: a Load balancer

However, multiprotocol on the same IP (here TCP and UDP) isn't natively supported by Google Load balancer, and you can't use Load Balancer.

No luck...

Note: I know there are updates in progress on Google Cloud internal network side, but that's all. I don't know exactly what and if a new type of load balancer will be released or not. Maybe... stay tune, but it won't be en the next weeks