Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apis: document ParentRef functionality for GAMMA #2146

Merged
merged 14 commits into from
Jul 5, 2023
Merged
47 changes: 39 additions & 8 deletions apis/v1beta1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
)

// ParentReference identifies an API object (usually a Gateway) that can be considered
// a parent of this resource (usually a route). The only kind of parent resource
// with "Core" support is Gateway. This API may be extended in the future to
// support additional kinds of parent resources, such as HTTPRoute.
// a parent of this resource (usually a route). The only kinds of parent resources
// with "Core" support are Service (only for implementations supporting the Mesh
// conformance profile) and Gateway. This API may be extended in the future to
// support additional kinds of parent resources.
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
//
// The API object must be valid in the cluster; the Group and Kind must
// be registered in the cluster for this reference to be valid.
Expand All @@ -43,6 +44,8 @@ type ParentReference struct {
//
// Support: Core (Gateway)
//
// Support: Core (Service - mesh conformance profile only)
//
// Support: Implementation-specific (Other Resources)
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
//
// +kubebuilder:default=Gateway
Expand All @@ -58,6 +61,16 @@ type ParentReference struct {
// Gateway has the AllowedRoutes field, and ReferenceGrant provides a
// generic way to enable any other kind of cross-namespace reference.
//
// ParentRefs from a Route to a Service in the same namespace are "producer"
// routes, which apply default routing rules to inbound connections from
// any namespace to the Service.
//
// ParentRefs from a Route to a Service in a different namespace are
// "consumer" routes, and these routing rules are only applied to outbound
// connections originating from the same namespace as the Route, for which
// the intended destination of the connections are a Service targeted as a
// ParentRef of the Route.
//
// Support: Core
//
// +optional
Expand Down Expand Up @@ -104,6 +117,10 @@ type ParentReference struct {
// and SectionName are specified, the name and port of the selected listener
// must match both specified values.
//
// When the parent resource is a Service, this targets a specific port in the
// Service spec. When both Port (experimental) and SectionName are specified,
// the name and port of the selected port must match both specified values.
//
// Implementations MAY choose to support other parent resources.
// Implementations supporting other types of parent resources MUST clearly
// document how/if Port is interpreted.
Expand All @@ -130,15 +147,19 @@ type CommonRouteSpec struct {
// to be attached to. Note that the referenced parent resource needs to
// allow this for the attachment to be complete. For Gateways, that means
// the Gateway needs to allow attachment from Routes of this kind and
// namespace.
// namespace. For Services, that means the Service must either be in the same
// namespace for a "producer" route, or the mesh implementation must support
// and allow "consumer" routes for the referenced Service.
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
//
// The only kind of parent resource with "Core" support is Gateway. This API
// may be extended in the future to support additional kinds of parent
// The only kinds of parent resources with "Core" support are Service (only
// for implementations supporting the Mesh conformance profile) and Gateway.
// This API may be extended in the future to support additional kinds of parent
// resources such as one of the route kinds.
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
//
// It is invalid to reference an identical parent more than once. It is
// valid to reference multiple distinct sections within the same parent
// resource, such as 2 Listeners within a Gateway.
// resource, such as two separate Listeners on the same Gateway or two separate
// ports on the same Service.
//
// It is possible to separately reference multiple distinct objects that may
// be collapsed by an implementation. For example, some implementations may
Expand All @@ -150,7 +171,17 @@ type CommonRouteSpec struct {
// rules. Cross-namespace references are only valid if they are explicitly
// allowed by something in the namespace they are referring to. For example,
// Gateway has the AllowedRoutes field, and ReferenceGrant provides a
// generic way to enable any other kind of cross-namespace reference.
// generic way to enable other kinds of cross-namespace reference.
//
// ParentRefs from a Route to a Service in the same namespace are "producer"
// routes, which apply default routing rules to inbound connections from
// any namespace to the Service.
//
// ParentRefs from a Route to a Service in a different namespace are
// "consumer" routes, and these routing rules are only applied to outbound
// connections originating from the same namespace as the Route, for which
// the intended destination of the connections are a Service targeted as a
// ParentRef of the Route.
//
// +optional
// +kubebuilder:validation:MaxItems=32
Expand Down
104 changes: 72 additions & 32 deletions config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml

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

Loading