Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ type Settings struct {
UseRustFormations bool `split_words:"true" default:"false"`

// EnableInferExt defines whether to enable/disable support for Gateway API inference extension.
// If enabled, EnableAgentgateway should also be set to true. Enabling inference extension without agentgateway
// is deprecated in v2.1 and will not be supported in v2.2.
EnableInferExt bool `split_words:"true"`
// InferExtAutoProvision defines whether to enable/disable the Gateway API inference extension deployer.
// Deprecated: inference extension auto-provisioning is deprecated in v2.1 and will be removed in v2.2.
InferExtAutoProvision bool `split_words:"true"`

// DefaultImageRegistry is the default image registry to use for the kgateway image.
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha1/gateway_parameters_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ type KubernetesProxyConfig struct {
// +optional
Stats *StatsConfig `json:"stats,omitempty"`

// Deprecated: `aiExtension` is deprecated in v2.1 and will be removed in v2.2.
// Prefer to use `agentgateway` instead.
//
// Configuration for the AI extension.
//
// +optional
Expand Down
4 changes: 2 additions & 2 deletions install/helm/kgateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ image:

# -- Configure the integration with the Gateway API Inference Extension project, which lets you use kgateway to route to AI inference workloads like LLMs that run locally in your Kubernetes cluster. Documentation for Inference Extension can be found here: https://kgateway.dev/docs/integrations/inference-extension/
inferenceExtension:
# -- Enable Inference Extension.
# -- Enable Inference Extension. If enabled, agentgateway.enabled should also be set to true. Enabling inference extension without agentgateway is deprecated in v2.1 and will not be supported in v2.2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, is this something we can enforce with a schema definition for the values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm maybe, would need to look into it

enabled: false
# -- Enable automatic provisioning for Inference Extension.
# -- Enable automatic provisioning for Inference Extension. Deprecated: this is deprecated in v2.1 and will be removed in v2.2.
autoProvision: false

# -- List of namespace selectors (OR'ed): each entry can use 'matchLabels' or 'matchExpressions' (AND'ed within each entry if used together). Kgateway includes the selected namespaces in config discovery. For more information, see the docs https://kgateway.dev/docs/operations/install/#namespace-discovery.
Expand Down
4 changes: 4 additions & 0 deletions internal/kgateway/controller/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,12 @@ func (c *ControllerBuilder) Build(ctx context.Context) error {
}
// Enable the inference extension deployer if set.
if globalSettings.InferExtAutoProvision {
setupLog.Info("inference extension auto-provisioning is deprecated in v2.1 and will be removed in v2.2.")
poolCfg.InferenceExt = new(deployer.InferenceExtInfo)
}
if !globalSettings.EnableAgentgateway {
setupLog.Info("using inference extension without agentgateway is deprecated in v2.1 and will not be supported in v2.2.")
}
if err := NewBaseInferencePoolController(ctx, poolCfg, &gwCfg, c.cfg.ExtraGatewayParameters); err != nil {
setupLog.Error(err, "unable to create inferencepool controller")
return err
Expand Down
3 changes: 3 additions & 0 deletions internal/kgateway/deployer/gateway_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ func (k *kGatewayParameters) getValues(gw *api.Gateway, gwParam *v1alpha1.Gatewa
statsConfig := kubeProxyConfig.GetStats()
istioContainerConfig := istioConfig.GetIstioProxyContainer()
aiExtensionConfig := kubeProxyConfig.GetAiExtension()
if aiExtensionConfig != nil {
slog.Warn("gatewayparameters spec.kube.aiExtension is deprecated in v2.1 and will be removed in v2.2. Use spec.kube.agentgateway instead.")
}
agwConfig := kubeProxyConfig.GetAgentgateway()

gateway := vals.Gateway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"github.com/kgateway-dev/kgateway/v2/internal/kgateway/wellknown"
)

// TODO: envoy-based AI gateway is deprecated in v2.1 and will be removed in v2.2. The files in this folder (and any associated tests) can be removed in v2.2.

// IR is the internal representation of an AI backend.
type IR struct {
AISecret *ir.Secret
Expand Down
2 changes: 2 additions & 0 deletions internal/kgateway/extensions2/plugins/backend/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func buildTranslateFunc(
lambdaFilters: lambdaFilters,
}
case v1alpha1.BackendTypeAI:
logger.Warn("envoy-based AI Gateway is deprecated in v2.1 and will be removed in v2.2. Use agentgateway instead.")
backendIr.AIIr = &ai.IR{}
err := ai.PreprocessAIBackend(ctx, i.Spec.AI, backendIr.AIIr)
if err != nil {
Expand Down Expand Up @@ -361,6 +362,7 @@ func (p *backendPlugin) ApplyForBackend(pCtx *ir.RouteBackendContext, in ir.Http
backendIr := pCtx.Backend.ObjIr.(*BackendIr)
switch backend.Spec.Type {
case v1alpha1.BackendTypeAI:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove newline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 can add into my next PR

err := ai.ApplyAIBackend(backendIr.AIIr, pCtx, out)
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/kgateway-dev/kgateway/v2/internal/kgateway/wellknown"
)

// TODO: envoy-based AI gateway is deprecated in v2.1 and will be removed in v2.2. This file (and any associated tests) can be removed in v2.2.

const (
contextString = `{"content":"%s","role":"%s"}`

Expand Down Expand Up @@ -112,6 +114,7 @@ func constructAI(
if policyCR.Spec.AI == nil {
return nil
}
logger.Warn("envoy-based AI Gateway is deprecated in v2.1 and will be removed in v2.2. Use agentgateway instead.")

ir := &aiPolicyIR{}
// Augment with AI secrets as needed
Expand Down
1 change: 1 addition & 0 deletions pkg/deployer/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type HelmGateway struct {
Stats *HelmStatsConfig `json:"stats,omitempty"`

// AI extension values
// Deprecated: Envoy-based AI gateway is deprecated in v2.1 and will be removed in v2.2.
AIExtension *HelmAIExtension `json:"aiExtension,omitempty"`

// agentgateway integration values
Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.