📚 K8gb - Awesome Go Library for Distributed Systems

Go Gopher mascot for K8gb

A cloud native Kubernetes Global Balancer.

🏷️ Distributed Systems
📂 Packages that help with building Distributed Systems.
866 stars
View on GitHub 🔗

Detailed Description of K8gb

K8GB - Kubernetes Global Balancer

CNCF Sandbox Project | Roadmap | Join #k8gb on CNCF Slack

License: MIT Build Status Terratest Status CodeQL Go Report Card Helm Publish KubeLinter Docker Pulls Artifact HUB doc.crds.dev FOSSA Status CII Best Practices CLOMonitor OpenSSF Scorecard

A Global Service Load Balancing solution with a focus on having cloud native qualities and work natively in a Kubernetes context.

Just a single Gslb CRD to enable the Global Load Balancing:

apiVersion: k8gb.absa.oss/v1beta1
kind: Gslb
metadata:
  name: test-gslb-failover
  namespace: test-gslb
spec:
  resourceRef:
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    matchLabels: # ingresses.networking.k8s.io resource selector
      app: test-gslb-failover
  strategy:
    type: failover # Global load balancing strategy
    primaryGeoTag: eu-west-1 # Primary cluster geo tag

Global load balancing, commonly referred to as GSLB (Global Server Load Balancing) solutions, has been typically the domain of proprietary network software and hardware vendors and installed and managed by siloed network teams.

k8gb is a completely open source, cloud native, global load balancing solution for Kubernetes.

k8gb focuses on load balancing traffic across geographically dispersed Kubernetes clusters using multiple load balancing strategies to meet requirements such as region failover for high availability.

Global load balancing for any Kubernetes Service can now be enabled and managed by any operations or development teams in the same Kubernetes native way as any other custom resource.

Key Differentiators

  • Load balancing is based on timeproof DNS protocol which is perfect for global scope and extremely reliable
  • No dedicated management cluster and no single point of failure
  • Kubernetes native application health checks utilizing status of Liveness and Readiness probes for load balancing decisions
  • Configuration with a single Kubernetes CRD of Gslb kind

Quick Start

Simply run

make deploy-full-local-setup

It will deploy two local k3s clusters via k3d, expose associated CoreDNS service for UDP DNS traffic), and install k8gb with test applications and two sample Gslb resources on top.

This setup is adapted for local scenarios and works without external DNS provider dependency.

Consult with local playground documentation to learn all the details of experimenting with local setup.

Optionally, you can run make deploy-prometheus and check the metrics on the test clusters (http://localhost:9080, http://localhost:9081).

Motivation and Architecture

k8gb was born out of the need for an open source, cloud native GSLB solution at Absa Group in South Africa.

As part of the bank's wider container adoption running multiple, geographically dispersed Kubernetes clusters, the need for a global load balancer that was driven from the health of Kubernetes Services was required and for which there did not seem to be an existing solution.

Yes, there are proprietary network software and hardware vendors with GSLB solutions and products, however, these were costly, heavyweight in terms of complexity and adoption, and were not Kubernetes native in most cases, requiring dedicated hardware or software to be run outside of Kubernetes.

This was the problem we set out to solve with k8gb.

Born as a completely open source project and following the popular Kubernetes operator pattern, k8gb can be installed in a Kubernetes cluster and via a Gslb custom resource, can provide independent GSLB capability to any Ingress or Service in the cluster, without the need for handoffs and coordination between dedicated network teams.

k8gb commoditizes GSLB for Kubernetes, putting teams in complete control of exposing Services across geographically dispersed Kubernetes clusters across public and private clouds.

k8gb requires no specialized software or hardware, relying completely on other OSS/CNCF projects, has no single point of failure, and fits in with any existing Kubernetes deployment workflow (e.g. GitOps, Kustomize, Helm, etc.) or tools.

Please see the extended architecture documentation here

Internal k8gb architecture and its components are described here

Installation and Configuration Tutorials

Adopters

A list of publicly known users of the K8GB project can be found in ADOPTERS.md. We encourage all users of K8GB to add themselves to this list!

Production Readiness

k8gb is very well tested with the following environment options

TypeImplementation
Kubernetes Versionfor k8s < 1.19 use k8gb <= 0.8.8; since k8s 1.19 use 0.9.0 or newer
EnvironmentSelf-managed, AWS(EKS) *
Ingress ControllerNGINX, AWS Load Balancer Controller *
EdgeDNSInfoblox, Route53, NS1

* We only mention solutions where we have tested and verified a k8gb installation. If your Kubernetes version or Ingress controller is not included in the table above, it does not mean that k8gb will not work for you. k8gb is architected to run on top of any compliant Kubernetes cluster and Ingress controller.

Presentations Featuring k8gb

KubeCon EU 2024 KubeCon NA 2023
KCDBengaluru 2023 KubeCon EU 2023
KubeCon NA 2021 FOSDEM 2022
NS1 INS1GHTS Crossplane Community Day
#29 DoK Community AWS Containers from the Couch show
OpenShift Commons Briefings Demo at Kubernetes SIG Multicluster

You can also find recordings from our community meetings at k8gb youtube channel.

Online Publications Featuring k8gb

And Even Books Featuring k8gb :)

Kubernetes - An Enterprise Guide - Second Edition Kubernetes – An Enterprise Guide - Third Edition

Contributing

See CONTRIBUTING