CloudCDN + GKE

Hi,

Our team is now considering introducing CloudCDN upon GKE. Let’s say we have web.my.com which is served by GKE with backend service backend through ingress named gateway. We’d want to set up CloudCDN with backend. The GKE cluster is in asia-northeast**1** region.

Now an user whose the nearest region is asia-northeast**2** does access to web.my.com/css/foo.css. If I’m correct, the request is firstly sent to an edge server of CloudCDN which is served in asia-northeast**2** and if the foo.css is not on the cache, a request to get the origin content would be sent.

Here I have 2 questions.

  1. The global IP address for web.my.com is uniquely single. How is the first request sent to asia-northeast**2**? Is that done with IP any cast?

  2. How are requests to the origin sent? The edge server has to have the same global IP address as the origin server. How does the edge server send request to the origin despite of having the same global IP address?

Could anyone help?
Thank you!

1 Like

CloudCDN is not located in a GCP region, but in a Google POP (point of presence), that is one of the points where Google’s own network connects to the internet.
So, the logic will be (assuming you are using Global Load Balancer):

  1. user requests web.my.com/css/foo.css
  2. this will be caught by the POP closer to the user (where CloudCDN resides)
  3. if CloudCDN at that POP has that file cached it will send it to the user, if CDN doesn’t have that file, the file will be requested to the backend closest to the POP (if there were several similar backends distributed in many regions). In your case the file will be requested to the asia-northeast1, as its the only one you have.

You can check POP/CDN locations here:

https://cloud.google.com/cdn/docs/locations

The global load balancing anycast IP adress is listening in all POPs, its not listening in a GCP region.

https://cloud.google.com/load-balancing/docs/load-balancing-overview

3 Likes

Thank you nestors,

That helps a lot!
Now my understanding is like this:
https://whimsical.com/cdn-2-english-AiFtB6ctYrybUQVbQq4zeo

Is this correct?

Thanks again!

1 Like

That’s right: the GCP region in Osaka is not involved at all if you don’t have a backend there.

2 Likes

Thank you!

1 Like