setup

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 92 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 GetWriteNamespace added in v1.18.0

func GetWriteNamespace(settings *v1.Settings) string

func NewControlPlane

func NewControlPlane(ctx context.Context, snapshotCache cache.SnapshotCache, 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(setupOpts *bootstrap.SetupOpts) setuputils.SetupFunc

func NewSetupFuncWithExtensions

func NewSetupFuncWithExtensions(setupOpts *bootstrap.SetupOpts, 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, setupOpts *bootstrap.SetupOpts, 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

	// SnapshotHistoryFactory is the factory function which will produce a History object
	// This history object is used by the ControlPlane to track internal state
	SnapshotHistoryFactory iosnapshot.HistoryFactory
}

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 MutltiCallbacks added in v1.18.0

type MutltiCallbacks []xdsserver.Callbacks

func (MutltiCallbacks) OnFetchRequest added in v1.18.0

OnFetchRequest is called for each Fetch request. Returning an error will end processing of the request and respond with an error.

func (MutltiCallbacks) OnFetchResponse added in v1.18.0

OnFetchResponse is called immediately prior to sending a response.

func (MutltiCallbacks) OnStreamClosed added in v1.18.0

func (mc MutltiCallbacks) OnStreamClosed(sid int64)

OnStreamClosed is called immediately prior to closing an xDS stream with a stream ID.

func (MutltiCallbacks) OnStreamOpen added in v1.18.0

func (mc MutltiCallbacks) OnStreamOpen(ctx context.Context, sid int64, url string) error

OnStreamOpen is called once an xDS stream is open with a stream ID and the type URL (or "" for ADS). Returning an error will end processing and close the stream. OnStreamClosed will still be called.

func (MutltiCallbacks) OnStreamRequest added in v1.18.0

OnStreamRequest is called once a request is received on a stream. Returning an error will end processing and close the stream. OnStreamClosed will still be called.

func (MutltiCallbacks) OnStreamResponse added in v1.18.0

OnStreamResponse is called immediately prior to sending a response on a stream.

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, dbg *krt.DebugHandler) 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`

type TranslatorFactory added in v1.18.0

type TranslatorFactory struct {
	PluginRegistry plugins.PluginRegistryFactory
}

func (TranslatorFactory) NewClusterTranslator added in v1.18.0

func (tf TranslatorFactory) NewClusterTranslator(ctx context.Context, settings *v1.Settings) translator.ClusterTranslator

func (TranslatorFactory) NewTranslator added in v1.18.0

func (tf TranslatorFactory) NewTranslator(ctx context.Context, settings *v1.Settings) translator.Translator

Jump to

Keyboard shortcuts

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