controller

package
v1.18.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AutoProvision controls whether the controller will be responsible for provisioning dynamic
	// infrastructure for the Gateway API.
	AutoProvision = true
)
View Source
const (
	GatewayAutoDeployAnnotationKey = "gateway.gloo.solo.io/auto-deploy"
)
View Source
const (
	// field name used for indexing
	GatewayParamsField = "gateway-params"
)

Variables

This section is empty.

Functions

func NewBaseGatewayController

func NewBaseGatewayController(ctx context.Context, cfg GatewayConfig) error

Types

type ControllerBuilder

type ControllerBuilder struct {
	// contains filtered or unexported fields
}

Start runs the controllers responsible for processing the K8s Gateway API objects It is intended to be run in a goroutine as the function will block until the supplied context is cancelled

func NewControllerBuilder

func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuilder, error)

func (*ControllerBuilder) Start

func (c *ControllerBuilder) Start(ctx context.Context) error

type GatewayConfig

type GatewayConfig struct {
	Mgr            manager.Manager
	GWClasses      sets.Set[string]
	Dev            bool
	ControllerName string
	AutoProvision  bool
	Kick           func(ctx context.Context)

	ControlPlane            deployer.ControlPlaneInfo
	IstioIntegrationEnabled bool
	Aws                     *deployer.AwsInfo

	Extensions extensions.K8sGatewayExtensions
	// CRDs defines the set of discovered Gateway API CRDs
	CRDs sets.Set[string]
}

type ObjList

type ObjList[T any, PT Object[T]] struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Items           []T `json:"items" protobuf:"bytes,2,rep,name=items"`
}

func (*ObjList[T, PT]) DeepCopyObject

func (t *ObjList[T, PT]) DeepCopyObject() runtime.Object

func (*ObjList[T, PT]) EachListItem

func (t *ObjList[T, PT]) EachListItem(f func(runtime.Object) error) error

func (*ObjList[T, PT]) EachListItemWithAlloc

func (t *ObjList[T, PT]) EachListItemWithAlloc(f func(runtime.Object) error) error

func (*ObjList[T, PT]) GetObjectKind

func (t *ObjList[T, PT]) GetObjectKind() schema.ObjectKind

func (*ObjList[T, PT]) IsList

func (t *ObjList[T, PT]) IsList() bool

func (*ObjList[T, PT]) NewEmptyInstance

func (t *ObjList[T, PT]) NewEmptyInstance() runtime.Unstructured

func (*ObjList[T, PT]) SetUnstructuredContent

func (t *ObjList[T, PT]) SetUnstructuredContent(map[string]interface{})

func (*ObjList[T, PT]) UnstructuredContent

func (t *ObjList[T, PT]) UnstructuredContent() map[string]interface{}

type Object

type Object[T any] interface {
	*T
	client.Object
}

type StartConfig

type StartConfig struct {
	Dev        bool
	SetupOpts  *bootstrap.SetupOpts
	RestConfig *rest.Config
	// ExtensionsFactory is the factory function which will return an extensions.K8sGatewayExtensions
	// This is responsible for producing the extension points that this controller requires
	ExtensionsFactory extensions.K8sGatewayExtensionsFactory

	// GlooStatusReporter is the shared reporter from setup_syncer that reports as 'gloo',
	// it is used to report on Upstreams and Proxies after xds translation.
	// this is required because various upstream tests expect a certain reporter for Upstreams
	// TODO: remove the other reporter and only use this one, no need for 2 different reporters
	GlooStatusReporter reporter.StatusReporter

	// KubeGwStatusReporter is used within any StatusPlugins that must persist a GE-classic style status
	// TODO: as mentioned above, this should be removed: https://github.com/solo-io/solo-projects/issues/7055
	KubeGwStatusReporter reporter.StatusReporter

	// Translator is an instance of the Gloo translator used to translate Proxy -> xDS Snapshot
	Translator setup.TranslatorFactory

	// SyncerExtensions is a list of extensions, the kube gw controller will use these to get extension-specific
	// errors & warnings for any Proxies it generates
	SyncerExtensions []syncer.TranslatorSyncerExtension

	Client istiokube.Client

	AugmentedPods krt.Collection[krtcollections.LocalityPod]
	UniqueClients krt.Collection[krtcollections.UniqlyConnectedClient]

	InitialSettings *glookubev1.Settings
	Settings        krt.Singleton[glookubev1.Settings]

	Debugger *krt.DebugHandler
}

type TypedClient

type TypedClient[T any, PT Object[T]] struct {
	Cli    client.Client
	Scheme *runtime.Scheme
}

func (TypedClient[T, PT]) Get

func (t TypedClient[T, PT]) Get(ctx context.Context, key client.ObjectKey, opts ...client.GetOption) (*T, error)

func (TypedClient[T, PT]) List

func (t TypedClient[T, PT]) List(ctx context.Context, opts ...client.ListOption) ([]T, error)

Jump to

Keyboard shortcuts

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