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.
Index ¶
Constants ¶
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 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 ¶
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 (*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.
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.