xds

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

Fake control plane

This directory contains a fake control plane used to run PSM benchmarks. The fake control plane runs in a container as part of the test client pod.

xDS server

The xDS server first reads and validates a resource fragment from a configuration file. This fragment is a template, requiring the test's backend server details to be filled in.

The xDS server then starts an endpoint update server that listens for a message from the test driver's ready container. The message contains the test's backend server IP and port, and whether the test should be proxied or proxyless. The update server responds to this message with the correct target string to be passed to the driver's run container. The update server shuts down after responding to the message.

For a proxied test, the xDS server will remove all api_listeners from its configuration, and only serve the socket listener to the Envoy sidecar.

After filling in the actual backend service addresses, the xDS server starts listening for requests and serves the configuration created through the above steps.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunUpdateServer

func RunUpdateServer(testUpdateChannel chan TestInfo, updatePort uint, snapshot *cache.Snapshot)

RunUpdateServer start a gRPC server listening to test server address and port

func RunxDSServer

func RunxDSServer(ctx context.Context, srv server.Server, port uint, grpcServer *grpc.Server)

RunxDSServer starts an xDS server at the given port.

Types

type Logger

type Logger struct {
}

Logger implements the Logger interface required.

func (Logger) Debugf

func (logger Logger) Debugf(format string, args ...interface{})

Debugf prints out debug information.

func (Logger) Errorf

func (logger Logger) Errorf(format string, args ...interface{})

Errorf prints out the error message and stops the process.

func (Logger) Infof

func (logger Logger) Infof(format string, args ...interface{})

Infof prints out useful information.

func (Logger) Warnf

func (logger Logger) Warnf(format string, args ...interface{})

Warnf prints out warnings.

type TestInfo

type TestInfo struct {
	Endpoints []config.TestEndpoint
	IsProxied bool
}

TestInfo contains the information such as backend's pod address, port and the type of the test.

type UpdateServer

type UpdateServer struct {
	pb.UnimplementedTestUpdaterServer
	TestInfoChannel chan TestInfo
	Srv             *grpc.Server
	Snapshot        *cache.Snapshot
}

UpdateServer is used to implement testupdater.TestUpdater.

func (*UpdateServer) QuitTestUpdateServer

func (us *UpdateServer) QuitTestUpdateServer(context.Context, *pb.Void) (*pb.Void, error)

QuitTestUpdateServer stop the UpdateServer.

func (*UpdateServer) UpdateTest

func (us *UpdateServer) UpdateTest(ctx context.Context, in *pb.TestUpdateRequest) (*pb.TestUpdateReply, error)

UpdateTest implements testupdater.UpdateTest

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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