manager

package
v1.6.1-0...-f207c0f Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 72 Imported by: 0

Documentation

Overview

Package manager implements the controller manager for all controllers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAPIClientFromServiceDiscovery

func AdminAPIClientFromServiceDiscovery(
	ctx context.Context,
	logger logr.Logger,
	kongAdminSvcNN k8stypes.NamespacedName,
	kubeClient client.Client,
	discoverer AdminAPIsDiscoverer,
	factory AdminAPIClientFactory,
	retryOpts ...retry.Option,
) ([]*adminapi.Client, error)

Types

type AdminAPIClientFactory

type AdminAPIClientFactory interface {
	CreateAdminAPIClient(context.Context, adminapi.DiscoveredAdminAPI) (*adminapi.Client, error)
}

type AdminAPIsDiscoverer

type AdminAPIsDiscoverer interface {
	GetAdminAPIsForService(context.Context, client.Client, k8stypes.NamespacedName) (sets.Set[adminapi.DiscoveredAdminAPI], error)
}

type Controller

type Controller interface {
	SetupWithManager(ctrl.Manager) error
}

Controller is a Kubernetes controller that can be plugged into Manager.

type ControllerDef

type ControllerDef struct {
	Enabled    bool
	Controller Controller
}

ControllerDef is a specification of a Controller that can be conditionally registered with Manager.

func (*ControllerDef) MaybeSetupWithManager

func (c *ControllerDef) MaybeSetupWithManager(mgr ctrl.Manager) error

MaybeSetupWithManager runs SetupWithManager on the controller if it is enabled.

func (*ControllerDef) Name

func (c *ControllerDef) Name() string

Name returns a human-readable name of the controller.

type GatewayClientsProvider

type GatewayClientsProvider interface {
	GatewayClients() []*adminapi.Client
}

GatewayClientsProvider is an interface that provides clients for the currently discovered Gateway instances.

type InstanceID

type InstanceID interface {
	String() string
}

type Manager

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

func New

func New(
	ctx context.Context,
	instanceID InstanceID,
	c managercfg.Config,
	logger logr.Logger,
) (*Manager, error)

New configures the controller manager call Start.

func (*Manager) DiagnosticsHandler

func (m *Manager) DiagnosticsHandler() http.Handler

DiagnosticsHandler returns the diagnostics HTTP handler if it's enabled in the configuration. Otherwise, it returns nil.

func (*Manager) GetClientsManager

func (m *Manager) GetClientsManager() *clients.AdminAPIClientsManager

GetClientsManager returns the AdminAPIClientsManager used by the manager. TODO: It is used by telemetry to calculate kongVersion, DB mode and router flavor. It shouldn't be exposed so wide, only relevant stuff.

func (*Manager) GetKubeconfig

func (m *Manager) GetKubeconfig() *rest.Config

GetKubeconfig returns the Kubernetes client configuration used by the manager.

func (*Manager) IsReady

func (m *Manager) IsReady() error

IsReady checks if the controller manager is ready to manage resources. It's only valid to call this method after the controller manager has been started with method Run(ctx).

func (*Manager) KongValidator

func (m *Manager) KongValidator() admission.KongHTTPValidator

func (*Manager) Run

func (m *Manager) Run(ctx context.Context) error

Run starts the Kong Ingress Controller. It blocks until the context is cancelled. It should be called only once per Manager instance.

type SchemaServiceGetter

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

SchemaServiceGetter returns schema service of an admin API client if there is any client available.

func NewSchemaServiceGetter

func NewSchemaServiceGetter(cm GatewayClientsProvider) SchemaServiceGetter

NewSchemaServiceGetter creates a schema service getter that uses given client manager to maintain admin API clients.

func (SchemaServiceGetter) GetSchemaService

func (ssg SchemaServiceGetter) GetSchemaService() kong.AbstractSchemaService

GetSchemaService returns the schema service for admin API client. It uses the configured clients manager to get the clients and then it uses one of those to obtain the service.

type TypeMetaSettingClient

type TypeMetaSettingClient struct {
	client.Client
}

TypeMetaSettingClient decorates client.Client so that it populates the TypeMeta field of the object after fetching it from the API server.

func NewTypeMetaSettingClient

func NewTypeMetaSettingClient(c client.Client) TypeMetaSettingClient

func (TypeMetaSettingClient) Get

Get retrieves an object from the Kubernetes API server and populates the TypeMeta field of the object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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