Skip to content

Commit 64c59ac

Browse files
authored
Include review comments in user guide (#49)
* Include review comments in user guide * Update k8s version numbers on two figures * Small fixes * More small fixes * Fixed typo * Small rewording * Another typo
1 parent 04e9dc8 commit 64c59ac

File tree

3 files changed

+34
-55
lines changed

3 files changed

+34
-55
lines changed

docs/how-it-works.md

Lines changed: 34 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# AWS Gateway API Controller User Guide
22

3-
The AWS Gateway API Controller lets you connect services across multiple Kubernetes clusters, EC2 instances, containers, and serverless functions through a Gateway API interface.
4-
It does this by leveraging AWS VPC Lattice, which handles the connections to the AWS infrastructure, and Kubernetes Gateway API calls to manage Kubernetes objects.
3+
The AWS Gateway API Controller lets you connect services across multiple Kubernetes clusters through the Kubernetes Gateway API interface.
4+
It is also designed to connect services running on EC2 instances, containers, and as serverless functions.
5+
It does this by leveraging Amazon VPC Lattice, which works with Kubernetes Gateway API calls to manage Kubernetes objects.
56

67
This document describes how to set up the AWS Gateway API Controller and provides example use cases.
78
With the controller deployed and running, you will be able to manage services for multiple Kubernetes clusters and other targets on AWS through the following:
89

9-
* **CLI**: Use `aws` and `eksctl` to create clusters and set up AWS policies. Use `helm` to deploy the controller. Then use `kubectl` and YAML files to set up Kubernetes objects.
10+
* **CLI**: Use `aws` and `eksctl` to create clusters and set up AWS policies. Then use `kubectl` and YAML files to set up Kubernetes objects.
1011
* **AWS Console**: View VPC Lattice assets through the VPC area of the AWS console.
1112

1213
While separating the application developer from the details of the underling infrastructure, the controller also provides a Kubernetes-native experience, rather than creating a lot of new AWS ways of managing services.
@@ -15,7 +16,9 @@ This lets you work with Kubernetes service-related resources using Kubernetes AP
1516

1617
For more information on this technology, see [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io/).
1718

18-
**NOTE**: If you are new to the VPC Lattice service, keep in mind that names you use for objects must be unique across your entire account and not just across each cluster used by that account.
19+
A few things to keep in mind:
20+
* If you are new to the VPC Lattice service, keep in mind that names you use for objects must be unique across your entire account and not just across each cluster used by that account.
21+
* Your AWS CNI must be v1.8.0 or later to work with VPC Lattice.
1922

2023
## Deploying the Gateway API Controller
2124

@@ -26,7 +29,7 @@ Run through them again for a second cluster to use with the extended example sho
2629
```bash
2730
eksctl create cluster —name <my-cluster> —region us-west-2
2831
```
29-
1. Configure security group: To receive traffic from the VPC Lattice fleet, all Pods MUST explicitly configure a security group to allow traffic from the 169.254.171.0/24 address range.
32+
1. Configure security group: To receive traffic from the VPC Lattice fleet, you must set up security groups so that they allow all Pods communicating with VPC Lattice to allow traffic on all ports from the 169.254.171.0/24 address range. See [Control traffic to resources using security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) for details.
3033

3134
1. Create an IAM OIDC provider: See [Creating an IAM OIDC provider for your cluster](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html) for details.
3235
```bash
@@ -88,7 +91,7 @@ The second section extends that example by creating another inventory service on
8891

8992
This example creates a single cluster in a single VPC, then configures two routes (rates and inventory) and three services (parking, review, and inventory-1). The following figure illustrates this setup:
9093

91-
![Single cluster/VPC ervice-to-service communications](images/example1.png)
94+
![Single cluster/VPC service-to-service communications](images/example1.png)
9295

9396
**Steps**
9497

@@ -98,15 +101,15 @@ This example creates a single cluster in a single VPC, then configures two route
98101
```bash
99102
kubectl apply -f examples/my-hotel-gateway.yaml
100103
```
101-
1. Verify that `my-hotel` gateway is created:
104+
1. Verify that `my-hotel` gateway is created (this could take about five minutes):
102105
```bash
103106
kubectl get gateway
104107
```
105108
```
106109
NAME CLASS ADDRESS READY AGE
107110
my-hotel aws-lattice 7d12h
108111
```
109-
1. Find the VPC Lattice service network:
112+
1. Once the gateway is created, find the VPC Lattice service network:
110113
```bash
111114
kubectl get gateway my-hotel -o yaml
112115
```
@@ -126,7 +129,7 @@ This example creates a single cluster in a single VPC, then configures two route
126129
kubectl apply -f examples/review.yaml
127130
kubectl apply -f examples/rate-route-path.yaml
128131
```
129-
1. Create the Kubernetes HTTPRoute inventory:
132+
1. Create the Kubernetes HTTPRoute inventory (this could take about five minutes):
130133
```bash
131134
kubectl apply -f examples/inventory-ver1.yaml
132135
kubectl apply -f examples/inventory-route.yaml
@@ -168,41 +171,9 @@ This example creates a single cluster in a single VPC, then configures two route
168171
...
169172
</pre>
170173

171-
**Check Access to Services**
174+
**Check service connectivity**
172175

173-
1. During preview, you are required to install the VPC Lattice CLI:
174-
```bash
175-
aws configure add-model --service-model file://scripts/aws_sdk_model_override/models/apis/vpc-lattice/2022-11-30/api-2.json --service-name vpc-lattice
176-
```
177-
1. Use the VPC Lattice CLI to find the DNS name. You can use the `curl` command to get information about each service by adding the service name to the end of the HTTPRoute DNS name. Those names are gathered from AWS Route53 instead of Kubernetes CoreDNS.
178-
```bash
179-
aws vpc-lattice list-services \
180-
--endpoint-url=https://vpc-service-network.us-west-2.amazonaws.com (https://vpc-service-network.us-west-2.amazonaws.com/)
181-
```
182-
```
183-
{
184-
"items": [
185-
{
186-
"status": "ACTIVE",
187-
"name": "rates",
188-
"lastUpdatedAt": "2022-09-07T03:58:50.646Z",
189-
"arn": "arn:aws:vpc-service-network:us-west-2:694065802095:service/svc-00422586e3362607e",
190-
"id": "svc-00422586e3362607e",
191-
"createdAt": "2022-09-07T03:58:23.528Z"
192-
},
193-
{
194-
"status": "ACTIVE",
195-
"name": "inventory",
196-
"lastUpdatedAt": "2022-09-07T04:12:33.518Z",
197-
"arn": "arn:aws:vpc-service-network:us-west-2:694065802095:service/svc-0cd1a223d518754f3",
198-
"id": "svc-0cd1a223d518754f3",
199-
"createdAt": "2022-09-07T04:12:06.857Z"
200-
},
201-
...
202-
}
203-
```
204176
1. Check Service-Inventory Pod access for Service-Rates/parking or Service-Rates/review by execing into the pod, then curling each service.
205-
(Make sure security group is configured to allow 169.254.0.0/16 to receive traffic from lattice fleet.)
206177
```bash
207178
kubectl get pod
208179
```
@@ -215,6 +186,7 @@ This example creates a single cluster in a single VPC, then configures two route
215186
review-5888566ff6-2plsj 1/1 Running 0 101m
216187
review-5888566ff6-89fqk 1/1 Running 0 101m
217188
```
189+
1. Exec into an inventory pod to check connectivity to parking and review services:
218190
```bash
219191
kubectl exec -ti inventory-ver1-7bb6989d9d-2p2hk sh
220192
```
@@ -225,23 +197,34 @@ This example creates a single cluster in a single VPC, then configures two route
225197
```
226198
Requesting to Pod(parking-6cdcd5b4b4-g8dkb): parking handler pod
227199
```
228-
1. From inside of the pod, use `curl` to connect to the inventory service:
200+
1. From inside of the pod, use `curl` to connect to the review service:
229201
```bash
230-
curl rates-00422586e3362607e.7d67968.vpc-service-network-svcs.us-west-2.amazonaws.com/inventory
202+
curl rates-00422586e3362607e.7d67968.vpc-service-network-svcs.us-west-2.amazonaws.com/review
231203
```
232204
```
233-
Requesting to Pod(inventory-5888566ff6-89fqk): inventory handler pod
205+
Requesting to Pod(review-5888566ff6-89fqk): review handler pod
234206
```
235207
1. Exit the pod:
236208
```bash
237209
exit
238210
```
211+
1. Exec into a parking pod to check connectivity to the inventory-ver1 service:
212+
```bash
213+
kubectl exec -ti parking-6cdcd5b4b4-bbzvt sh
214+
```
215+
1. From inside of the parking pod, use `curl` to connect to the inventory-ver1 service:
216+
```bash
217+
curl inventory-00422586e3362607e.7d67968.vpc-service-network-svcs.us-west-2.amazonaws.com
218+
```
219+
```
220+
Requesting to Pod(inventory-ver1-7bb6989d9d-2p2hk): inventory-ver1 handler pod
221+
```
239222
### Set up multi-cluster/multi-VPC service-to-service communications
240223

241224
This sections builds on the previous section by migrating a Kubernetes service (HTTPRoute inventory) from one Kubernetes cluster to a different Kubernetes cluster.
242225
For example, it will:
243226

244-
* Migrate the Kubernetes inventory service from a Kubernetes v1.19 cluster to a Kubernetes v1.21 cluster in a different VPC.
227+
* Migrate the Kubernetes inventory service from a Kubernetes v1.21 cluster to a Kubernetes v1.23 cluster in a different VPC.
245228
* Scale up the Kubernetes inventory service to run it in another cluster (and another VPC) in addition to the current cluster.
246229

247230
The following figure illustrates this:
@@ -270,12 +253,11 @@ The following figure illustrates this:
270253
```bash
271254
kubectl config use-context <yourcluster2info>
272255
```
273-
274-
1. Import the Kubernetes inventory-ver2 into first cluster (Note: only if you have a single cloud desktop):
256+
1. Import the Kubernetes inventory-ver2 into first cluster:
275257
```bash
276258
kubectl apply -f examples/inventory-ver2-import.yaml
277259
```
278-
1. Update the HTTPRoute inventory to route 90% traffic to the first cluster and 10% traffic to the second cluster:
260+
1. Update the HTTPRoute inventory to route 10% traffic to the first cluster and 90% traffic to the second cluster:
279261
```bash
280262
kubectl apply -f examples/inventory-route-bluegreen.yaml
281263
```
@@ -288,13 +270,13 @@ The following figure illustrates this:
288270
curl inventory-0cd1a223d518754f3.7d67968.vpc-service-network-svcs.us-west-2.amazonaws.com
289271
```
290272
```
291-
Requsting to Pod(inventory-ver1-7bb6989d9d-2p2hk): inventory-ver1 handler pod <----> in 1st cluster
273+
Requesting to Pod(inventory-ver1-7bb6989d9d-2p2hk): inventory-ver1 handler pod <----> in 1st cluster
292274
```
293275
```bash
294276
curl inventory-0cd1a223d518754f3.7d67968.vpc-service-network-svcs.us-west-2.amazonaws.com
295277
```
296278
```
297-
Requsting to Pod(inventory-ver2-7bb6989d9d-2p2hk): inventory-ver2 handler pod <----> in 2nd cluster
279+
Requesting to Pod(inventory-ver2-7bb6989d9d-2p2hk): inventory-ver2 handler pod <----> in 2nd cluster
298280
```
299281
## Understanding the Gateway API Controller
300282

@@ -308,7 +290,7 @@ Someone wanting to run an application that is spread out in this way might find
308290
* Network connectivity and traffic routing
309291

310292
This is not a new problem.
311-
A common approach to interconnecting services that span multiple VPCs is to use service meshes, such as Istio or AWS App Mesh. But these require sidecars, which can introduce scaling problems and present their own management challenges.
293+
A common approach to interconnecting services that span multiple VPCs is to use service meshes. But these require sidecars, which can introduce scaling problems and present their own management challenges.
312294

313295
If you just want to run an application, you should be shielded from details needed to find assets across what are essentially multiple virtual data centers (represented by multiple VPCs). You should also have consistent ways of working with assets across your VPCs, even if those assets include different combinations of instances, clusters, containers, and serverless. And while making it simpler to run multi-VPC applications easier for users, administrators still need the tools to control and audit their resources to suit their company’s compliance needs.
314296

@@ -366,6 +348,3 @@ Notice that the Kubernetes Gateway API syntax is used to create the gateway, HTT
366348
* Application developer: Creates HTTPRoute objects that point to Kubernetes services, which in turn are directed to particular pods, in this case.
367349
This is all done by checking the related VPC Lattice Services (and related policies), Target Groups, and Targets
368350
Keep in mind that Target Groups v1 and v2 can be on different clusters in different VPCs.
369-
370-
## Further information
371-

docs/images/example1.png

-34 Bytes
Loading

docs/images/example2.png

31 Bytes
Loading

0 commit comments

Comments
 (0)