#60 - IP Geolocation using Google Cloud Load Balancers

About Episode - Duration: 9 minutes, Published: 2019-03-13

In this episode, we will checking out an IP Geolocation Beta feature using Google Cloud Load Balancers. Using this feature, you can use the Load Balancer to inject additional user defined HTTP headers with IP Geolocation data for user requests.

Download: mp4 or webm

Get notified about future content via the mailing list, follow @jweissig_ on Twitter for episode updates, or use the RSS feed.

Links, Code, and Transcript

Just a heads up, this is only a preview. If you wanted to watch the extended version you will have to get a subscription.

In this episode, we will checking out an IP Geolocation Beta feature using Google Cloud Load Balancers. Using this feature, you can use the Load Balancer to inject user defined HTTP headers with geolocation data from client requests.

Before we dive into the technical aspects of this episode. First, let me show you what the end results looks like. Back in episode 56, we deployed this example site using Kubernetes, then we configured a simple deployment pipeline in episode 58. In this episode, we are adding a little footer down here that guesses where the user request is coming from based off their IP address. You can see here, it says Okay Bay, which is pretty close to where I live. Also, just a heads up, this is pretty specific to Google Cloud but could be reproduced elsewhere with similar technologies (we will about that at the end of this episode).

IP Geolocation using Google Cloud Load Balancers

You can try this out yourself, by going to sysadmindemo.com as looking at the footer. Then, if you click the debug link here, you will get full debug headers of where I think this request is coming from. So, you can see, I think it is coming from Oak Bay, BC, Canada. This is just a few kilometers from my house. Pretty cool.

IP Geolocation using Google Cloud Load Balancers

Alright, lets chat about why I added this? Well, in an upcoming episode, I wanted to build sort of an example interactive game where you answer questions and either get them right or wrong. I wanted to create sort of a leaderboard where we would group all answers by the users country.

Alright, that concludes the preview of this episode. If you want to watch the full version, you will have to have a subscription, you can learn more about them here.

Want to watch the full episode?

A membership gives you access to all content on the site, both free and paid, you will also get complete episode transcripts, and all commands and codes shown in the episode. There are 4 new episodes each month on all types of devops content.

Subscribe for $9/month


Comments (0)

Comments are enabled for subscribers only.

If you are interested in joining the discussion, and getting weekly members only content, please signup.