Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-types/grpc-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This allows you to define and manage the routing of gRPC traffic within your Kub

### Annotations

- `application-networking.k8s.aws/lattice-assigned-domain-name`
- `application-networking.k8s.aws/lattice-assigned-domain-name`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: trailing space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is actually intended to create a line break. Seems like backslash doesn't work in mkdocs so this is an alternative to it

Represents a VPC Lattice generated domain name for the resource. This annotation will automatically set
when a `GRPCRoute` is programmed and ready.

Expand Down
2 changes: 1 addition & 1 deletion docs/api-types/http-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This allows you to define and manage the routing of HTTP and HTTPS traffic withi

### Annotations

- `application-networking.k8s.aws/lattice-assigned-domain-name`
- `application-networking.k8s.aws/lattice-assigned-domain-name`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same nit as above

Represents a VPC Lattice generated domain name for the resource. This annotation will automatically set
when a `HTTPRoute` is programmed and ready.

Expand Down
39 changes: 39 additions & 0 deletions docs/api-types/service-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ServiceExport API Reference

## Introduction

In AWS Gateway API Controller, `ServiceExport` enables a Service for multi-cluster traffic setup.
Clusters can import the exported service with [`ServiceImport`](service-import.md) resource.

Internally, creating a ServiceExport creates a standalone VPC Lattice [target group](https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html).
Even without ServiceImports, creating ServiceExports can be useful in case you only need the target groups created;
for example, using target groups in the VPC Lattice setup outside Kubernetes.
Comment on lines +8 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A second thought on it, I dont think we should advertise TG creation with ServiceExports, because TG now "ephemeral" with random suffix. It will break use of TG outside of controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target groups are not ephemeral, especially when created from ServiceExports. The only exception is when users intentionally change immutable fields, but that happens regardless of random suffix anyways.


Note that ServiceExport is not the implementation of Kubernetes [Multicluster Service APIs](https://multicluster.sigs.k8s.io/concepts/multicluster-services-api/);
instead AWS Gateway API Controller uses its own version of the resource for the purpose of Gateway API integration.

For more multi-cluster use cases and detailed explanation, please refer to [our recommended multi-cluster architecture](../guides/multi-cluster.md).

### Limitations
* The exported Service can only be used in HTTPRoutes. GRPCRoute is currently not supported.
* Limited to one ServiceExport per Service. If you need multiple exports representing each port,
you should create multiple Service-ServiceExport pairs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this mean?

If you need multiple exports representing each port, you should create multiple Service-ServiceExport pairs.

Sounds like we support multiple ServiceExports per Service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't, we need as many services as serviceexport.


### Annotations

* `application-networking.k8s.aws/port`
Represents which port of the exported Service will be used.
When a comma-separated list of ports is provided, the traffic will be distributed to all ports in the list.

## Example Configuration

The following yaml will create a ServiceExport for a Service named `service-1`:
```yaml
apiVersion: application-networking.k8s.aws/v1alpha1
kind: ServiceExport
metadata:
name: service-1
annotations:
application-networking.k8s.aws/port: "9200"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we show a list of comma-separated port in here, e.g.,
application-networking.k8s.aws/port: "9200,9201,9203"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is almost no chance that users will need comma-separated list behavior here, tbh I don't like that feature and I think it only causes confusion. I don't want to highlight that use case as an example.

spec: {}
```
55 changes: 55 additions & 0 deletions docs/api-types/service-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# ServiceImport API Reference

## Introduction

`ServiceImport` is a resource referring to a Service outside the cluster, paired with [`ServiceExport`](service-export.md)
resource defined in the other clusters.

Just like Services, ServiceImports can be a backend reference of HTTPRoutes. Along with the cluster's own Services
(and ServiceImports from even more clusters), you can distribute the traffic across multiple VPCs and clusters.

Note that ServiceImport is not the implementation of Kubernetes [Multicluster Service APIs](https://multicluster.sigs.k8s.io/concepts/multicluster-services-api/);
instead AWS Gateway API Controller uses its own version of the resource for the purpose of Gateway API integration.

For more multi-cluster use cases, please refer to [our recommended multi-cluster architecture](../guides/multi-cluster.md).

### Limitations
* ServiceImport shares the limitations of [ServiceExport](service-export.md).
* The controller only supports ServiceImport through HTTPRoute; sending traffic directly is not supported.
* BackendRef ports pointing to ServiceImport is not respected. Use [port annotation](service-export.md#annotations) of ServiceExport instead.

### Annotations
* `application-networking.k8s.aws/aws-eks-cluster-name`
(Optional) When specified, the controller will only find target groups exported from the cluster.
* `application-networking.k8s.aws/aws-vpc`
(Optional) When specified, the controller will only find target groups exported from the cluster with the provided VPC ID.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention these 2 annotations are optional? The controller is able to automatically identify cluster name and vpc if not specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update this. btw the fields are optional but it is not like the controller automatically identifies them. They are like an additional sanity check when finding exported TG

## Example Configuration

The following yaml imports `service-1` exported from the designated cluster.
```yaml
apiVersion: application-networking.k8s.aws/v1alpha1
kind: ServiceImport
metadata:
name: service-1
annotations:
application-networking.k8s.aws/aws-eks-cluster-name: "service-1-owner-cluster"
application-networking.k8s.aws/aws-vpc: "service-1-owner-vpc-id"
spec: {}
```

The following example HTTPRoute directs traffic to the above ServiceImport.
```yaml
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: my-route
spec:
parentRefs:
- name: my-gateway
sectionName: http
rules:
- backendRefs:
- name: service-1
kind: ServiceImport
```
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ nav:
- HTTPRoute: api-types/http-route.md
- IAMAuthPolicy: api-types/iam-auth-policy.md
- Service: api-types/service.md
- ServiceExport: api-types/service-export.md
- ServiceImport: api-types/service-import.md
- TargetGroupPolicy: api-types/target-group-policy.md
- VpcAssociationPolicy: api-types/vpc-association-policy.md
- Contributing:
Expand Down