Skip to content

Kubernetes Gateway API getting started with GKE Gateway controller

Notifications You must be signed in to change notification settings

nurhun/Kubernetes_Gateway_API_getting_started

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Gateway API getting started

This is a POC for the new kubernetes networking evolution step, Kubernetes Gateway API.

While it's supposed that the gateway API comes with extended featues versus the current Ingress project already support. However, this demo will cover deploying simple application with splitted traffic.

Although there are already many implementations, but at the time of making this demo (Dec 31st, 2022) only Google's implementation is (GA).

GKE's implementation of the Gateway API is through the GKE Gateway controller which provisions Google Cloud Load Balancers for Pods in GKE clusters.

That's why I'm going to use a GKE in this demo.

Preparations and prerequisites

  • A GKE cluster with 1.24+ version.
  • Gateway & HTTPRoute manifests
  • Dump app with variatiant services to test traffic splitting feature.

Usage

  1. Provision the required infrastructure through the terraform module in 0-terraform. You need to pass your own project and other parameters, so make use of the terraform.tfvars.template file.

  2. Define the gateway with the required gatewayClass. Here I used the gke-l7-global-external-managed gatewayClass. For more info on available gatewayClasses, take a look here. Definition is in 1-gateway dir.

  3. Deploy the app in 2-deployments. It's a dump django rest app with react frontend. For more info on the app.

  4. Deploy routes to define how the gateway should manage the traffic. manifest in 3-HTTPRoutes dir.
    NOTE: You'll need to get the public ip address assigned to the gateway. To do so, run

kubectl get gateways.gateway.networking.k8s.io external-http -o=jsonpath="{.status.addresses[0].value}"

Then, pass this IP in the HTTPROUTE file .spec.hostnames in the format of browsable <ip_address>.nip.io

  1. Test the traffic spliting and routing behavior by visiting <ip_address>.nip.io

  2. Cleanup infrastructure provisioned.

Out of scope:

  • Securing the gateway.
  • non-http protocol.

Feedback

  • It's observed that deploying or making changes to HTTPRoute takes a bit of time to reflect.
  • I'd argue there'are some requests lost, it's just no response and I had to refresh couple of times to get the page!

About

Kubernetes Gateway API getting started with GKE Gateway controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages