v1

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 14

Documentation

Overview

Package v1 contains API Schema definitions for the inference.networking.k8s.io API group.

+k8s:openapi-gen=true +kubebuilder:object:generate=true +groupName=inference.networking.k8s.io +groupGoName=Inference

Index

Constants

View Source
const (
	// InferencePoolConditionAccepted is a type of condition that indicates whether
	// the InferencePool has been accepted or rejected by a Parent, and why.
	//
	// Possible reasons for this condition to be True are:
	//
	// * "SupportedByParent"
	//
	// Possible reasons for this condition to be False are:
	//
	// * "Accepted"
	// * "HTTPRouteNotAccepted"
	//
	// Possible reasons for this condition to be Unknown are:
	//
	// * "Pending"
	//
	// Controllers MAY raise this condition with other reasons, but should
	// prefer to use the reasons listed above to improve interoperability.
	InferencePoolConditionAccepted InferencePoolConditionType = "Accepted"

	// InferencePoolReasonAccepted is a reason used with the "Accepted" condition
	// when the InferencePool is accepted by a Parent because the Parent supports
	// InferencePool as a backend.
	InferencePoolReasonAccepted InferencePoolReason = "Accepted"

	// InferencePoolReasonNotSupportedByParent is a reason used with the "Accepted"
	// condition when the InferencePool has not been accepted by a Parent because
	// the Parent does not support InferencePool as a backend.
	InferencePoolReasonNotSupportedByParent InferencePoolReason = "NotSupportedByParent"

	// InferencePoolReasonHTTPRouteNotAccepted is an optional reason used with the
	// "Accepted" condition when the InferencePool is referenced by an HTTPRoute that
	// has been rejected by the Parent. The user should inspect the status of the
	// referring HTTPRoute for the specific reason.
	InferencePoolReasonHTTPRouteNotAccepted InferencePoolReason = "HTTPRouteNotAccepted"
)
View Source
const (
	// InferencePoolConditionResolvedRefs is a type of condition that indicates whether
	// the controller was able to resolve all the object references for the InferencePool.
	//
	// Possible reasons for this condition to be True are:
	//
	// * "ResolvedRefs"
	//
	// Possible reasons for this condition to be False are:
	//
	// * "InvalidExtensionRef"
	//
	// Controllers MAY raise this condition with other reasons, but should
	// prefer to use the reasons listed above to improve interoperability.
	InferencePoolConditionResolvedRefs InferencePoolConditionType = "ResolvedRefs"

	// InferencePoolReasonResolvedRefs is a reason used with the "ResolvedRefs"
	// condition when the condition is true.
	InferencePoolReasonResolvedRefs InferencePoolReason = "ResolvedRefs"

	// InferencePoolReasonInvalidExtensionRef is a reason used with the "ResolvedRefs"
	// condition when the Extension is invalid in some way. This can include an
	// unsupported kind or API group, or a reference to a resource that cannot be found.
	InferencePoolReasonInvalidExtensionRef InferencePoolReason = "InvalidExtensionRef"
)
View Source
const (
	// InferencePoolConditionExported is a type of condition that indicates whether the
	// controller was able to export the InferencePool to the specified clusters.
	//
	// Possible reasons for this condition to be True are:
	//
	// * "Exported"
	//
	// Possible reasons for this condition to be False are:
	//
	// * "NotRequested"
	// * "NotSupported"
	//
	// Controllers MAY raise this condition with other reasons, but should
	// prefer to use the reasons listed above to improve interoperability.
	InferencePoolConditionExported InferencePoolConditionType = "Exported"

	// InferencePoolReasonExported is a reason used with the "Exported" condition when the
	// condition is true.
	InferencePoolReasonExported InferencePoolReason = "Exported"

	// InferencePoolReasonNotRequested is a reason used with the "Exported" condition when the
	// condition is false and no export was requested by the InferencePool. This indicates a
	// deliberate non-action rather than an error.
	InferencePoolReasonNotRequested InferencePoolReason = "NotRequested"

	// InferencePoolReasonNotSupported is a reason used with the "Exported" condition when the
	// condition is false and the export was requested but is not supported by the implementation.
	// Controllers should include details in the condition message.
	InferencePoolReasonNotSupported InferencePoolReason = "NotSupported"
)
View Source
const GroupName = "inference.networking.k8s.io"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Deprecated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = metav1.GroupVersion{Group: GroupName, Version: "v1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AppProtocol added in v1.4.0

type AppProtocol string

AppProtocol describes the application protocol for a port.

const (
	// AppProtocolHTTP represents the HTTP/1.1 protocol.
	// This is the default protocol if AppProtocol is unspecified.
	AppProtocolHTTP AppProtocol = "http"

	// AppProtocolH2C represents HTTP/2 over cleartext (h2c).
	// This protocol is typically used for gRPC workloads where TLS is terminated
	// at the Gateway or not used within the cluster.
	AppProtocolH2C AppProtocol = "kubernetes.io/h2c"
)

type ControllerName added in v1.1.0

type ControllerName string

ControllerName is the name of a controller that manages ParentStatus. It must be a domain prefixed path.

Valid values include:

* "example.com/bar"

Invalid values include:

* "example.com" - must include path * "foo.example.com" - must include path

+kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=253 +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`

type EndpointPickerFailureMode

type EndpointPickerFailureMode string

EndpointPickerFailureMode defines the options for how the parent handles the case when the Endpoint Picker extension is non-responsive.

+kubebuilder:validation:Enum=FailOpen;FailClose

const (
	// EndpointPickerFailOpen specifies that the parent should forward the request to an endpoint
	// of its picking when the Endpoint Picker extension fails.
	EndpointPickerFailOpen EndpointPickerFailureMode = "FailOpen"
	// EndpointPickerFailClose specifies that the parent should drop the request when the Endpoint
	// Picker extension fails.
	EndpointPickerFailClose EndpointPickerFailureMode = "FailClose"
)

type EndpointPickerRef

type EndpointPickerRef struct {
	// Group is the group of the referent API object. When unspecified, the default value
	// is "", representing the Core API group.
	//
	// +optional
	// +kubebuilder:default=""
	Group *Group `json:"group,omitempty"`

	// Kind is the Kubernetes resource kind of the referent.
	//
	// Required if the referent is ambiguous, e.g. service with multiple ports.
	//
	// Defaults to "Service" when not specified.
	//
	// ExternalName services can refer to CNAME DNS records that may live
	// outside of the cluster and as such are difficult to reason about in
	// terms of conformance. They also may not be safe to forward to (see
	// CVE-2021-25740 for more information). Implementations MUST NOT
	// support ExternalName Services.
	//
	// +optional
	// +kubebuilder:default=Service
	Kind Kind `json:"kind,omitempty"`

	// Name is the name of the referent API object.
	//
	// +required
	Name ObjectName `json:"name,omitempty"`

	// Port is the port of the Endpoint Picker extension service.
	//
	// Port is required when the referent is a Kubernetes Service. In this
	// case, the port number is the service port number, not the target port.
	// For other resources, destination port might be derived from the referent
	// resource or this field.
	//
	// +optional
	Port *Port `json:"port,omitempty"`

	// FailureMode configures how the parent handles the case when the Endpoint Picker extension
	// is non-responsive. When unspecified, defaults to "FailClose".
	//
	// +optional
	// +kubebuilder:default="FailClose"
	FailureMode EndpointPickerFailureMode `json:"failureMode,omitempty"`
}

EndpointPickerRef specifies a reference to an Endpoint Picker extension and its associated configuration. +kubebuilder:validation:XValidation:rule="self.kind != 'Service' || has(self.port)",message="port is required when kind is 'Service' or unspecified (defaults to 'Service')"

func (*EndpointPickerRef) DeepCopy

func (in *EndpointPickerRef) DeepCopy() *EndpointPickerRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointPickerRef.

func (*EndpointPickerRef) DeepCopyInto

func (in *EndpointPickerRef) DeepCopyInto(out *EndpointPickerRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Group

type Group string

Group refers to a Kubernetes Group. It must either be an empty string or a RFC 1123 subdomain.

This validation is based off of the corresponding Kubernetes validation: https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208

Valid values include:

* "" - empty string implies core Kubernetes API group * "gateway.networking.k8s.io" * "foo.example.com"

Invalid values include:

* "example.com/bar" - "/" is an invalid character

+kubebuilder:validation:MinLength=0 +kubebuilder:validation:MaxLength=253 +kubebuilder:validation:Pattern=`^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`

type InferencePool

type InferencePool struct {
	metav1.TypeMeta `json:",inline"`

	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired state of the InferencePool.
	//
	// +required
	Spec InferencePoolSpec `json:"spec,omitzero"`

	// Status defines the observed state of the InferencePool.
	//
	// +optional
	//nolint:kubeapilinter // status should not be a pointer.
	Status InferencePoolStatus `json:"status,omitempty"`
}

InferencePool is the Schema for the InferencePools API.

+kubebuilder:object:root=true TODO: change the annotation once it gets officially approved +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/1173" +kubebuilder:resource:shortName=infpool +kubebuilder:subresource:status +kubebuilder:storageversion +genclient

func (*InferencePool) DeepCopy

func (in *InferencePool) DeepCopy() *InferencePool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePool.

func (*InferencePool) DeepCopyInto

func (in *InferencePool) DeepCopyInto(out *InferencePool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InferencePool) DeepCopyObject

func (in *InferencePool) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InferencePoolConditionType

type InferencePoolConditionType string

InferencePoolConditionType is a type of status condition for the InferencePool.

type InferencePoolList

type InferencePoolList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []InferencePool `json:"items"`
}

InferencePoolList contains a list of InferencePools.

+kubebuilder:object:root=true

func (*InferencePoolList) DeepCopy

func (in *InferencePoolList) DeepCopy() *InferencePoolList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolList.

func (*InferencePoolList) DeepCopyInto

func (in *InferencePoolList) DeepCopyInto(out *InferencePoolList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InferencePoolList) DeepCopyObject

func (in *InferencePoolList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InferencePoolReason

type InferencePoolReason string

InferencePoolReason is the reason for a type of InferencePool status condition.

type InferencePoolSpec

type InferencePoolSpec struct {
	// Selector determines which Pods are members of this inference pool.
	// It matches Pods by their labels only within the same namespace; cross-namespace
	// selection is not supported.
	//
	// The structure of this LabelSelector is intentionally simple to be compatible
	// with Kubernetes Service selectors, as some implementations may translate
	// this configuration into a Service resource.
	//
	// +required
	Selector LabelSelector `json:"selector,omitzero"`

	// TargetPorts defines a list of ports that are exposed by this InferencePool.
	// Every port will be treated as a distinctive endpoint by EPP,
	// addressable as a 'podIP:portNumber' combination.
	//
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=8
	// +kubebuilder:validation:XValidation:message="port number must be unique",rule="self.all(p1, self.exists_one(p2, p1.number==p2.number))"
	// +listType=atomic
	// +required
	TargetPorts []Port `json:"targetPorts,omitempty"`

	// AppProtocol describes the application protocol for all the target ports.
	//
	// If unspecified, the protocol defaults to HTTP/1.1.
	//
	// Supported values include:
	// * "http": HTTP/1.1. This is the default.
	// * "kubernetes.io/h2c": HTTP/2 over cleartext.
	//
	// +kubebuilder:validation:Enum=http;"kubernetes.io/h2c"
	// +kubebuilder:default="http"
	// +optional
	AppProtocol AppProtocol `json:"appProtocol,omitempty"`

	// EndpointPickerRef is a reference to the Endpoint Picker extension and its
	// associated configuration.
	//
	// +required
	EndpointPickerRef EndpointPickerRef `json:"endpointPickerRef,omitzero"`
}

InferencePoolSpec defines the desired state of the InferencePool.

func (*InferencePoolSpec) DeepCopy

func (in *InferencePoolSpec) DeepCopy() *InferencePoolSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolSpec.

func (*InferencePoolSpec) DeepCopyInto

func (in *InferencePoolSpec) DeepCopyInto(out *InferencePoolSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InferencePoolStatus

type InferencePoolStatus struct {
	// Parents is a list of parent resources, typically Gateways, that are associated with
	// the InferencePool, and the status of the InferencePool with respect to each parent.
	//
	// A controller that manages the InferencePool, must add an entry for each parent it manages
	// and remove the parent entry when the controller no longer considers the InferencePool to
	// be associated with that parent.
	//
	// A maximum of 32 parents will be represented in this list. When the list is empty,
	// it indicates that the InferencePool is not associated with any parents.
	//
	// +kubebuilder:validation:MaxItems=32
	// +optional
	// +listType=atomic
	Parents []ParentStatus `json:"parents,omitempty"`
}

InferencePoolStatus defines the observed state of the InferencePool.

func (*InferencePoolStatus) DeepCopy

func (in *InferencePoolStatus) DeepCopy() *InferencePoolStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InferencePoolStatus.

func (*InferencePoolStatus) DeepCopyInto

func (in *InferencePoolStatus) DeepCopyInto(out *InferencePoolStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Kind

type Kind string

Kind refers to a Kubernetes Kind.

Valid values include:

* "Service" * "HTTPRoute"

Invalid values include:

* "invalid/kind" - "/" is an invalid character

+kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=63 +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$`

type LabelKey

type LabelKey string

LabelKey was originally copied from: https://github.com/kubernetes-sigs/gateway-api/blob/99a3934c6bc1ce0874f3a4c5f20cafd8977ffcb4/apis/v1/shared_types.go#L694-L731 Duplicated as to not take an unexpected dependency on gw's API.

LabelKey is the key of a label. This is used for validation of maps. This matches the Kubernetes "qualified name" validation that is used for labels. Labels are case sensitive, so: my-label and My-Label are considered distinct.

Valid values include:

* example * example.com * example.com/path * example.com/path.html

Invalid values include:

* example~ - "~" is an invalid character * example.com. - can not start or end with "."

+kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=253 +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9]$`

type LabelSelector

type LabelSelector struct {
	// MatchLabels contains a set of required {key,value} pairs.
	// An object must match every label in this map to be selected.
	// The matching logic is an AND operation on all entries.
	//
	// +required
	// +kubebuilder:validation:MinProperties=1
	// +kubebuilder:validation:MaxProperties=64
	MatchLabels map[LabelKey]LabelValue `json:"matchLabels,omitempty"`
}

LabelSelector defines a query for resources based on their labels. This simplified version uses only the matchLabels field.

func (*LabelSelector) DeepCopy

func (in *LabelSelector) DeepCopy() *LabelSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelSelector.

func (*LabelSelector) DeepCopyInto

func (in *LabelSelector) DeepCopyInto(out *LabelSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LabelValue

type LabelValue string

LabelValue is the value of a label. This is used for validation of maps. This matches the Kubernetes label validation rules: * must be 63 characters or less (can be empty), * unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]), * could contain dashes (-), underscores (_), dots (.), and alphanumerics between.

Valid values include:

* MyValue * my.name * 123-my-value

+kubebuilder:validation:MinLength=0 +kubebuilder:validation:MaxLength=63 +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$`

