agentgateway

package
v0.0.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 23 Imported by: 1 module, 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 agentgateway projects agentgateway ingress semantics from Kubernetes Gateway API objects and normalizes agentgateway access logs into telemetry events.

Inputs

The plugin opens no Kubernetes watch. It consumes Services (required) and GatewayClasses, Gateways, and HTTPRoutes (the optional gateway-api-v1 capability) through the Kubernetes plugin's per-GVR and resource-coverage collections. A Gateway is selected when its observed GatewayClass names a configured controller; the configured class names are a fallback only when the class object itself is not observed.

Identity and graph output

All assertions reuse the Kubernetes kubernetes.io/v1 Object scheme (cluster authority, apiVersion/kind/UID key), enriching the resources the Kubernetes inventory already owns. The "semantics" contribution emits Gateway governed-by GatewayClass, HTTPRoute member-of Gateway, and HTTPRoute exposes Service relationships plus agentgateway-ingress, agentgateway-route, and agentgateway-backend facets. Only same-namespace references are projected; cross-namespace backends and missing Services yield diagnostics because ReferenceGrant coverage is not observed. Gateway status and addresses are recorded as observed state, never as proof of external exposure.

Publication waits for both the object and coverage collections to reach a coherent generation. Malformed Gateway API objects fail the candidate projection and keep the previous contribution. Unexpected subscription closure publishes a degraded replacement from the last coherent cache and returns an error.

Telemetry

The unexported normalizeAccessLog maps an access record to a telemetry event with the original timestamp, a request ID or content-derived retry-stable event ID, a client IP network-destination claim, and the backend Pod UID claim. Credentials, headers, bodies, and principal names are dropped. ingestAccessLog submits the event to the shared pipeline. No access-log transport or resumable cursor is included yet, so nothing calls them outside tests.

See https://agent-shield.dev/docs/plugins/agentgateway/.

Index

Constants

View Source
const (
	// PluginID is the plugin and contribution owner ID.
	PluginID = "agentgateway"
	// DefaultControllerName is the GatewayClass controller agentgateway
	// registers.
	DefaultControllerName = "agentgateway.dev/gatewayclass-controller"
	// DefaultGatewayClass is the fallback class name used only when the
	// GatewayClass object is not observed.
	DefaultGatewayClass = "agentgateway"
)

Variables

This section is empty.

Functions

func Descriptor

func Descriptor() discovery.Descriptor

Descriptor declares the consumed Kubernetes collections. The plugin publishes no collection and introduces no identity scheme of its own.

func Project

func Project(clusterID, sourceID string, objects []*unstructured.Unstructured) (graph.Input, error)

Project projects bare objects, deriving evidence IDs from their identity and resource version. It exists for tests and offline evaluation; the plugin uses ProjectObserved with collection event IDs.

Types

type CLIConfig

type CLIConfig struct {
	ClusterID string
	SourceID  string
}

CLIConfig contains agentgateway-owned runtime options.

func (*CLIConfig) RegisterFlags

func (config *CLIConfig) RegisterFlags(flags *pflag.FlagSet) error

RegisterFlags registers agentgateway flags in the agentgateway-* namespace.

type Config

type Config struct {
	ClusterID       string
	SourceID        string
	ControllerNames []string
	GatewayClasses  []string
}

Config identifies the cluster and source shared with the Kubernetes plugin. ControllerNames and GatewayClasses select agentgateway-managed Gateways.

type Diagnostic

type Diagnostic struct {
	Resource string
	Code     string
	Message  string
}

Diagnostic records a skipped or unresolved provider reference. Diagnostics are not graph facts and never imply that a reference is safe or absent.

type ObservedObject

type ObservedObject = coherentcache.Object

ObservedObject is one cached Kubernetes observation with the event ID used as assertion evidence.

type Plugin

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

Plugin is the agentgateway semantic projection plugin.

func New

func New(config Config) (*Plugin, error)

New validates config and prepares typed clients for the shared Kubernetes collections.

func (*Plugin) Descriptor

func (p *Plugin) Descriptor() discovery.Descriptor

Descriptor implements discovery.Plugin; it returns the same value as the package-level Descriptor, which main also uses before construction.

func (*Plugin) KubernetesResources

func (p *Plugin) KubernetesResources() []kubernetesplugin.ResourceRequirement

KubernetesResources lists the GVRs the Kubernetes plugin must watch for this plugin.

func (*Plugin) Run

func (p *Plugin) Run(ctx context.Context, runtime discovery.Runtime) error

Run consumes the Kubernetes collections and replaces the semantics contribution whenever both object and coverage collections reach a new coherent generation. No other plugin consumes agentgateway output, so it marks no collection ready.

func (*Plugin) SourceID

func (p *Plugin) SourceID() string

SourceID returns the Kubernetes source ID this plugin projects for.

type ProjectionContext

type ProjectionContext struct {
	ClusterID       string
	SourceID        string
	ControllerNames []string
	GatewayClasses  []string
}

ProjectionContext configures projection. Empty ControllerNames and GatewayClasses use DefaultControllerName and DefaultGatewayClass.

type ProjectionResult

type ProjectionResult struct {
	Input       graph.Input
	Diagnostics []Diagnostic
}

ProjectionResult is the complete semantics contribution input plus diagnostics for references that could not be projected.

func ProjectObserved

func ProjectObserved(scope ProjectionContext, observations []ObservedObject) (ProjectionResult, error)

ProjectObserved deterministically projects one coherent snapshot. The result is independent of observation order.

Jump to

Keyboard shortcuts

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