k8s-xds

command module
v0.0.0-...-36ce7d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2022 License: MIT Imports: 7 Imported by: 0

README

Kubernetes xDS server

This small server can be used for:

  • gRPC client-side Load Balancing
  • Envoy cluster CDS

Configuration in the client (supported clients as of september 2020: C-core, Java & Go) goes like this:

    1. Set the environment variable GRPC_XDS_BOOTSTRAP=/bootstrap.json (doc)
    1. Add this file /bootstrap.json containing these contents:
    {
      "xds_servers": [{
        "server_uri": "xds-server-address:8080"
      }],
      "node": {
        "id": "$HOSTNAME",
        "metadata": {
            "SOME_KEY": "SOME_VALUE"
        },
        "locality": {
            "zone": "europe-west4-a"
        }
      }
    } 
    
    1. Create the gRPC client like this:
    import (
      _ "google.golang.org/grpc/xds" // To install the xds resolvers and balancers.
    )
    
    grpc.Dial("xds:///upstream-service", grpc.WithInsecure())
    

References

  1. Guide to the xDS protocol
  2. Original proposal: https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md
  3. https://itnext.io/proxyless-grpc-load-balancing-in-kubernetes-ca1a4797b742 & https://github.com/asishrs/proxyless-grpc-lb
  4. GoogleBlog: efficient multi-zone and topology aware routing
  5. This is an (more flexible) alternative to the TopologyAwareHints beta-feature in Kubernetes 1.23+
  6. Using xDS v3: server_features <- xds_v3
  7. gRPC xDS Loadbalancing
  8. debug gRPC xDS clients

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
demo
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL