Skip to content

Commit 68dbdcf

Browse files
xWinkShawn Kaplan
andauthored
HTTPRoute, Service, and IAMAuthPolicy Documentation Enhancements (#514)
Co-authored-by: Shawn Kaplan <kapshawn@amazon.com>
1 parent 8998615 commit 68dbdcf

File tree

8 files changed

+273
-274
lines changed

8 files changed

+273
-274
lines changed

docgen/api-reference-base.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# API Reference
22

3-
This page contains the API field specification for Gateway API.
3+
This page contains the API specification for Custom Resource Definitions supported by the Application Networking K8s Controller.
44

docs/api-types/access-log-policy.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,6 @@ Gateways, HTTPRoutes, and GRPCRoutes by specifying a destination for the access
99
- When an AccessLogPolicy is created for a Gateway target, VPC Lattice traffic to any Route that is a child of that Gateway will have access logs published to the provided destination
1010
- When an AccessLogPolicy is created for an HTTPRoute or GRPCRoute target, VPC Lattice traffic to that Route will have access logs published to the provided destination
1111

12-
## Definition
13-
14-
| Field | Type | Description |
15-
|--------------|----------------------------------------------------------------------------------------------------------|--------------------------------------------------|
16-
| `apiVersion` | *string* | `application-networking.k8s.aws/v1alpha1` |
17-
| `kind` | *string* | `AccessLogPolicy` |
18-
| `metadata` | [*ObjectMeta*](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#objectmeta-v1-meta) | Kubernetes metadata for the resource. |
19-
| `spec` | *AccessLogPolicySpec* | Defines the desired state of AccessLogPolicy. |
20-
21-
### AccessLogPolicySpec
22-
23-
| Field | Type | Description |
24-
|---------------------------------------------|------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
25-
| `destinationArn` | *string* | The ARN of the Amazon S3 Bucket, Amazon CloudWatch Log Group, or Amazon Kinesis Data Firehose Delivery Stream that will have access logs published to it. |
26-
| `targetRef` | *[PolicyTargetReference](https://gateway-api.sigs.k8s.io/geps/gep-713/#policy-targetref-api)* | TargetRef points to the kubernetes `Gateway`, `HTTPRoute`, or `GRPCRoute` resource that will have this policy attached. This field is following the guidelines of Kubernetes Gateway API policy attachment. |
27-
2812
## Example Configurations
2913

3014
### Example 1

docs/api-types/grpc-route.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Introduction
44

55
With integration of the Gateway API, the EKS Controller project supports `GRPCRoute`.
6-
This allows you to specifically define and manage the routing of gRPC traffic within your Kubernetes cluster.
6+
This allows you to define and manage the routing of gRPC traffic within your Kubernetes cluster.
77

88
### GRPCRoute Key Features & Limitations:
99

@@ -70,4 +70,6 @@ In this example:
7070

7171
---
7272

73-
This `GRPCRoute` documentation provides a detailed introduction, feature set, and a basic example of how to configure and use the resource within the EKS Controller project. For in-depth details and specifications, you can refer to the official [Gateway API documentation](https://gateway-api.sigs.k8s.io/references/spec/#networking.x-k8s.io/v1alpha2.GRPCRoute).
73+
This `GRPCRoute` documentation provides a detailed introduction, feature set, and a basic example of how to configure
74+
and use the resource within the EKS Controller project. For in-depth details and specifications, you can refer to the
75+
official [Gateway API documentation](https://gateway-api.sigs.k8s.io/references/spec/#networking.x-k8s.io/v1alpha2.GRPCRoute).

docs/api-types/http-route.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# HTTPRoute API Reference
2+
3+
## Introduction
4+
5+
With integration of the Gateway API, the EKS Controller project supports `HTTPRoute`.
6+
This allows you to define and manage the routing of HTTP and HTTPS traffic within your Kubernetes cluster.
7+
8+
### HTTPRoute Key Features & Limitations:
9+
10+
**Features**:
11+
12+
- **Routing Traffic**: Enables routing HTTP traffic to servers within your Kubernetes cluster.
13+
- **Path and Method Matching**: The `HTTPRoute` allows for matching by:
14+
- An exact path.
15+
- Any path with a specified prefix.
16+
- A specific HTTP Method.
17+
- **Header Matching**: Enables matching based on specific headers in the HTTP request.
18+
19+
**Limitations**:
20+
21+
- **Listener Protocol**: The `HTTPRoute` sectionName must refer to an HTTP or HTTPS listener in the parent `Gateway`.
22+
- **Method Matches**: One method match is allowed within a single rule.
23+
- **QueryParam Matches**: Matching by QueryParameters is not supported.
24+
- **Header Matches Limit**: A maximum of 5 header matches per rule is supported.
25+
- **Case Insensitivity**: All path matches are currently case-insensitive.
26+
27+
## Example Configuration:
28+
29+
### Example 1
30+
31+
Here is a sample configuration that demonstrates how to set up an `HTTPRoute` that forwards HTTP traffic to a
32+
Service and ServiceImport, using rules to determine which backendRef to route traffic to.
33+
34+
```yaml
35+
apiVersion: gateway.networking.k8s.io/v1beta1
36+
kind: HTTPRoute
37+
metadata:
38+
name: inventory
39+
spec:
40+
parentRefs:
41+
- name: my-hotel
42+
sectionName: http
43+
rules:
44+
- backendRefs:
45+
- name: inventory-ver1
46+
kind: Service
47+
port: 80
48+
matches:
49+
- path:
50+
type: PathPrefix
51+
value: /ver1
52+
- backendRefs:
53+
- name: inventory-ver2
54+
kind: ServiceImport
55+
port: 80
56+
matches:
57+
- path:
58+
type: PathPrefix
59+
value: /ver2
60+
```
61+
62+
In this example:
63+
64+
- The `HTTPRoute` is named `inventory` and is associated with a parent gateway named `my-hotel` that has
65+
a section named `http`.
66+
- The first routing rule forwards traffic to a backend Service named `inventory-ver1` on port `80`.
67+
The rule also specifies a path match condition, where traffic must have a path starting with `/ver1` for the routing
68+
rule to apply.
69+
- The second routing rule forwards traffic to a backend ServiceImport named `inventory-ver2` on port `80`.
70+
The rule also specifies a path match condition, where traffic must have a path starting with `/ver2` for the routing
71+
rule to apply.
72+
73+
### Example 2
74+
75+
Here is a sample configuration that demonstrates how to set up a `HTTPRoute` that forwards HTTP and HTTPS traffic to a
76+
Service and ServiceImport, using weighted rules to route more traffic to one backendRef than the other. Weighted rules
77+
simplify the process of creating blue/green deployments by shifting rule weight from one backendRef to another.
78+
79+
```yaml
80+
apiVersion: gateway.networking.k8s.io/v1beta1
81+
kind: HTTPRoute
82+
metadata:
83+
name: inventory
84+
spec:
85+
parentRefs:
86+
- name: my-hotel
87+
sectionName: http
88+
- name: my-hotel
89+
sectionName: https
90+
rules:
91+
- backendRefs:
92+
- name: inventory-ver1
93+
kind: Service
94+
port: 80
95+
weight: 10
96+
- name: inventory-ver2
97+
kind: ServiceImport
98+
port: 80
99+
weight: 90
100+
```
101+
102+
In this example:
103+
104+
- The `HTTPRoute` is named `inventory` and is associated with a parent gateway named `my-hotel` that has
105+
two sections, named `http` and `https`.
106+
- The first routing rule forwards traffic to a backend Service named `inventory-ver1` on port `80`.
107+
The rule also specifies a weight of `10`.
108+
- The second routing rule forwards traffic to a backend ServiceImport named `inventory-ver2` on port `80`.
109+
The rule also specifies a weight of `90`.
110+
- The amount of traffic forwarded to a backendRef is `(rule weight / total weight) * 100%`. Thus, 10% of the traffic is
111+
forwarded to `inventory-ver1` at port `80` and 90% of the traffic is forwarded to `inventory-ver2` at the default port.
112+
113+
---
114+
115+
This `HTTPRoute` documentation provides a detailed introduction, feature set, and a basic example of how to configure
116+
and use the resource within the EKS Controller project. For in-depth details and specifications, you can refer to the
117+
official [Gateway API documentation](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1alpha2.HTTPRoute).

0 commit comments

Comments
 (0)