setup

package
v1.17.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 87 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoXdsPortFoundError = eris.New("failed to find xds port")

	NoGlooSvcFoundError = eris.New("failed to find Gloo service")
)
View Source
var (
	DefaultXdsBindAddr        = fmt.Sprintf("0.0.0.0:%v", defaults.GlooXdsPort)
	DefaultValidationBindAddr = fmt.Sprintf("0.0.0.0:%v", defaults.GlooValidationPort)
	DefaultRestXdsBindAddr    = fmt.Sprintf("0.0.0.0:%v", defaults.GlooRestXdsPort)
	DefaultProxyDebugAddr     = fmt.Sprintf("0.0.0.0:%v", defaults.GlooProxyDebugPort)
)
View Source
var AcceptAllResourcesByDefault = true

TODO: (copied from gateway) switch AcceptAllResourcesByDefault to false after validation has been tested in user environments

View Source
var AllowWarnings = true
View Source
var ErrNilExtension = func(name string) error {
	return errors.Errorf("Extensions.%s must be defined, found nil", name)
}

Functions

func ExecuteAsynchronousStartFuncs added in v1.17.0

func ExecuteAsynchronousStartFuncs(
	ctx context.Context,
	opts bootstrap.Opts,
	extensions Extensions,
	startFuncs map[string]StartFunc,
	errorGroup *errgroup.Group,
)

ExecuteAsynchronousStartFuncs accepts a collection of StartFunc inputs, and executes them within an Error Group

func GetControlPlaneXdsHost added in v1.17.0

func GetControlPlaneXdsHost() string

GetControlPlaneXdsHost gets the xDS address from the gloo Service.

func GetControlPlaneXdsPort added in v1.17.0

func GetControlPlaneXdsPort(ctx context.Context, svcClient skkube.ServiceClient) (int32, error)

GetControlPlaneXdsPort gets the xDS port from the gloo Service.

func GetNamespacedControlPlaneXdsPort added in v1.17.0

func GetNamespacedControlPlaneXdsPort(ctx context.Context, svcNamespace string, svcClient skkube.ServiceClient) (int32, error)

GetNamespacedControlPlaneXdsPort gets the xDS port from the Gloo Service, provided the namespace the Service is running in

func NewControlPlane

func NewControlPlane(ctx context.Context, grpcServer *grpc.Server, bindAddr net.Addr, kubeControlPlaneCfg bootstrap.KubernetesControlPlaneConfig,
	callbacks xdsserver.Callbacks, start bool) bootstrap.ControlPlane

func NewProxyDebugServer added in v1.9.25

func NewProxyDebugServer(ctx context.Context, grpcServer *grpc.Server, bindAddr net.Addr, start bool) bootstrap.ProxyDebugServer

func NewSetupFunc

func NewSetupFunc() setuputils.SetupFunc

func NewSetupFuncWithExtensions

func NewSetupFuncWithExtensions(extensions Extensions) setuputils.SetupFunc

used outside of this repo

func NewSetupFuncWithRun

func NewSetupFuncWithRun(runFunc RunFunc) setuputils.SetupFunc

for use by UDS, FDS, other v1.SetupSyncers

func NewSetupFuncWithRunAndExtensions

func NewSetupFuncWithRunAndExtensions(runFunc RunFunc, extensions *Extensions) setuputils.SetupFunc

Called directly by GlooEE

func NewValidationServer

func NewValidationServer(ctx context.Context, grpcServer *grpc.Server, bindAddr net.Addr, start bool) bootstrap.ValidationServer

func RunGloo

func RunGloo(opts bootstrap.Opts) error

func RunGlooWithExtensions

func RunGlooWithExtensions(opts bootstrap.Opts, extensions Extensions) error

RunGlooWithExtensions is the core entrypoint to the Gloo components. THIS FUNCTION MUST NOT BLOCK:

It is invoked by an outer control loop (SetupFunc) which monitors
the current Settings resource, and re-runs this function each time the global Settings change

This function is called directly by GlooEE

Types

type Extensions

type Extensions struct {
	// PluginRegistryFactory is responsible for creating an xDS PluginRegistry
	// This is the set of plugins which are executed when converting a Proxy into an xDS Snapshot
	PluginRegistryFactory plugins.PluginRegistryFactory

	// SyncerExtensions perform additional syncing logic on a given ApiSnapshot
	// These are used to inject the syncers that process Enterprise-only APIs (AuthConfig, RateLimitConfig)
	SyncerExtensions []syncer.TranslatorSyncerExtensionFactory

	// XdsCallbacks are asynchronous callbacks to perform during xds communication
	XdsCallbacks xdsserver.Callbacks

	// ApiEmitterChannel is a channel that forces the API Emitter to emit a new API Snapshot
	ApiEmitterChannel chan struct{}

	// K8sGatewayExtensionsFactory is the factory function which will return an extensions.K8sGatewayExtensions
	// This is responsible for producing the extension points that the K8s Gateway integration requires
	K8sGatewayExtensionsFactory extensions.K8sGatewayExtensionsFactory
}

Extensions contains the set of extension points for Gloo. These are the injectable pieces of code, which we use to define separate implementations of our Open Source and Enterprise Control Plane implementations. See RunGlooWithExtensions for where this is used.

func (Extensions) Validate added in v1.17.0

func (e Extensions) Validate() error

Validate returns an error if the Extensions are invalid, nil otherwise

type RunFunc

type RunFunc func(opts bootstrap.Opts) error

type StartFunc added in v1.17.0

type StartFunc func(ctx context.Context, opts bootstrap.Opts, extensions Extensions) error

StartFunc represents a function that will be called with the initialized bootstrap.Opts and Extensions. This is invoked each time the setup_syncer is executed (which runs whenever the Setting CR is modified)

func AdminServerStartFunc added in v1.17.0

func AdminServerStartFunc(history iosnapshot.History) StartFunc

AdminServerStartFunc returns the setup.StartFunc for the Admin Server The Admin Server is the groundwork for an Administration Interface, similar to that of Envoy https://github.com/solo-io/gloo/issues/6494 The endpoints that are available on this server are split between two places:

  1. The default endpoints are defined by our stats server: https://github.com/solo-io/go-utils/blob/8eda16b9878d71673e6a3a9756f6088160f75468/stats/stats.go#L79
  2. Custom endpoints are defined by our admin server handler in `gloo/pkg/servers/admin`

func K8sGatewayControllerStartFunc added in v1.17.0

func K8sGatewayControllerStartFunc(
	proxyClient v1.ProxyClient,
	queueStatusForProxies proxy_syncer.QueueStatusForProxiesFn,
	authConfigClient api.AuthConfigClient,
	routeOptionClient gateway.RouteOptionClient,
	vhOptionClient gateway.VirtualHostOptionClient,
	statusClient resources.StatusClient,
	snapshotHistory iosnapshot.History,
) StartFunc

K8sGatewayControllerStartFunc returns a StartFunc to run the k8s Gateway controller

Jump to

Keyboard shortcuts

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