Skip to content

Commit

Permalink
Merge pull request #1002 from cxhiano/gep-957-impl
Browse files Browse the repository at this point in the history
Implement GEP-957: Destination Port Matching.
  • Loading branch information
k8s-ci-robot authored Feb 18, 2022
2 parents 10dd77f + 8c15033 commit d80ef32
Show file tree
Hide file tree
Showing 12 changed files with 520 additions and 218 deletions.
33 changes: 32 additions & 1 deletion apis/v1alpha2/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ type ParentReference struct {
// SectionName is the name of a section within the target resource. In the
// following resources, SectionName is interpreted as the following:
//
// * Gateway: Listener Name
// * Gateway: Listener Name. When both Port (experimental) and SectionName
// are specified, the name and port of the selected listener must match
// both specified values.
//
// Implementations MAY choose to support attaching Routes to other resources.
// If that is the case, they MUST clearly document how SectionName is
Expand All @@ -84,6 +86,35 @@ type ParentReference struct {
//
// +optional
SectionName *SectionName `json:"sectionName,omitempty"`

// Port is the network port this Route targets. It can be interpreted
// differently based on the type of parent resource:
//
// * Gateway: All listeners listening on the specified port that also
// support this kind of Route(and select this Route). It's not
// recommended to set `Port` unless the networking behaviors specified
// in a Route must apply to a specific port as opposed to a listener(s)
// whose port(s) may be changed. When both Port and SectionName are
// specified, the name and port of the selected listener 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.
//
// For the purpose of status, an attachment is considered successful as
// long as the parent resource accepts it partially. For example, Gateway
// listeners can restrict which Routes can attach to them by Route kind,
// namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
// from the referencing Route, the Route MUST be considered successfully
// attached. If no Gateway listeners accept attachment from this Route,
// the Route MUST be considered detached from the Gateway.
//
// Support: Extended
//
// +optional
// <gateway:experimental>
Port *PortNumber `json:"port,omitempty"`
}

// CommonRouteSpec defines the common attributes that all Routes MUST include
Expand Down
5 changes: 5 additions & 0 deletions apis/v1alpha2/zz_generated.deepcopy.go

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

112 changes: 85 additions & 27 deletions config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

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

Loading

0 comments on commit d80ef32

Please sign in to comment.