type Namespace

type Namespace string

Namespace refers to a Kubernetes namespace. It must be a RFC 1123 label.

This validation is based off of the corresponding Kubernetes validation: https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L187

This is used for Namespace name validation here: https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/api/validation/generic.go#L63

Valid values include:

* "example"

Invalid values include:

* "example.com" - "." is an invalid character

+kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=63

type ObjectName

type ObjectName string

ObjectName refers to the name of a Kubernetes object. Object names can have a variety of forms, including RFC 1123 subdomains, RFC 1123 labels, or RFC 1035 labels.

+kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=253

type ParentReference

type ParentReference struct {
	// Group is the group of the referent API object. When unspecified, the referent is assumed
	// to be in the "gateway.networking.k8s.io" API group.
	//
	// +optional
	// +kubebuilder:default="gateway.networking.k8s.io"
	Group *Group `json:"group,omitempty"`

	// Kind is the kind of the referent API object. When unspecified, the referent is assumed
	// to be a "Gateway" kind.
	//
	// +optional
	// +kubebuilder:default=Gateway
	Kind Kind `json:"kind,omitempty"`

	// Name is the name of the referent API object.
	//
	// +required
	Name ObjectName `json:"name,omitempty"`

	// Namespace is the namespace of the referenced object. When unspecified, the local
	// namespace is inferred.
	//
	// Note that when a namespace different than the local namespace is specified,
	// a ReferenceGrant object is required in the referent namespace to allow that
	// namespace's owner to accept the reference. See the ReferenceGrant
	// documentation for details: https://gateway-api.sigs.k8s.io/api-types/referencegrant/
	//
	// +optional
	Namespace Namespace `json:"namespace,omitempty"`
}

