Skip to content

Commit

Permalink
docs: Route Rule name field
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Cassolato <guicassolato@gmail.com>
  • Loading branch information
guicassolato committed Sep 27, 2024
1 parent b80f6cb commit a269e34
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 9 deletions.
22 changes: 22 additions & 0 deletions examples/experimental/http-route-rule-name.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway
rules:
- name: read-only
matches:
- method: GET
backendRefs:
- name: backend-mirror-svc
port: 8080
- name: write-only
matches:
- method: POST
- method: PATCH
- method: DELETE
backendRefs:
- name: backend-svc
port: 8080
16 changes: 14 additions & 2 deletions site-src/api-types/grpcroute.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ The specification of a GRPCRoute consists of:
matching the Host header of gRPC requests.
- [Rules][grpcrouterule]- Define a list of rules to perform actions against
matching gRPC requests. Each rule consists of [matches][matches],
[filters][filters] (optional), and [backendRefs][backendRef] (optional)
fields.
[filters][filters] (optional), [backendRefs][backendRef] (optional), and
[name][name] (optional) fields.

<!--- Editable SVG available at site-src/images/grpcroute-basic-example.svg -->
The following illustrates a GRPCRoute that sends all traffic to one Service:
Expand Down Expand Up @@ -217,6 +217,18 @@ Service:
Reference the [backendRef][backendRef] API documentation for additional details
on `weight` and other fields.

#### Name (optional)

??? example "Experimental Channel since v1.2.0"

This concept has been part of the Experimental Channel since `v1.2.0`.
For more information on release channels, refer to our
[versioning guide](/concepts/versioning).

GRPCRoute Rules include an optional `name` field. The applications for the name of a route rule are implementation-specific. It can be used to reference individual route rules by name from other resources, such as in the `sectionName` field of metaresources ([GEP-2648](https://gateway-api.sigs.k8s.io/geps/gep-2648/#apply-policies-to-sections-of-a-resource)), in the status stanzas of resources related to the route object, to identify internal configuration objects generated by the implementation from GRPCRoute Rule, etc.

If specified, the value of the name field must comply with the [`SectionName`](https://github.com/kubernetes-sigs/gateway-api/blob/v1.0.0/apis/v1/shared_types.go#L607-L624) type.

## Status

Status defines the observed state of the GRPCRoute.
Expand Down
32 changes: 25 additions & 7 deletions site-src/api-types/httproute.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The specification of an HTTPRoute consists of:
matching the Host header of HTTP requests.
- [Rules][httprouterule]- Define a list of rules to perform actions against
matching HTTP requests. Each rule consists of [matches][matches],
[filters][filters] (optional), [backendRefs][backendRef] (optional) and [timeouts][timeouts] (optional)
fields.
[filters][filters] (optional), [backendRefs][backendRef] (optional),
[timeouts][timeouts] (optional), and [name][name] (optional) fields.

The following illustrates an HTTPRoute that sends all traffic to one Service:
![httproute-basic-example](/images/httproute-basic-example.svg)
Expand Down Expand Up @@ -193,7 +193,7 @@ Conformance levels are defined by the filter type:
- Implementers are encouraged to support "extended" filters.
- "Implementation-specific" filters have no API guarantees across implementations.

Specifying a core filter multiple times has unspecified or
Specifying a core filter multiple times has unspecified or
implementation-specific conformance.

All filters are expected to be compatible with each other except for the
Expand Down Expand Up @@ -233,7 +233,7 @@ on `weight` and other fields.
??? example "Experimental Channel since v1.0.0"

HTTPRoute timeouts have been part of the Experimental Channel since `v1.0.0`.
For more information on release channels, refer to our
For more information on release channels, refer to our
[versioning guide](/concepts/versioning).

HTTPRoute Rules include a `Timeouts` field. If unspecified, timeout behavior is implementation-specific.
Expand All @@ -256,16 +256,34 @@ The following example uses the `request` field which will cause a timeout if a c

Reference the [timeouts][timeouts] API documentation for additional details.

#### Name (optional)

??? example "Experimental Channel since v1.2.0"

This concept has been part of the Experimental Channel since `v1.2.0`.
For more information on release channels, refer to our
[versioning guide](/concepts/versioning).

HTTPRoute Rules include an optional `name` field. The applications for the name of a route rule are implementation-specific. It can be used to reference individual route rules by name from other resources, such as in the `sectionName` field of metaresources ([GEP-2648](https://gateway-api.sigs.k8s.io/geps/gep-2648/#apply-policies-to-sections-of-a-resource)), in the status stanzas of resources related to the route object, to identify internal configuration objects generated by the implementation from HTTPRoute Rule, etc.

If specified, the value of the name field must comply with the [`SectionName`](https://github.com/kubernetes-sigs/gateway-api/blob/v1.0.0/apis/v1/shared_types.go#L607-L624) type.

The following example specifies the `name` field to identify HTTPRoute Rules used to split traffic between a _read-only_ backend service and a _write-only_ one:

```yaml
{% include 'experimental/http-route-rule-name.yaml' %}
```

##### Backend Protocol

??? example "Experimental Channel since v1.0.0"

This concept has been part of the Experimental Channel since `v1.0.0`.
For more information on release channels, refer to our
For more information on release channels, refer to our
[versioning guide](/concepts/versioning).

Some implementations may require the [backendRef][backendRef] to be labeled
explicitly in order to route traffic using a certain protocol. For Kubernetes
Some implementations may require the [backendRef][backendRef] to be labeled
explicitly in order to route traffic using a certain protocol. For Kubernetes
Service backends this can be done by specifying the [`appProtocol`][appProtocol]
field.

Expand Down

0 comments on commit a269e34

Please sign in to comment.