Using a NAT Gateway with Kubernetes Engine
This lab uses the Modular NAT Gateway on Compute Engine for Terraform to automate creation of a NAT gateway managed instance group. You direct traffic from the instances by using tag-based routing, although only instances with matching tags use the NAT gateway route.
Under normal circumstances, Kubernetes Engine nodes route all egress traffic through the internet gateway associated with their node cluster. The internet gateway connection, in turn, is defined by the Compute Engine network associated with the node cluster. Each node in the cluster has an ephemeral external IP address. When nodes are created and destroyed during autoscaling, new node IP addresses are allocated automatically.
The default gateway behavior works well under normal circumstances. However, you might want to modify how ephemeral external IP addresses are allocated in order to:
- Provide a third-party service with a consistent external IP address.
- Monitor and filter egress traffic out of the Kubernetes Engine cluster.
In this lab, you will learn how to:
- Create a NAT gateway instance and configure its routing details for an existing Kubernetes Engine cluster.
- Create a custom routing rule for the NAT gateway instance.
The following diagram shows an overview of the architecture:
Join Qwiklabs to Read the Rest of this Lab...and More!
- Get temporary access to the Google Cloud Console.
- Nearly 100 labs from beginner to advanced levels.
- Bite-sized so you can learn at your own pace.