diff --git a/api/apps/v1alpha1/common_types.go b/api/apps/v1alpha1/common_types.go index 01382b7fb..0bc245162 100644 --- a/api/apps/v1alpha1/common_types.go +++ b/api/apps/v1alpha1/common_types.go @@ -45,8 +45,10 @@ const ( // Expose defines attributes to expose the service. type Expose struct { Service Service `json:"service,omitempty"` - // Deprecated: Use .spec.router instead. + // Deprecated: Use .spec.expose.router instead. Ingress Ingress `json:"ingress,omitempty"` + + Router Router `json:"router,omitempty"` } // +kubebuilder:validation:XValidation:rule="!(has(self.gateway) && has(self.ingress))", message="ingress and gateway cannot be specified together" @@ -89,12 +91,18 @@ type Gateway struct { // +kubebuilder:default:=true // HTTPRoutesEnabled is a flag to enable HTTPRoutes for the created gateway. HTTPRoutesEnabled bool `json:"httpRoutesEnabled,omitempty"` + + // +kubebuilder:default:=false + // GRPCRoutesEnabled is a flag to enable GRPCRoutes for the created gateway. + GRPCRoutesEnabled bool `json:"grpcRoutesEnabled,omitempty"` } // DEPRECATED ExposeV1 defines attributes to expose the service. type ExposeV1 struct { Service Service `json:"service,omitempty"` Ingress IngressV1 `json:"ingress,omitempty"` + // +kubebuilder:validation:XValidation:rule="!(has(self.gateway) && self.gateway.grpcRoutesEnabled)", message="unsupported field: spec.expose.router.gateway.grpcRoutesEnabled" + Router Router `json:"router,omitempty"` } // Service defines attributes to create a service. @@ -123,7 +131,7 @@ type Service struct { Annotations map[string]string `json:"annotations,omitempty"` } -// Deprecated: Use .spec.router.ingress instead. +// Deprecated: Use .spec.expose.router.ingress instead. // IngressV1 defines attributes for ingress // +kubebuilder:validation:XValidation:rule="(has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled", message="spec cannot be nil when ingress is enabled" type IngressV1 struct { @@ -276,6 +284,38 @@ func (r *Router) GenerateGatewayHTTPRouteSpec(namespace, name string, port int32 } } +func (r *Router) GenerateGatewayGRPCRouteSpec(namespace, name string, port int32) gatewayv1.GRPCRouteSpec { + if r.Gateway == nil || !r.Gateway.GRPCRoutesEnabled { + return gatewayv1.GRPCRouteSpec{} + } + + return gatewayv1.GRPCRouteSpec{ + CommonRouteSpec: gatewayv1.CommonRouteSpec{ + ParentRefs: []gatewayv1.ParentReference{ + { + Name: gatewayv1.ObjectName(r.Gateway.Name), + Namespace: ptr.To(gatewayv1.Namespace(r.Gateway.Namespace)), + }, + }, + }, + Hostnames: []gatewayv1.Hostname{gatewayv1.Hostname(r.getHostname(namespace, name))}, + Rules: []gatewayv1.GRPCRouteRule{ + { + BackendRefs: []gatewayv1.GRPCBackendRef{ + { + BackendRef: gatewayv1.BackendRef{ + BackendObjectReference: gatewayv1.BackendObjectReference{ + Name: gatewayv1.ObjectName(name), + Port: ptr.To(gatewayv1.PortNumber(port)), + }, + }, + }, + }, + }, + }, + } +} + func (r *Router) getHostname(namespace, name string) string { return fmt.Sprintf("%s.%s.%s", name, namespace, r.HostDomainName) } diff --git a/api/apps/v1alpha1/nemo_customizer_types.go b/api/apps/v1alpha1/nemo_customizer_types.go index abeea7579..1d581b08e 100644 --- a/api/apps/v1alpha1/nemo_customizer_types.go +++ b/api/apps/v1alpha1/nemo_customizer_types.go @@ -67,7 +67,7 @@ const ( ) // NemoCustomizerSpec defines the desired state of NemoCustomizer. -// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress." +// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress." // +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true" type NemoCustomizerSpec struct { Image Image `json:"image"` @@ -85,7 +85,6 @@ type NemoCustomizerSpec struct { // +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort" // +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort" Expose ExposeV1 `json:"expose,omitempty"` - Router Router `json:"router,omitempty"` Scale Autoscaling `json:"scale,omitempty"` Metrics Metrics `json:"metrics,omitempty"` @@ -643,7 +642,7 @@ func (n *NemoCustomizer) IsAutoScalingEnabled() bool { // IsIngressEnabled returns true if ingress is enabled for NemoCustomizer deployment. func (n *NemoCustomizer) IsIngressEnabled() bool { - return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") || + return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec } @@ -653,15 +652,15 @@ func (n *NemoCustomizer) GetIngressSpec() networkingv1.IngressSpec { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName()) } - return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) + return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) } func (n *NemoCustomizer) IsHTTPRouteEnabled() bool { - return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled } func (n *NemoCustomizer) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec { - return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) + return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) } // IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoCustomizer deployment. @@ -1056,8 +1055,8 @@ func (n *NemoCustomizer) GetIngressAnnotations() map[string]string { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return utils.MergeMaps(NemoCustomizerAnnotations, n.Spec.Expose.Ingress.Annotations) } - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(NemoCustomizerAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(NemoCustomizerAnnotations, n.Spec.Expose.Router.Annotations) } return NemoCustomizerAnnotations } @@ -1065,8 +1064,8 @@ func (n *NemoCustomizer) GetIngressAnnotations() map[string]string { func (n *NemoCustomizer) GetHTTPRouteAnnotations() map[string]string { annotations := n.GetNemoCustomizerAnnotations() - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(annotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations) } return annotations } diff --git a/api/apps/v1alpha1/nemo_datastore_types.go b/api/apps/v1alpha1/nemo_datastore_types.go index eb5d1ef50..aa30242a6 100644 --- a/api/apps/v1alpha1/nemo_datastore_types.go +++ b/api/apps/v1alpha1/nemo_datastore_types.go @@ -58,7 +58,7 @@ const ( ) // NemoDatastoreSpec defines the desired state of NemoDatastore. -// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress." +// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress." // +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true" type NemoDatastoreSpec struct { Image Image `json:"image"` @@ -76,7 +76,6 @@ type NemoDatastoreSpec struct { // +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort" // +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort" Expose ExposeV1 `json:"expose,omitempty"` - Router Router `json:"router,omitempty"` Scale Autoscaling `json:"scale,omitempty"` Metrics Metrics `json:"metrics,omitempty"` // +kubebuilder:validation:Minimum=1 @@ -769,12 +768,12 @@ func (n *NemoDatastore) IsAutoScalingEnabled() bool { // IsIngressEnabled returns true if ingress is enabled for NemoDatastore deployment. func (n *NemoDatastore) IsIngressEnabled() bool { - return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") || + return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec } func (n *NemoDatastore) IsHTTPRouteEnabled() bool { - return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled } // GetIngressSpec returns the Ingress spec NemoDatastore deployment. @@ -783,11 +782,11 @@ func (n *NemoDatastore) GetIngressSpec() networkingv1.IngressSpec { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName()) } - return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) + return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) } func (n *NemoDatastore) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec { - return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) + return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) } // IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoDatastore deployment. @@ -1107,8 +1106,8 @@ func (n *NemoDatastore) GetIngressAnnotations() map[string]string { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return utils.MergeMaps(NemoDatastoreAnnotations, n.Spec.Expose.Ingress.Annotations) } - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(NemoDatastoreAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(NemoDatastoreAnnotations, n.Spec.Expose.Router.Annotations) } return NemoDatastoreAnnotations } @@ -1116,8 +1115,8 @@ func (n *NemoDatastore) GetIngressAnnotations() map[string]string { func (n *NemoDatastore) GetHTTPRouteAnnotations() map[string]string { annotations := n.GetNemoDatastoreAnnotations() - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(annotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations) } return annotations } diff --git a/api/apps/v1alpha1/nemo_entitystore_types.go b/api/apps/v1alpha1/nemo_entitystore_types.go index 7d8e09dde..d8eabfdac 100644 --- a/api/apps/v1alpha1/nemo_entitystore_types.go +++ b/api/apps/v1alpha1/nemo_entitystore_types.go @@ -59,7 +59,7 @@ const ( ) // NemoEntitystoreSpec defines the desired state of NemoEntitystore. -// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress." +// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress." // +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true" type NemoEntitystoreSpec struct { Image Image `json:"image"` @@ -77,7 +77,6 @@ type NemoEntitystoreSpec struct { // +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort" // +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort" Expose ExposeV1 `json:"expose,omitempty"` - Router Router `json:"router,omitempty"` Scale Autoscaling `json:"scale,omitempty"` Metrics Metrics `json:"metrics,omitempty"` // +kubebuilder:validation:Minimum=1 @@ -396,7 +395,7 @@ func (n *NemoEntitystore) IsAutoScalingEnabled() bool { // IsIngressEnabled returns true if ingress is enabled for NemoEntitystore deployment. func (n *NemoEntitystore) IsIngressEnabled() bool { - return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") || + return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec } @@ -406,15 +405,15 @@ func (n *NemoEntitystore) GetIngressSpec() networkingv1.IngressSpec { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName()) } - return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) + return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) } func (n *NemoEntitystore) IsHTTPRouteEnabled() bool { - return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled } func (n *NemoEntitystore) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec { - return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) + return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) } // IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoEntitystore deployment. @@ -741,8 +740,8 @@ func (n *NemoEntitystore) GetIngressAnnotations() map[string]string { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return utils.MergeMaps(NemoEntitystoreAnnotations, n.Spec.Expose.Ingress.Annotations) } - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(NemoEntitystoreAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(NemoEntitystoreAnnotations, n.Spec.Expose.Router.Annotations) } return NemoEntitystoreAnnotations } @@ -750,8 +749,8 @@ func (n *NemoEntitystore) GetIngressAnnotations() map[string]string { func (n *NemoEntitystore) GetHTTPRouteAnnotations() map[string]string { annotations := n.GetNemoEntitystoreAnnotations() - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(annotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations) } return annotations } diff --git a/api/apps/v1alpha1/nemo_evaluator_types.go b/api/apps/v1alpha1/nemo_evaluator_types.go index 1c62ed110..2d271e3e4 100644 --- a/api/apps/v1alpha1/nemo_evaluator_types.go +++ b/api/apps/v1alpha1/nemo_evaluator_types.go @@ -57,7 +57,7 @@ const ( ) // NemoEvaluatorSpec defines the desired state of NemoEvaluator. -// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress." +// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress." // +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true" type NemoEvaluatorSpec struct { Image Image `json:"image"` @@ -76,7 +76,6 @@ type NemoEvaluatorSpec struct { // +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort" // +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort" Expose ExposeV1 `json:"expose,omitempty"` - Router Router `json:"router,omitempty"` Scale Autoscaling `json:"scale,omitempty"` Metrics Metrics `json:"metrics,omitempty"` // +kubebuilder:validation:Minimum=1 @@ -586,12 +585,12 @@ func (n *NemoEvaluator) IsAutoScalingEnabled() bool { // IsIngressEnabled returns true if ingress is enabled for NemoEvaluator deployment. func (n *NemoEvaluator) IsIngressEnabled() bool { - return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") || + return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec } func (n *NemoEvaluator) IsHTTPRouteEnabled() bool { - return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled } // GetIngressSpec returns the Ingress spec NemoEvaluator deployment. @@ -600,11 +599,11 @@ func (n *NemoEvaluator) GetIngressSpec() networkingv1.IngressSpec { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName()) } - return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) + return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) } func (n *NemoEvaluator) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec { - return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) + return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) } // IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoEvaluator deployment. @@ -929,8 +928,8 @@ func (n *NemoEvaluator) GetIngressAnnotations() map[string]string { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return utils.MergeMaps(NemoEvaluatorAnnotations, n.Spec.Expose.Ingress.Annotations) } - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(NemoEvaluatorAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(NemoEvaluatorAnnotations, n.Spec.Expose.Router.Annotations) } return NemoEvaluatorAnnotations } @@ -938,8 +937,8 @@ func (n *NemoEvaluator) GetIngressAnnotations() map[string]string { func (n *NemoEvaluator) GetHTTPRouteAnnotations() map[string]string { annotations := n.GetNemoEvaluatorAnnotations() - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(annotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations) } return annotations } diff --git a/api/apps/v1alpha1/nemo_guardrails_types.go b/api/apps/v1alpha1/nemo_guardrails_types.go index 1a8cea8dc..1d72f5cf0 100644 --- a/api/apps/v1alpha1/nemo_guardrails_types.go +++ b/api/apps/v1alpha1/nemo_guardrails_types.go @@ -60,7 +60,7 @@ const ( ) // NemoGuardrailSpec defines the desired state of NemoGuardrail. -// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress." +// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress." // +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true" type NemoGuardrailSpec struct { Image Image `json:"image"` @@ -81,7 +81,6 @@ type NemoGuardrailSpec struct { // +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort" // +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort" Expose ExposeV1 `json:"expose,omitempty"` - Router Router `json:"router,omitempty"` Scale Autoscaling `json:"scale,omitempty"` Metrics Metrics `json:"metrics,omitempty"` // +kubebuilder:validation:Minimum=1 @@ -603,7 +602,7 @@ func (n *NemoGuardrail) IsAutoScalingEnabled() bool { // IsIngressEnabled returns true if ingress is enabled for NemoGuardrail deployment. func (n *NemoGuardrail) IsIngressEnabled() bool { - return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") || + return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec } @@ -613,15 +612,15 @@ func (n *NemoGuardrail) GetIngressSpec() networkingv1.IngressSpec { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName()) } - return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) + return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) } func (n *NemoGuardrail) IsHTTPRouteEnabled() bool { - return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled } func (n *NemoGuardrail) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec { - return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) + return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) } // IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoGuardrail deployment. @@ -937,8 +936,8 @@ func (n *NemoGuardrail) GetServiceMonitorParams() *rendertypes.ServiceMonitorPar func (n *NemoGuardrail) GetHTTPRouteAnnotations() map[string]string { annotations := n.GetNemoGuardrailAnnotations() - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(annotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations) } return annotations } @@ -950,8 +949,8 @@ func (n *NemoGuardrail) GetIngressAnnotations() map[string]string { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return utils.MergeMaps(NemoGuardrailAnnotations, n.Spec.Expose.Ingress.Annotations) } - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(NemoGuardrailAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(NemoGuardrailAnnotations, n.Spec.Expose.Router.Annotations) } return NemoGuardrailAnnotations } diff --git a/api/apps/v1alpha1/nimservice_types.go b/api/apps/v1alpha1/nimservice_types.go index 4fac4a2b9..13962b355 100644 --- a/api/apps/v1alpha1/nimservice_types.go +++ b/api/apps/v1alpha1/nimservice_types.go @@ -92,7 +92,7 @@ const ( // NIMServiceSpec defines the desired state of NIMService. // +kubebuilder:validation:XValidation:rule="!(has(self.multiNode) && has(self.scale) && has(self.scale.enabled) && self.scale.enabled)", message="autoScaling must be nil or disabled when multiNode is set" // +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true" -// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress." +// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress." type NIMServiceSpec struct { Image Image `json:"image"` Command []string `json:"command,omitempty"` @@ -130,7 +130,6 @@ type NIMServiceSpec struct { RuntimeClassName string `json:"runtimeClassName,omitempty"` Proxy *ProxySpec `json:"proxy,omitempty"` MultiNode *NimServiceMultiNodeConfig `json:"multiNode,omitempty"` - Router Router `json:"router,omitempty"` // InferencePlatform specifies the inference platform to use for this NIMService. // Valid values are "standalone" (default) and "kserve". // +kubebuilder:validation:Enum=standalone;kserve @@ -968,7 +967,7 @@ func (n *NIMService) IsAutoScalingEnabled() bool { // IsIngressEnabled returns true if ingress is enabled for NIMService deployment. func (n *NIMService) IsIngressEnabled() bool { - return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) + return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") || (n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) } // GetIngressSpec returns the Ingress spec NIMService deployment. @@ -977,11 +976,11 @@ func (n *NIMService) GetIngressSpec() networkingv1.IngressSpec { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return n.Spec.Expose.GenerateIngressSpec(n.GetName()) } - return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) + return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName()) } func (n *NIMService) IsHTTPRouteEnabled() bool { - return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled } // IsHFModel returns true if the NIMService is using an HF model. @@ -996,7 +995,18 @@ func (n *NIMService) IsHFModel() bool { } func (n *NIMService) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec { - return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) + return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort()) +} + +func (n *NIMService) IsGRPCRouteEnabled() bool { + return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.GRPCRoutesEnabled +} + +func (n *NIMService) GetGRPCRouteSpec() gatewayv1.GRPCRouteSpec { + if n.Spec.Expose.Service.GRPCPort == nil { + return gatewayv1.GRPCRouteSpec{} + } + return n.Spec.Expose.Router.GenerateGatewayGRPCRouteSpec(n.GetNamespace(), n.GetName(), *n.Spec.Expose.Service.GRPCPort) } // IsServiceMonitorEnabled returns true if servicemonitor is enabled for NIMService deployment. @@ -1387,6 +1397,17 @@ func (n *NIMService) GetHTTPRouteParams() *rendertypes.HTTPRouteParams { return params } +func (n *NIMService) GetGRPCRouteParams() *rendertypes.GRPCRouteParams { + params := &rendertypes.GRPCRouteParams{} + params.Enabled = n.IsGRPCRouteEnabled() + params.Name = n.GetName() + params.Namespace = n.GetNamespace() + params.Labels = n.GetServiceLabels() + params.Annotations = n.GetRouterAnnotations() + params.Spec = n.GetGRPCRouteSpec() + return params +} + // GetRoleParams returns params to render Role from templates. func (n *NIMService) GetRoleParams() *rendertypes.RoleParams { params := &rendertypes.RoleParams{} @@ -1511,8 +1532,8 @@ func (n *NIMService) GetServiceMonitorParams() *rendertypes.ServiceMonitorParams func (n *NIMService) GetRouterAnnotations() map[string]string { nimServiceAnnotations := n.GetNIMServiceAnnotations() - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(nimServiceAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(nimServiceAnnotations, n.Spec.Expose.Router.Annotations) } return nimServiceAnnotations } @@ -1524,8 +1545,8 @@ func (n *NIMService) GetIngressAnnotations() map[string]string { if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled { return utils.MergeMaps(nimServiceAnnotations, n.Spec.Expose.Ingress.Annotations) } - if n.Spec.Router.Annotations != nil { - return utils.MergeMaps(nimServiceAnnotations, n.Spec.Router.Annotations) + if n.Spec.Expose.Router.Annotations != nil { + return utils.MergeMaps(nimServiceAnnotations, n.Spec.Expose.Router.Annotations) } return nimServiceAnnotations } diff --git a/api/apps/v1alpha1/zz_generated.deepcopy.go b/api/apps/v1alpha1/zz_generated.deepcopy.go index 86a918693..aeda69b75 100644 --- a/api/apps/v1alpha1/zz_generated.deepcopy.go +++ b/api/apps/v1alpha1/zz_generated.deepcopy.go @@ -473,6 +473,7 @@ func (in *Expose) DeepCopyInto(out *Expose) { *out = *in in.Service.DeepCopyInto(&out.Service) in.Ingress.DeepCopyInto(&out.Ingress) + in.Router.DeepCopyInto(&out.Router) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Expose. @@ -490,6 +491,7 @@ func (in *ExposeV1) DeepCopyInto(out *ExposeV1) { *out = *in in.Service.DeepCopyInto(&out.Service) in.Ingress.DeepCopyInto(&out.Ingress) + in.Router.DeepCopyInto(&out.Router) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExposeV1. @@ -1593,7 +1595,6 @@ func (in *NIMServiceSpec) DeepCopyInto(out *NIMServiceSpec) { *out = new(NimServiceMultiNodeConfig) (*in).DeepCopyInto(*out) } - in.Router.DeepCopyInto(&out.Router) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NIMServiceSpec. @@ -1831,7 +1832,6 @@ func (in *NemoCustomizerSpec) DeepCopyInto(out *NemoCustomizerSpec) { (*in).DeepCopyInto(*out) } in.Expose.DeepCopyInto(&out.Expose) - in.Router.DeepCopyInto(&out.Router) in.Scale.DeepCopyInto(&out.Scale) in.Metrics.DeepCopyInto(&out.Metrics) if in.Replicas != nil { @@ -2050,7 +2050,6 @@ func (in *NemoDatastoreSpec) DeepCopyInto(out *NemoDatastoreSpec) { (*in).DeepCopyInto(*out) } in.Expose.DeepCopyInto(&out.Expose) - in.Router.DeepCopyInto(&out.Router) in.Scale.DeepCopyInto(&out.Scale) in.Metrics.DeepCopyInto(&out.Metrics) if in.Replicas != nil { @@ -2253,7 +2252,6 @@ func (in *NemoEntitystoreSpec) DeepCopyInto(out *NemoEntitystoreSpec) { (*in).DeepCopyInto(*out) } in.Expose.DeepCopyInto(&out.Expose) - in.Router.DeepCopyInto(&out.Router) in.Scale.DeepCopyInto(&out.Scale) in.Metrics.DeepCopyInto(&out.Metrics) if in.Replicas != nil { @@ -2435,7 +2433,6 @@ func (in *NemoEvaluatorSpec) DeepCopyInto(out *NemoEvaluatorSpec) { (*in).DeepCopyInto(*out) } in.Expose.DeepCopyInto(&out.Expose) - in.Router.DeepCopyInto(&out.Router) in.Scale.DeepCopyInto(&out.Scale) in.Metrics.DeepCopyInto(&out.Metrics) if in.Replicas != nil { @@ -2633,7 +2630,6 @@ func (in *NemoGuardrailSpec) DeepCopyInto(out *NemoGuardrailSpec) { (*in).DeepCopyInto(*out) } in.Expose.DeepCopyInto(&out.Expose) - in.Router.DeepCopyInto(&out.Router) in.Scale.DeepCopyInto(&out.Scale) in.Metrics.DeepCopyInto(&out.Metrics) if in.Replicas != nil { diff --git a/bundle/manifests/apps.nvidia.com_nemocustomizers.yaml b/bundle/manifests/apps.nvidia.com_nemocustomizers.yaml index 6d5ad2ec7..ec765f6ba 100644 --- a/bundle/manifests/apps.nvidia.com_nemocustomizers.yaml +++ b/bundle/manifests/apps.nvidia.com_nemocustomizers.yaml @@ -1171,7 +1171,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1210,6 +1210,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -2113,63 +2178,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -4659,9 +4667,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/bundle/manifests/apps.nvidia.com_nemodatastores.yaml b/bundle/manifests/apps.nvidia.com_nemodatastores.yaml index e0cb2e7eb..9b466a4ce 100644 --- a/bundle/manifests/apps.nvidia.com_nemodatastores.yaml +++ b/bundle/manifests/apps.nvidia.com_nemodatastores.yaml @@ -1151,7 +1151,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1190,6 +1190,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1792,63 +1857,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2566,9 +2574,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/bundle/manifests/apps.nvidia.com_nemoentitystores.yaml b/bundle/manifests/apps.nvidia.com_nemoentitystores.yaml index f3a049484..432206f5a 100644 --- a/bundle/manifests/apps.nvidia.com_nemoentitystores.yaml +++ b/bundle/manifests/apps.nvidia.com_nemoentitystores.yaml @@ -1163,7 +1163,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1202,6 +1202,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1722,63 +1787,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2475,9 +2483,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/bundle/manifests/apps.nvidia.com_nemoevaluators.yaml b/bundle/manifests/apps.nvidia.com_nemoevaluators.yaml index 5b4686a58..c6411de6f 100644 --- a/bundle/manifests/apps.nvidia.com_nemoevaluators.yaml +++ b/bundle/manifests/apps.nvidia.com_nemoevaluators.yaml @@ -1228,7 +1228,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1267,6 +1267,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1858,63 +1923,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2625,9 +2633,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/bundle/manifests/apps.nvidia.com_nemoguardrails.yaml b/bundle/manifests/apps.nvidia.com_nemoguardrails.yaml index f818cfec1..a106f6bf8 100644 --- a/bundle/manifests/apps.nvidia.com_nemoguardrails.yaml +++ b/bundle/manifests/apps.nvidia.com_nemoguardrails.yaml @@ -1203,7 +1203,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1242,6 +1242,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1846,63 +1911,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2597,9 +2605,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/bundle/manifests/apps.nvidia.com_nimpipelines.yaml b/bundle/manifests/apps.nvidia.com_nimpipelines.yaml index 688af0642..aa0a2b4ff 100644 --- a/bundle/manifests/apps.nvidia.com_nimpipelines.yaml +++ b/bundle/manifests/apps.nvidia.com_nimpipelines.yaml @@ -1383,7 +1383,7 @@ spec: description: Expose defines attributes to expose the service. properties: ingress: - description: 'Deprecated: Use .spec.router instead.' + description: 'Deprecated: Use .spec.expose.router instead.' properties: annotations: additionalProperties: @@ -1672,6 +1672,70 @@ spec: x-kubernetes-list-type: atomic type: object type: object + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for + ingress class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the + created HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to + enable GRPCRoutes for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to + enable HTTPRoutes for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to + use for the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class + to use for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the + secret containing the TLS certificate and + key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. @@ -2590,64 +2654,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress - class or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created - HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable - HTTPRoutes for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use - for the created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to - use for the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret - containing the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClassName: type: string scale: @@ -3614,9 +3620,10 @@ spec: && has(self.replicas))' - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please - do not set .spec.router.ingress. + do not set .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) + && has(self.expose.router.ingress))' type: object type: array type: object diff --git a/bundle/manifests/apps.nvidia.com_nimservices.yaml b/bundle/manifests/apps.nvidia.com_nimservices.yaml index 16db395d7..1111c6171 100644 --- a/bundle/manifests/apps.nvidia.com_nimservices.yaml +++ b/bundle/manifests/apps.nvidia.com_nimservices.yaml @@ -1318,7 +1318,7 @@ spec: description: Expose defines attributes to expose the service. properties: ingress: - description: 'Deprecated: Use .spec.router instead.' + description: 'Deprecated: Use .spec.expose.router instead.' properties: annotations: additionalProperties: @@ -1599,6 +1599,69 @@ spec: x-kubernetes-list-type: atomic type: object type: object + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -2501,63 +2564,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClassName: type: string scale: @@ -3503,9 +3509,9 @@ spec: && has(self.replicas))' - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' status: description: NIMServiceStatus defines the observed state of NIMService. properties: diff --git a/bundle/manifests/k8s-nim-operator.clusterserviceversion.yaml b/bundle/manifests/k8s-nim-operator.clusterserviceversion.yaml index 259d4843a..ac281b231 100644 --- a/bundle/manifests/k8s-nim-operator.clusterserviceversion.yaml +++ b/bundle/manifests/k8s-nim-operator.clusterserviceversion.yaml @@ -1349,6 +1349,7 @@ spec: - gateway.networking.k8s.io resources: - httproutes + - grpcroutes verbs: - create - delete diff --git a/config/crd/bases/apps.nvidia.com_nemocustomizers.yaml b/config/crd/bases/apps.nvidia.com_nemocustomizers.yaml index 6d5ad2ec7..ec765f6ba 100644 --- a/config/crd/bases/apps.nvidia.com_nemocustomizers.yaml +++ b/config/crd/bases/apps.nvidia.com_nemocustomizers.yaml @@ -1171,7 +1171,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1210,6 +1210,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -2113,63 +2178,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -4659,9 +4667,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/config/crd/bases/apps.nvidia.com_nemodatastores.yaml b/config/crd/bases/apps.nvidia.com_nemodatastores.yaml index e0cb2e7eb..9b466a4ce 100644 --- a/config/crd/bases/apps.nvidia.com_nemodatastores.yaml +++ b/config/crd/bases/apps.nvidia.com_nemodatastores.yaml @@ -1151,7 +1151,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1190,6 +1190,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1792,63 +1857,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2566,9 +2574,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/config/crd/bases/apps.nvidia.com_nemoentitystores.yaml b/config/crd/bases/apps.nvidia.com_nemoentitystores.yaml index f3a049484..432206f5a 100644 --- a/config/crd/bases/apps.nvidia.com_nemoentitystores.yaml +++ b/config/crd/bases/apps.nvidia.com_nemoentitystores.yaml @@ -1163,7 +1163,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1202,6 +1202,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1722,63 +1787,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2475,9 +2483,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/config/crd/bases/apps.nvidia.com_nemoevaluators.yaml b/config/crd/bases/apps.nvidia.com_nemoevaluators.yaml index 5b4686a58..c6411de6f 100644 --- a/config/crd/bases/apps.nvidia.com_nemoevaluators.yaml +++ b/config/crd/bases/apps.nvidia.com_nemoevaluators.yaml @@ -1228,7 +1228,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1267,6 +1267,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1858,63 +1923,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2625,9 +2633,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/config/crd/bases/apps.nvidia.com_nemoguardrails.yaml b/config/crd/bases/apps.nvidia.com_nemoguardrails.yaml index f818cfec1..a106f6bf8 100644 --- a/config/crd/bases/apps.nvidia.com_nemoguardrails.yaml +++ b/config/crd/bases/apps.nvidia.com_nemoguardrails.yaml @@ -1203,7 +1203,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1242,6 +1242,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1846,63 +1911,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2597,9 +2605,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/config/crd/bases/apps.nvidia.com_nimpipelines.yaml b/config/crd/bases/apps.nvidia.com_nimpipelines.yaml index 688af0642..aa0a2b4ff 100644 --- a/config/crd/bases/apps.nvidia.com_nimpipelines.yaml +++ b/config/crd/bases/apps.nvidia.com_nimpipelines.yaml @@ -1383,7 +1383,7 @@ spec: description: Expose defines attributes to expose the service. properties: ingress: - description: 'Deprecated: Use .spec.router instead.' + description: 'Deprecated: Use .spec.expose.router instead.' properties: annotations: additionalProperties: @@ -1672,6 +1672,70 @@ spec: x-kubernetes-list-type: atomic type: object type: object + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for + ingress class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the + created HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to + enable GRPCRoutes for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to + enable HTTPRoutes for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to + use for the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class + to use for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the + secret containing the TLS certificate and + key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. @@ -2590,64 +2654,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress - class or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created - HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable - HTTPRoutes for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use - for the created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to - use for the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret - containing the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClassName: type: string scale: @@ -3614,9 +3620,10 @@ spec: && has(self.replicas))' - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please - do not set .spec.router.ingress. + do not set .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) + && has(self.expose.router.ingress))' type: object type: array type: object diff --git a/config/crd/bases/apps.nvidia.com_nimservices.yaml b/config/crd/bases/apps.nvidia.com_nimservices.yaml index 16db395d7..1111c6171 100644 --- a/config/crd/bases/apps.nvidia.com_nimservices.yaml +++ b/config/crd/bases/apps.nvidia.com_nimservices.yaml @@ -1318,7 +1318,7 @@ spec: description: Expose defines attributes to expose the service. properties: ingress: - description: 'Deprecated: Use .spec.router instead.' + description: 'Deprecated: Use .spec.expose.router instead.' properties: annotations: additionalProperties: @@ -1599,6 +1599,69 @@ spec: x-kubernetes-list-type: atomic type: object type: object + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -2501,63 +2564,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClassName: type: string scale: @@ -3503,9 +3509,9 @@ spec: && has(self.replicas))' - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' status: description: NIMServiceStatus defines the observed state of NIMService. properties: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 03a75d28b..484dc0a0e 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -158,6 +158,7 @@ rules: - apiGroups: - gateway.networking.k8s.io resources: + - grpcroutes - httproutes verbs: - create diff --git a/config/samples/nim/serving/standalone/routers/grpcroutes/llm.yaml b/config/samples/nim/serving/standalone/routers/grpcroutes/llm.yaml new file mode 100644 index 000000000..619ef4d93 --- /dev/null +++ b/config/samples/nim/serving/standalone/routers/grpcroutes/llm.yaml @@ -0,0 +1,54 @@ +--- +# NIM Cache for Riva TTS +apiVersion: apps.nvidia.com/v1alpha1 +kind: NIMCache +metadata: + name: riva-tts + namespace: nim-service +spec: + source: + ngc: + modelPuller: nvcr.io/nim/nvidia/riva-tts:1.3.0 + pullSecret: ngc-secret + authSecret: ngc-api-secret + storage: + pvc: + create: true + storageClass: "" + size: "50Gi" + volumeAccessMode: ReadWriteOnce + +--- +# # NIM Service for Riva TTS +apiVersion: apps.nvidia.com/v1alpha1 +kind: NIMService +metadata: + name: riva-tts + namespace: nim-service +spec: + image: + repository: nvcr.io/nim/nvidia/riva-tts + tag: "1.3.0" + pullPolicy: IfNotPresent + pullSecrets: + - ngc-secret + authSecret: ngc-api-secret + storage: + nimCache: + name: riva-tts + profile: '' + replicas: 1 + resources: + limits: + nvidia.com/gpu: 1 + expose: + service: + type: ClusterIP + port: 9000 + grpcPort: 50051 + router: + gateway: + namespace: nemo + name: istio-gateway + grpcRoutesEnabled: true + hostDomainName: demo.nvidia.example.com diff --git a/config/samples/nim/serving/standalone/routers/httproutes/llm.yaml b/config/samples/nim/serving/standalone/routers/httproutes/llm.yaml index 267cbe318..9d42e9214 100644 --- a/config/samples/nim/serving/standalone/routers/httproutes/llm.yaml +++ b/config/samples/nim/serving/standalone/routers/httproutes/llm.yaml @@ -48,9 +48,9 @@ spec: service: type: ClusterIP port: 8000 - router: - gateway: - namespace: nim-service - name: istio-gateway - httpRoutesEnabled: true - hostDomainName: demo.nvidia.example.com \ No newline at end of file + router: + gateway: + namespace: nim-service + name: istio-gateway + httpRoutesEnabled: true + hostDomainName: demo.nvidia.example.com \ No newline at end of file diff --git a/config/samples/nim/serving/standalone/routers/httproutes/multi-llm.yaml b/config/samples/nim/serving/standalone/routers/httproutes/multi-llm.yaml index 68384587e..ccbb444b7 100644 --- a/config/samples/nim/serving/standalone/routers/httproutes/multi-llm.yaml +++ b/config/samples/nim/serving/standalone/routers/httproutes/multi-llm.yaml @@ -55,9 +55,9 @@ spec: service: type: ClusterIP port: 8000 - router: - gateway: - namespace: nim-service - name: istio-gateway - httpRoutesEnabled: true - hostDomainName: demo.nvidia.example.com \ No newline at end of file + router: + gateway: + namespace: nim-service + name: istio-gateway + httpRoutesEnabled: true + hostDomainName: demo.nvidia.example.com \ No newline at end of file diff --git a/config/samples/nim/serving/standalone/routers/ingress/multi-llm.yaml b/config/samples/nim/serving/standalone/routers/ingress/multi-llm.yaml index a88207cfc..a4bbd572c 100644 --- a/config/samples/nim/serving/standalone/routers/ingress/multi-llm.yaml +++ b/config/samples/nim/serving/standalone/routers/ingress/multi-llm.yaml @@ -55,7 +55,7 @@ spec: service: type: ClusterIP port: 8000 - router: - ingress: - ingressClass: nginx - hostDomainName: demo.nvidia.example.com \ No newline at end of file + router: + ingress: + ingressClass: nginx + hostDomainName: demo.nvidia.example.com \ No newline at end of file diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemocustomizers.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemocustomizers.yaml index 6d5ad2ec7..ec765f6ba 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemocustomizers.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemocustomizers.yaml @@ -1171,7 +1171,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1210,6 +1210,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -2113,63 +2178,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -4659,9 +4667,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemodatastores.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemodatastores.yaml index e0cb2e7eb..9b466a4ce 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemodatastores.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemodatastores.yaml @@ -1151,7 +1151,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1190,6 +1190,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1792,63 +1857,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2566,9 +2574,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoentitystores.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoentitystores.yaml index f3a049484..432206f5a 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoentitystores.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoentitystores.yaml @@ -1163,7 +1163,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1202,6 +1202,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1722,63 +1787,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2475,9 +2483,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoevaluators.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoevaluators.yaml index 5b4686a58..c6411de6f 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoevaluators.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoevaluators.yaml @@ -1228,7 +1228,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1267,6 +1267,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1858,63 +1923,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2625,9 +2633,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoguardrails.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoguardrails.yaml index f818cfec1..a106f6bf8 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoguardrails.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nemoguardrails.yaml @@ -1203,7 +1203,7 @@ spec: properties: ingress: description: |- - Deprecated: Use .spec.router.ingress instead. + Deprecated: Use .spec.expose.router.ingress instead. IngressV1 defines attributes for ingress properties: annotations: @@ -1242,6 +1242,71 @@ spec: - message: spec cannot be nil when ingress is enabled rule: (has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: 'unsupported field: spec.expose.router.gateway.grpcRoutesEnabled' + rule: '!(has(self.gateway) && self.gateway.grpcRoutesEnabled)' + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -1846,63 +1911,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClass: type: string scale: @@ -2597,9 +2605,9 @@ spec: x-kubernetes-validations: - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' - message: spec.replicas cannot be set when spec.scale.enabled is true rule: '!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))' diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml index 688af0642..aa0a2b4ff 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml @@ -1383,7 +1383,7 @@ spec: description: Expose defines attributes to expose the service. properties: ingress: - description: 'Deprecated: Use .spec.router instead.' + description: 'Deprecated: Use .spec.expose.router instead.' properties: annotations: additionalProperties: @@ -1672,6 +1672,70 @@ spec: x-kubernetes-list-type: atomic type: object type: object + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for + ingress class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the + created HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to + enable GRPCRoutes for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to + enable HTTPRoutes for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to + use for the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class + to use for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the + secret containing the TLS certificate and + key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. @@ -2590,64 +2654,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress - class or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created - HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable - HTTPRoutes for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use - for the created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to - use for the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret - containing the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClassName: type: string scale: @@ -3614,9 +3620,10 @@ spec: && has(self.replicas))' - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please - do not set .spec.router.ingress. + do not set .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) + && has(self.expose.router.ingress))' type: object type: array type: object diff --git a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml index 16db395d7..1111c6171 100644 --- a/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml +++ b/deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml @@ -1318,7 +1318,7 @@ spec: description: Expose defines attributes to expose the service. properties: ingress: - description: 'Deprecated: Use .spec.router instead.' + description: 'Deprecated: Use .spec.expose.router instead.' properties: annotations: additionalProperties: @@ -1599,6 +1599,69 @@ spec: x-kubernetes-list-type: atomic type: object type: object + router: + properties: + annotations: + additionalProperties: + type: string + description: Annotations for the router, e.g. for ingress + class or gateway + type: object + gateway: + description: Gateway is the gateway to use for the created + HTTPRoute. + properties: + grpcRoutesEnabled: + default: false + description: GRPCRoutesEnabled is a flag to enable GRPCRoutes + for the created gateway. + type: boolean + httpRoutesEnabled: + default: true + description: HTTPRoutesEnabled is a flag to enable HTTPRoutes + for the created gateway. + type: boolean + name: + description: Name of the gateway + minLength: 1 + type: string + namespace: + description: Namespace of the gateway + minLength: 1 + type: string + required: + - name + - namespace + type: object + hostDomainName: + description: |- + HostDomainName is the domain name of the hostname matched by the router. + The hostname is constructed as "..", where the a subdomain of the matched hostname. + eg. example.com for "..example.com" + maxLength: 63 + minLength: 1 + pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ + type: string + ingress: + description: Ingress is the ingress controller to use for + the created ingress. + properties: + ingressClass: + description: IngressClass is the ingress class to use + for the created ingress. + minLength: 1 + type: string + tlsSecretName: + description: TLSSecretName is the name of the secret containing + the TLS certificate and key. + type: string + required: + - ingressClass + type: object + type: object + x-kubernetes-validations: + - message: ingress and gateway cannot be specified together + rule: '!(has(self.gateway) && has(self.ingress))' service: description: Service defines attributes to create a service. properties: @@ -2501,63 +2564,6 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object - router: - properties: - annotations: - additionalProperties: - type: string - description: Annotations for the router, e.g. for ingress class - or gateway - type: object - gateway: - description: Gateway is the gateway to use for the created HTTPRoute. - properties: - httpRoutesEnabled: - default: true - description: HTTPRoutesEnabled is a flag to enable HTTPRoutes - for the created gateway. - type: boolean - name: - description: Name of the gateway - minLength: 1 - type: string - namespace: - description: Namespace of the gateway - minLength: 1 - type: string - required: - - name - - namespace - type: object - hostDomainName: - description: |- - HostDomainName is the domain name of the hostname matched by the router. - The hostname is constructed as "..", where the a subdomain of the matched hostname. - eg. example.com for "..example.com" - maxLength: 63 - minLength: 1 - pattern: ^(([a-z0-9][a-z0-9\-]*[a-z0-9])|[a-z0-9]+\.)*([a-z]+|xn\-\-[a-z0-9]+)\.?$ - type: string - ingress: - description: Ingress is the ingress controller to use for the - created ingress. - properties: - ingressClass: - description: IngressClass is the ingress class to use for - the created ingress. - minLength: 1 - type: string - tlsSecretName: - description: TLSSecretName is the name of the secret containing - the TLS certificate and key. - type: string - required: - - ingressClass - type: object - type: object - x-kubernetes-validations: - - message: ingress and gateway cannot be specified together - rule: '!(has(self.gateway) && has(self.ingress))' runtimeClassName: type: string scale: @@ -3503,9 +3509,9 @@ spec: && has(self.replicas))' - message: .spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set - .spec.router.ingress. + .spec.expose.router.ingress. rule: '!(has(self.expose.ingress) && has(self.expose.ingress.enabled) - && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))' + && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))' status: description: NIMServiceStatus defines the observed state of NIMService. properties: diff --git a/deployments/helm/k8s-nim-operator/templates/manager-rbac.yaml b/deployments/helm/k8s-nim-operator/templates/manager-rbac.yaml index 5b29265c4..2a4bb6e84 100644 --- a/deployments/helm/k8s-nim-operator/templates/manager-rbac.yaml +++ b/deployments/helm/k8s-nim-operator/templates/manager-rbac.yaml @@ -588,6 +588,7 @@ rules: - gateway.networking.k8s.io resources: - httproutes + - grpcroutes verbs: - create - delete diff --git a/internal/conditions/conditions.go b/internal/conditions/conditions.go index 8b93a6a20..3508836c7 100644 --- a/internal/conditions/conditions.go +++ b/internal/conditions/conditions.go @@ -49,6 +49,8 @@ const ( ReasonIngressFailed = "IngressFailed" // ReasonHTTPRouteFailed indicates that the creation of httproute has failed. ReasonHTTPRouteFailed = "HTTPRouteFailed" + // ReasonGRPCRouteFailed indicates that the creation of grpcroute has failed. + ReasonGRPCRouteFailed = "GRPCRouteFailed" // ReasonHPAFailed indicates that the creation of hpa has failed. ReasonHPAFailed = "HPAFailed" // ReasonSCCFailed indicates that the creation of scc has failed. diff --git a/internal/controller/nemo_datastore_controller.go b/internal/controller/nemo_datastore_controller.go index 36ce53716..2ab7ef899 100644 --- a/internal/controller/nemo_datastore_controller.go +++ b/internal/controller/nemo_datastore_controller.go @@ -98,7 +98,7 @@ func NewNemoDatastoreReconciler(client client.Client, scheme *runtime.Scheme, up // +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes;grpcroutes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch diff --git a/internal/controller/nemo_entitystore_controller.go b/internal/controller/nemo_entitystore_controller.go index f7c9fc675..79d593718 100644 --- a/internal/controller/nemo_entitystore_controller.go +++ b/internal/controller/nemo_entitystore_controller.go @@ -97,7 +97,7 @@ func NewNemoEntitystoreReconciler(client client.Client, scheme *runtime.Scheme, // +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes;grpcroutes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalars,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch diff --git a/internal/controller/nemo_entitystore_controller_test.go b/internal/controller/nemo_entitystore_controller_test.go index 575811191..1aae8a098 100644 --- a/internal/controller/nemo_entitystore_controller_test.go +++ b/internal/controller/nemo_entitystore_controller_test.go @@ -181,13 +181,13 @@ var _ = Describe("NemoEntitystore Controller", func() { "annotation-key-specific": "service", }, }, - }, - Router: appsv1alpha1.Router{ - Ingress: &appsv1alpha1.RouterIngress{ - IngressClass: "nginx", - }, - Annotations: map[string]string{ - "annotation-key-specific": "ingress", + Router: appsv1alpha1.Router{ + Ingress: &appsv1alpha1.RouterIngress{ + IngressClass: "nginx", + }, + Annotations: map[string]string{ + "annotation-key-specific": "ingress", + }, }, }, Scale: appsv1alpha1.Autoscaling{ diff --git a/internal/controller/nemo_evaluator_controller.go b/internal/controller/nemo_evaluator_controller.go index 6b3cdac35..94aed9b85 100644 --- a/internal/controller/nemo_evaluator_controller.go +++ b/internal/controller/nemo_evaluator_controller.go @@ -98,7 +98,7 @@ func NewNemoEvaluatorReconciler(client client.Client, scheme *runtime.Scheme, up // +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes;grpcroutes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalars,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch diff --git a/internal/controller/nemo_evaluator_controller_test.go b/internal/controller/nemo_evaluator_controller_test.go index 42e959d56..2698fe53b 100644 --- a/internal/controller/nemo_evaluator_controller_test.go +++ b/internal/controller/nemo_evaluator_controller_test.go @@ -147,13 +147,13 @@ var _ = Describe("NemoEvaluator Controller", func() { "annotation-key-specific": "service", }, }, - }, - Router: appsv1alpha1.Router{ - Ingress: &appsv1alpha1.RouterIngress{ - IngressClass: "nginx", - }, - Annotations: map[string]string{ - "annotation-key-specific": "ingress", + Router: appsv1alpha1.Router{ + Ingress: &appsv1alpha1.RouterIngress{ + IngressClass: "nginx", + }, + Annotations: map[string]string{ + "annotation-key-specific": "ingress", + }, }, }, Scale: appsv1alpha1.Autoscaling{ @@ -489,7 +489,7 @@ var _ = Describe("NemoEvaluator Controller", func() { err = client.Get(context.TODO(), namespacedName, nemoEvaluator) Expect(err).NotTo(HaveOccurred()) nemoEvaluator.Spec.Scale.Enabled = ptr.To[bool](false) - nemoEvaluator.Spec.Router.Ingress = nil + nemoEvaluator.Spec.Expose.Router.Ingress = nil err = client.Update(context.TODO(), nemoEvaluator) Expect(err).NotTo(HaveOccurred()) diff --git a/internal/controller/nemocustomizer_controller.go b/internal/controller/nemocustomizer_controller.go index 36b63e55f..9e10c60e4 100644 --- a/internal/controller/nemocustomizer_controller.go +++ b/internal/controller/nemocustomizer_controller.go @@ -111,7 +111,7 @@ func NewNemoCustomizerReconciler(client client.Client, scheme *runtime.Scheme, u // +kubebuilder:rbac:groups=batch,resources=jobs;jobs/status,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes;grpcroutes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalars,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch // +kubebuilder:rbac:groups="nodeinfo.volcano.sh",resources=numatopologies,verbs=get;list;watch diff --git a/internal/controller/nemocustomizer_controller_test.go b/internal/controller/nemocustomizer_controller_test.go index 8edb20c02..959fe54df 100644 --- a/internal/controller/nemocustomizer_controller_test.go +++ b/internal/controller/nemocustomizer_controller_test.go @@ -244,13 +244,13 @@ var _ = Describe("NemoCustomizer Controller", func() { "annotation-key-specific": "service", }, }, - }, - Router: appsv1alpha1.Router{ - Ingress: &appsv1alpha1.RouterIngress{ - IngressClass: "nginx", - }, - Annotations: map[string]string{ - "annotation-key-specific": "ingress", + Router: appsv1alpha1.Router{ + Ingress: &appsv1alpha1.RouterIngress{ + IngressClass: "nginx", + }, + Annotations: map[string]string{ + "annotation-key-specific": "ingress", + }, }, }, Scale: appsv1alpha1.Autoscaling{ @@ -672,7 +672,7 @@ var _ = Describe("NemoCustomizer Controller", func() { err = client.Get(context.TODO(), namespacedName, nemoCustomizer) Expect(err).NotTo(HaveOccurred()) nemoCustomizer.Spec.Scale.Enabled = ptr.To[bool](false) - nemoCustomizer.Spec.Router.Ingress = nil + nemoCustomizer.Spec.Expose.Router.Ingress = nil err = client.Update(context.TODO(), nemoCustomizer) Expect(err).NotTo(HaveOccurred()) diff --git a/internal/controller/nimservice_controller.go b/internal/controller/nimservice_controller.go index aaa819890..b22d749bb 100644 --- a/internal/controller/nimservice_controller.go +++ b/internal/controller/nimservice_controller.go @@ -103,7 +103,7 @@ func NewNIMServiceReconciler(client client.Client, scheme *runtime.Scheme, updat // +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes;grpcroutes,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch // +kubebuilder:rbac:groups=leaderworkerset.x-k8s.io,resources=leaderworkersets,verbs=get;list;watch;create;update;patch;delete @@ -350,6 +350,16 @@ func (r *NIMServiceReconciler) SetupWithManager(mgr ctrl.Manager) error { return err } + nimServiceBuilder, err = k8sutil.ControllerOwnsIfCRDExists( + r.discoveryClient, + nimServiceBuilder, + gatewayv1.SchemeGroupVersion.WithResource("grpcroutes"), + &gatewayv1.GRPCRoute{}, + ) + if err != nil { + return err + } + return nimServiceBuilder.Complete(r) } diff --git a/internal/controller/platform/kserve/nimservice_test.go b/internal/controller/platform/kserve/nimservice_test.go index 5cea696cd..e1d323b8b 100644 --- a/internal/controller/platform/kserve/nimservice_test.go +++ b/internal/controller/platform/kserve/nimservice_test.go @@ -264,10 +264,10 @@ var _ = Describe("NIMServiceReconciler for a KServe platform", func() { }, Expose: appsv1alpha1.Expose{ Service: appsv1alpha1.Service{Type: corev1.ServiceTypeLoadBalancer, Port: ptr.To[int32](8123), Annotations: map[string]string{"annotation-key-specific": "service"}}, - }, - Router: appsv1alpha1.Router{ - Ingress: &appsv1alpha1.RouterIngress{ - IngressClass: "nginx", + Router: appsv1alpha1.Router{ + Ingress: &appsv1alpha1.RouterIngress{ + IngressClass: "nginx", + }, }, }, Scale: appsv1alpha1.Autoscaling{ @@ -839,7 +839,7 @@ var _ = Describe("NIMServiceReconciler for a KServe platform", func() { err = client.Get(context.TODO(), namespacedName, nimService) Expect(err).NotTo(HaveOccurred()) nimService.Spec.Scale.Enabled = ptr.To(false) - nimService.Spec.Router.Ingress = nil + nimService.Spec.Expose.Router.Ingress = nil err = client.Update(context.TODO(), nimService) Expect(err).NotTo(HaveOccurred()) diff --git a/internal/controller/platform/standalone/nimservice.go b/internal/controller/platform/standalone/nimservice.go index ef8fd9486..47a9f3fa5 100644 --- a/internal/controller/platform/standalone/nimservice.go +++ b/internal/controller/platform/standalone/nimservice.go @@ -259,6 +259,21 @@ func (r *NIMServiceReconciler) reconcileNIMService(ctx context.Context, nimServi } } + // sync GRPCRoute + if nimService.IsGRPCRouteEnabled() { + err = r.renderAndSyncResource(ctx, nimService, &renderer, &gatewayv1.GRPCRoute{}, func() (client.Object, error) { + return renderer.GRPCRoute(nimService.GetGRPCRouteParams()) + }, "grpcroute", conditions.ReasonGRPCRouteFailed) + if err != nil { + return ctrl.Result{}, err + } + } else { + err = k8sutil.CleanupResource(ctx, r.GetClient(), &gatewayv1.GRPCRoute{}, namespacedName) + if err != nil && !k8serrors.IsNotFound(err) { + return ctrl.Result{}, err + } + } + // Sync HPA if nimService.IsAutoScalingEnabled() { err = r.renderAndSyncResource(ctx, nimService, &renderer, &autoscalingv2.HorizontalPodAutoscaler{}, func() (client.Object, error) { diff --git a/internal/controller/platform/standalone/nimservice_test.go b/internal/controller/platform/standalone/nimservice_test.go index d0b026c89..7b0489ce8 100644 --- a/internal/controller/platform/standalone/nimservice_test.go +++ b/internal/controller/platform/standalone/nimservice_test.go @@ -263,15 +263,16 @@ var _ = Describe("NIMServiceReconciler for a standalone platform", func() { }, Expose: appsv1alpha1.Expose{ Service: appsv1alpha1.Service{Type: corev1.ServiceTypeLoadBalancer, Port: ptr.To[int32](8123), Annotations: map[string]string{"annotation-key-specific": "service"}}, - }, - Router: appsv1alpha1.Router{ - Ingress: &appsv1alpha1.RouterIngress{ - IngressClass: "nginx", - }, - Annotations: map[string]string{ - "annotation-key-specific": "ingress", + + Router: appsv1alpha1.Router{ + Ingress: &appsv1alpha1.RouterIngress{ + IngressClass: "nginx", + }, + Annotations: map[string]string{ + "annotation-key-specific": "ingress", + }, + HostDomainName: "example.com", }, - HostDomainName: "example.com", }, Scale: appsv1alpha1.Autoscaling{ Enabled: ptr.To[bool](true), @@ -866,7 +867,7 @@ var _ = Describe("NIMServiceReconciler for a standalone platform", func() { err = client.Get(context.TODO(), namespacedName, nimService) Expect(err).NotTo(HaveOccurred()) nimService.Spec.Scale.Enabled = ptr.To(false) - nimService.Spec.Router.Ingress = nil + nimService.Spec.Expose.Router.Ingress = nil err = client.Update(context.TODO(), nimService) Expect(err).NotTo(HaveOccurred()) @@ -2248,7 +2249,7 @@ var _ = Describe("NIMServiceReconciler for a standalone platform", func() { }) It("should return only svc endpoints when ingress is disabled", func() { - nimService.Spec.Router.Ingress = nil + nimService.Spec.Expose.Router.Ingress = nil internal, external, err := reconciler.getNIMModelEndpoints(context.TODO(), nimService) Expect(err).ToNot(HaveOccurred()) Expect(internal).To(Equal("127.0.0.1:8123")) @@ -2263,7 +2264,7 @@ var _ = Describe("NIMServiceReconciler for a standalone platform", func() { }) It("should return ingress loadbalancer ip as external endpoint", func() { - nimService.Spec.Router.Ingress = &appsv1alpha1.RouterIngress{ + nimService.Spec.Expose.Router.Ingress = &appsv1alpha1.RouterIngress{ IngressClass: "nginx", } ingress.Spec.Rules[0].Host = "" @@ -2275,7 +2276,7 @@ var _ = Describe("NIMServiceReconciler for a standalone platform", func() { }) It("should return ingress loadbalancer hostname as external endpoint", func() { - nimService.Spec.Router.Ingress = &appsv1alpha1.RouterIngress{ + nimService.Spec.Expose.Router.Ingress = &appsv1alpha1.RouterIngress{ IngressClass: "nginx", } ingress.Spec.Rules[0].Host = "" diff --git a/internal/render/render.go b/internal/render/render.go index f7c44ce2a..27ee3f8ca 100644 --- a/internal/render/render.go +++ b/internal/render/render.go @@ -76,6 +76,7 @@ type Renderer interface { SCC(params *types.SCCParams) (*securityv1.SecurityContextConstraints, error) Ingress(params *types.IngressParams) (*networkingv1.Ingress, error) HTTPRoute(params *types.HTTPRouteParams) (*gatewayv1.HTTPRoute, error) + GRPCRoute(params *types.GRPCRouteParams) (*gatewayv1.GRPCRoute, error) HPA(params *types.HPAParams) (*autoscalingv2.HorizontalPodAutoscaler, error) ServiceMonitor(params *types.ServiceMonitorParams) (*monitoringv1.ServiceMonitor, error) ConfigMap(params *types.ConfigMapParams) (*corev1.ConfigMap, error) @@ -362,6 +363,23 @@ func (r *textTemplateRenderer) HTTPRoute(params *types.HTTPRouteParams) (*gatewa return httpRoute, nil } +// GRPCRoute renders a GRPCRoute spec with the given templating data. +func (r *textTemplateRenderer) GRPCRoute(params *types.GRPCRouteParams) (*gatewayv1.GRPCRoute, error) { + objs, err := r.renderFile(path.Join(r.directory, "grpcroute.yaml"), &TemplateData{Data: params}) + if err != nil { + return nil, err + } + if len(objs) == 0 { + return nil, nil + } + grpcRoute := &gatewayv1.GRPCRoute{} + err = runtime.DefaultUnstructuredConverter.FromUnstructured(objs[0].Object, grpcRoute) + if err != nil { + return nil, fmt.Errorf("error converting unstructured object to GRPCRoute: %w", err) + } + return grpcRoute, nil +} + // Ingress renders an Ingress spec with the given templating data. func (r *textTemplateRenderer) Ingress(params *types.IngressParams) (*networkingv1.Ingress, error) { objs, err := r.renderFile(path.Join(r.directory, "ingress.yaml"), &TemplateData{Data: params}) diff --git a/internal/render/types/types.go b/internal/render/types/types.go index dc43e40d8..dde6f13aa 100644 --- a/internal/render/types/types.go +++ b/internal/render/types/types.go @@ -213,6 +213,15 @@ type HTTPRouteParams struct { Spec gatewayv1.HTTPRouteSpec } +type GRPCRouteParams struct { + Enabled bool + Name string + Namespace string + Labels map[string]string + Annotations map[string]string + Spec gatewayv1.GRPCRouteSpec +} + // IngressParams holds the parameters for rendering an Ingress template. type IngressParams struct { Enabled bool diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 965c465d8..b935c483e 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -351,11 +351,20 @@ func UpdateObject(obj client.Object, desired client.Object) client.Object { return updateInferenceService(castedObj, desired.(*kservev1beta1.InferenceService)) //nolint:forcetypeassert case *gatewayv1.HTTPRoute: return updateHTTPRoute(castedObj, desired.(*gatewayv1.HTTPRoute)) //nolint:forcetypeassert + case *gatewayv1.GRPCRoute: + return updateGRPCRoute(castedObj, desired.(*gatewayv1.GRPCRoute)) //nolint:forcetypeassert default: panic("unsupported obj type") } } +func updateGRPCRoute(obj, desired *gatewayv1.GRPCRoute) *gatewayv1.GRPCRoute { + obj.SetAnnotations(desired.GetAnnotations()) + obj.SetLabels(desired.GetLabels()) + obj.Spec = *desired.Spec.DeepCopy() + return obj +} + func updateHTTPRoute(obj, desired *gatewayv1.HTTPRoute) *gatewayv1.HTTPRoute { obj.SetAnnotations(desired.GetAnnotations()) obj.SetLabels(desired.GetLabels()) diff --git a/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go b/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go index 588858664..c181a2f4b 100644 --- a/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go +++ b/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go @@ -79,7 +79,7 @@ func validateNIMServiceSpec(spec *appsv1alpha1.NIMServiceSpec, fldPath *field.Pa warningList = append(warningList, w...) errList = append(errList, err...) - w, err = validateRouterConfiguration(&spec.Router, fldPath.Child("router")) + w, err = validateRouterConfiguration(&spec.Expose.Router, fldPath.Child("expose").Child("router")) warningList = append(warningList, w...) errList = append(errList, err...) @@ -111,14 +111,31 @@ func validateNIMServiceSpec(spec *appsv1alpha1.NIMServiceSpec, fldPath *field.Pa warningList = append(warningList, w...) errList = append(errList, err...) + w, err = validateExposeRouterConfiguration(spec, fldPath) + warningList = append(warningList, w...) + errList = append(errList, err...) + + return warningList, errList +} + +func validateExposeRouterConfiguration(spec *appsv1alpha1.NIMServiceSpec, fldPath *field.Path) (admission.Warnings, field.ErrorList) { + warningList := admission.Warnings{} + errList := field.ErrorList{} + if spec.Expose.Service.Type == corev1.ServiceTypeLoadBalancer && (spec.Expose.Router.Gateway != nil || spec.Expose.Router.Ingress != nil) { + warningList = append(warningList, "spec.expose.service.type is set to LoadBalancer, but spec.expose.router.gateway or spec.expose.router.ingress is also set. This creates two entry points for the service. Consider only using one of them.") + } + + if spec.Expose.Router.Gateway != nil && spec.Expose.Router.Gateway.GRPCRoutesEnabled && spec.Expose.Service.GRPCPort == nil { + errList = append(errList, field.Required(fldPath.Child("expose").Child("service").Child("grpcPort"), "must be set when .spec.expose.router.gateway.grpcRoutesEnabled is true")) + } return warningList, errList } func validateRedundantIngressConfiguration(spec *appsv1alpha1.NIMServiceSpec, fldPath *field.Path) (admission.Warnings, field.ErrorList) { warningList := admission.Warnings{} errList := field.ErrorList{} - if spec.Expose.Ingress.Enabled != nil && *spec.Expose.Ingress.Enabled && spec.Router.Ingress != nil { //nolint:staticcheck - errList = append(errList, field.Forbidden(fldPath.Child("expose").Child("ingress"), fmt.Sprintf("%s is deprecated. Omit the field if you use .spec.router instead", fldPath.Child("expose").Child("ingress")))) + if spec.Expose.Ingress.Enabled != nil && *spec.Expose.Ingress.Enabled && spec.Expose.Router.Ingress != nil { //nolint:staticcheck + errList = append(errList, field.Forbidden(fldPath.Child("expose").Child("ingress"), fmt.Sprintf("%s is deprecated. Omit the field if you use .spec.expose.router instead", fldPath.Child("expose").Child("ingress")))) } return warningList, errList } @@ -127,7 +144,7 @@ func validateExposeConfiguration(expose *appsv1alpha1.Expose, fldPath *field.Pat warningList := admission.Warnings{} errList := field.ErrorList{} if expose.Ingress.Enabled != nil && *expose.Ingress.Enabled { //nolint:staticcheck - warningList = append(warningList, ".spec.expose.ingress is deprecated, use .spec.router instead.") + warningList = append(warningList, ".spec.expose.ingress is deprecated, use .spec.expose.router instead.") } return warningList, errList } @@ -503,13 +520,13 @@ func validateKServeConfiguration(spec *appsv1alpha1.NIMServiceSpec, fldPath *fie errList = append(errList, field.Forbidden(fldPath.Child("expose").Child("ingress").Child("enabled"), fmt.Sprintf("%s cannot be set when KServe runs in serverless mode", fldPath.Child("expose").Child("ingress").Child("enabled")))) } - // Spec.Router.Ingress cannot be set. - if spec.Router.Ingress != nil { + // Spec.Expose.Router.Ingress cannot be set. + if spec.Expose.Router.Ingress != nil { errList = append(errList, field.Forbidden(fldPath.Child("router").Child("ingress"), fmt.Sprintf("%s cannot be set when KServe runs in serverless mode", fldPath.Child("router").Child("ingress")))) } - // Spec.Router.Gateway cannot be set. - if spec.Router.Gateway != nil { + // Spec.Expose.Router.Gateway cannot be set. + if spec.Expose.Router.Gateway != nil { errList = append(errList, field.Forbidden(fldPath.Child("router").Child("gateway"), fmt.Sprintf("%s cannot be set when KServe runs in serverless mode", fldPath.Child("router").Child("gateway")))) } diff --git a/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper_test.go b/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper_test.go index 473bfcc3a..448ff7435 100644 --- a/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper_test.go +++ b/internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper_test.go @@ -1030,7 +1030,7 @@ func TestValidateKServeConfiguration(t *testing.T) { name: "kserve serverless – ingress set", modify: func(ns *appsv1alpha1.NIMService) { ns.Spec.InferencePlatform = appsv1alpha1.PlatformTypeKServe - ns.Spec.Router.Ingress = &appsv1alpha1.RouterIngress{ + ns.Spec.Expose.Router.Ingress = &appsv1alpha1.RouterIngress{ IngressClass: "nginx", } }, @@ -1051,7 +1051,7 @@ func TestValidateKServeConfiguration(t *testing.T) { modify: func(ns *appsv1alpha1.NIMService) { ns.Spec.InferencePlatform = appsv1alpha1.PlatformTypeKServe ns.Spec.Scale.Enabled = &trueVal - ns.Spec.Router.Ingress = &appsv1alpha1.RouterIngress{ + ns.Spec.Expose.Router.Ingress = &appsv1alpha1.RouterIngress{ IngressClass: "nginx", } ns.Spec.Metrics.Enabled = &trueVal @@ -1087,7 +1087,7 @@ func TestValidateKServeConfiguration(t *testing.T) { // Ensure nested structs are initialised to avoid nil panics when we set sub-fields. ns.Spec.Scale = appsv1alpha1.Autoscaling{} ns.Spec.Expose = appsv1alpha1.Expose{} - ns.Spec.Router = appsv1alpha1.Router{} + ns.Spec.Expose.Router = appsv1alpha1.Router{} ns.Spec.Metrics = appsv1alpha1.Metrics{} tc.modify(ns) diff --git a/manifests/grpcroute.yaml b/manifests/grpcroute.yaml new file mode 100644 index 000000000..c692d7e37 --- /dev/null +++ b/manifests/grpcroute.yaml @@ -0,0 +1,19 @@ +{{- if .Enabled }} +apiVersion: gateway.networking.k8s.io/v1 +kind: GRPCRoute +metadata: + name: {{ .Name }} + namespace: {{ .Namespace }} + labels: + {{- if .Labels }} + {{- .Labels | yaml | nindent 4 }} + {{- end }} + annotations: + {{- if .Annotations }} + {{- .Annotations | yaml | nindent 4 }} + {{- end }} +spec: + {{- if .Spec }} + {{- .Spec | yaml | nindent 2 }} + {{- end }} +{{- end }}