aigateway

package
v2.4.0-rapid.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package aigateway is able to dynamically run multiple on-prem AI Gateway control plane instances and manage their lifecycle. The generic instance lifecycle is shared with the Kong Ingress Controller's multi-instance manager through the instances package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(cfg Config) (string, error)

Hash computes a hash of the given config. It's used to detect configuration drift of running instances.

Types

type Config

type Config struct {
	// DBLessConfig is the rendered dbless declarative payload for this gateway, ready to be
	// pushed to its data planes' Admin API.
	DBLessConfig []byte
}

Config is the resolved configuration of a single on-prem AI Gateway control plane instance.

type Env

type Env struct {
	// RestConfig is the rest config used to reach the Kubernetes API server.
	RestConfig *rest.Config

	// Scheme is the scheme the instance's manager registers its objects in.
	Scheme *runtime.Scheme

	// CacheSyncTimeout is the cache sync timeout for the instance's controllers.
	CacheSyncTimeout time.Duration
}

Env carries the process-level dependencies an instance needs to build and run its own controller-runtime manager. They never drift with the spec, so they stay out of Config, which is hashed for drift detection.

type Instance

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

Instance is a single on-prem AI Gateway control plane instance. It runs its own controller-runtime manager hosting the configuration-entity controllers (AIGatewayModel, and its sibling kinds as they are added), so that the controllers start and stop together with the OnPremAIGateway resource that owns the instance.

func NewInstance

func NewInstance(
	id manager.ID,
	logger logr.Logger,
	cfg Config,
	env Env,
) *Instance

NewInstance creates a new on-prem AI Gateway control plane instance. It does not start it.

func (*Instance) Config

func (i *Instance) Config() Config

Config returns the configuration of the instance.

func (*Instance) ConfigHash

func (i *Instance) ConfigHash() (string, error)

ConfigHash returns a hash of the instance's configuration.

func (*Instance) DiagnosticsHandler

func (i *Instance) DiagnosticsHandler() http.Handler

DiagnosticsHandler returns nil: the instance does not expose diagnostics data yet. TODO: https://github.com/Kong/kong-operator/issues/5630

func (*Instance) ID

func (i *Instance) ID() manager.ID

ID returns the unique identifier of the instance.

func (*Instance) IsReady

func (i *Instance) IsReady() error

IsReady returns an error if the instance is not ready yet.

There is nothing to wait for yet: the instance does not talk to anything on startup. Once configuration assembly and push land, this has to report the actual readiness of the pushing machinery. TODO: https://github.com/Kong/kong-operator/issues/5569

func (*Instance) Run

func (i *Instance) Run(ctx context.Context) error

Run runs the instance. It blocks until the passed context is cancelled.

type Manager

type Manager struct {
	*instances.Registry
}

Manager runs multiple on-prem AI Gateway control plane instances.

It currently adds nothing on top of the shared registry. It exists as the place to put the AI Gateway specifics as they land, and to keep the AI Gateway instance type from having to satisfy the Kong Ingress Controller's ManagerInstance interface.

func NewManager

func NewManager(logger logr.Logger, opts ...instances.RegistryOption) *Manager

NewManager creates a new AI Gateway multi-instance manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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