ParentReference identifies an API object. It is used to associate the InferencePool with a parent resource, such as a Gateway.

func (*ParentReference) DeepCopy

func (in *ParentReference) DeepCopy() *ParentReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentReference.

func (*ParentReference) DeepCopyInto

func (in *ParentReference) DeepCopyInto(out *ParentReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParentStatus

type ParentStatus struct {
	// Conditions is a list of status conditions that provide information about the observed
	// state of the InferencePool. This field is required to be set by the controller that
	// manages the InferencePool.
	//
	// Supported condition types are:
	//
	// * "Accepted"
	// * "ResolvedRefs"
	//
	// +optional
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:MaxItems=8
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// ParentRef is used to identify the parent resource that this status
	// is associated with. It is used to match the InferencePool with the parent
	// resource, such as a Gateway.
	//
	// +required
	ParentRef ParentReference `json:"parentRef,omitzero"`

	// ControllerName is a domain/path string that indicates the name of the controller that
	// wrote this status. This corresponds with the GatewayClass controllerName field when the
	// parentRef references a Gateway kind.
	//
	// Example: "example.net/gateway-controller".
	//
	// The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names:
	//
	//  https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	//
	// Controllers MAY populate this field when writing status. When populating this field, controllers
	// should ensure that entries to status populated with their ControllerName are cleaned up when they
	// are no longer necessary.
	//
	// +optional
	ControllerName ControllerName `json:"controllerName,omitempty"`
}

ParentStatus defines the observed state of InferencePool from a Parent, i.e. Gateway.

func (*ParentStatus) DeepCopy

func (in *ParentStatus) DeepCopy() *ParentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentStatus.

func (*ParentStatus) DeepCopyInto

func (in *ParentStatus) DeepCopyInto(out *ParentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Port

type Port struct {
	// Number defines the port number to access the selected model server Pods.
	// The number must be in the range 1 to 65535.
	//
	// +required
	Number PortNumber `json:"number,omitempty"`
}

Port defines the network port that will be exposed by this InferencePool.

func (*Port) DeepCopy

func (in *Port) DeepCopy() *Port

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Port.

func (*Port) DeepCopyInto

func (in *Port) DeepCopyInto(out *Port)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PortNumber

type PortNumber int32

PortNumber defines a network port.

+kubebuilder:validation:Minimum=1 +kubebuilder:validation:Maximum=65535

Jump to

Keyboard shortcuts

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