Skip to content

Commit f9d8f34

Browse files
author
Doyoon Kim
authored
Update deployment instructions (#516)
1 parent 68dbdcf commit f9d8f34

File tree

8 files changed

+135
-99
lines changed

8 files changed

+135
-99
lines changed

docs/concepts/custom-domain-name.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ AWS Gateway API Controller supports ExternalDNS integration through CRD source -
4343
The following example command runs ExternalDNS compiled from source, using AWS Route53 provider:
4444
```sh
4545
build/external-dns --source crd --crd-source-apiversion externaldns.k8s.io/v1alpha1 \
46-
--crd-source-kind DNSEndpoint --provider aws
46+
--crd-source-kind DNSEndpoint --provider aws --txt-prefix "prefix."
4747
```
4848
1. Create HTTPRoutes and Services. The controller should create `DNSEndpoint` resource owned by the HTTPRoute you created.
4949
1. ExternalDNS will watch the changes and create DNS record on the configured DNS provider.
5050

5151
## Notes
5252

53-
* You MUST have a registered domain name (e.g. `my-test.com`) in route53 and complete the `Prerequisites` mentioned in [Configure a custom domain name for your service](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-custom-domain-name.html#dns-associate-custom).
53+
* You MUST have a registered hosted zone (e.g. `my-test.com`) in route53 and complete the `Prerequisites` mentioned in [Configure a custom domain name for your service](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-custom-domain-name.html#dns-associate-custom).
5454
* If you are not using ExternalDNS, you should manually associate your custom domain name with your service following [Configure a custom domain name for your service](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-custom-domain-name.html#dns-associate-custom).
5555

docs/concepts/https.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,29 @@ If you want to use a custom domain name along with its own certificate, you can:
5353
* Follow instructions on [Requesting a public certificate](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html) and get an ACM certificate ARN.
5454
* Add the ARN to the listener configuration as shown below.
5555

56-
The following shows modifications to `examples/my-hotel.yaml` to add a custom certificate:
56+
The following shows modifications to `examples/my-hotel-gateway.yaml` to add a custom certificate:
5757
```
5858
apiVersion: gateway.networking.k8s.io/v1beta1
5959
kind: Gateway
6060
metadata:
6161
name: my-hotel
62+
annotations:
63+
application-networking.k8s.aws/lattice-vpc-association: "true"
6264
spec:
6365
gatewayClassName: amazon-vpc-lattice
6466
listeners:
6567
- name: http
6668
protocol: HTTP
6769
port: 80
6870
- name: https
69-
protocol: HTTPS
71+
protocol: HTTPS # This is required
7072
port: 443
71-
- name: tls-with-custom-cert # Specify listener with custom certs
72-
protocol: HTTPS # Specify HTTPS protocol
73-
port: 443 # Specify communication on port 443
74-
tls: # Specify TLS configuration
75-
mode: Terminate # Specify mode for TLS listener
76-
options: # Specify certificate options
77-
application-networking.k8s.aws/certificate-arn: arn:aws:acm:us-west-2:<account>:certificate/4555204d-07e1-43f0-a533-d02750f41545
73+
tls:
74+
mode: Terminate # This is required
75+
certificateRefs: # This is required per API spec, but currently not used by the controller
76+
- name: unused
77+
options: # Instead, we specify ACM certificate ARN under this section
78+
application-networking.k8s.aws/certificate-arn: arn:aws:acm:us-west-2:<account>:certificate/<certificate-id>
7879
```
7980
Note that only `Terminate` mode is supported (Passthrough is not supported).
8081

@@ -91,14 +92,14 @@ spec:
9192
parentRefs:
9293
- name: my-hotel
9394
sectionName: http
94-
- name: my-hotel # Specify parentRefs
95-
sectionName: tls-with-custom-cert # Specify custom-defined certificate
95+
- name: my-hotel # Use the listener defined above as parentRef
96+
sectionName: https
9697
...
97-
```
98+
```
9899

99100
### Enabling TLS connection on the backend
100101

101-
Currently TLS Passthrough mode is not supported in the controller, but it allows TLS re-encryption to support backends that only allow TLS connections.
102+
Currently, TLS Passthrough mode is not supported in the controller, but it allows TLS re-encryption to support backends that only allow TLS connections.
102103
To handle this use case, you need to configure your service to receive HTTPS traffic instead:
103104

104105
```

docs/concepts/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ With VPC Lattice you can also avoid some of these common problems:
5959
As a Kubernetes user, you can have a very Kubernetes-native experience using the VPC Lattice APIs.
6060
The following figure illustrates how VPC Lattice objects connect to [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io/) objects:
6161

62-
![VPC Lattice objects relation to Kubernetes objects](images/personae.png)
62+
![VPC Lattice objects relation to Kubernetes objects](../images/personae.png)
6363

6464
As shown in the figure, there are different personas associated with different levels of control in VPC Lattice.
6565
Notice that the Kubernetes Gateway API syntax is used to create the gateway, HTTPRoute and services, but Kubernetes gets the details of those items from VPC Lattice:

docs/deploy.md

Whitespace-only changes.

docs/faq.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
# Frequently Asked Questions (FAQ)
22

3-
Q: How can I get involved with AWS Gateway API Controller?
4-
A: We welcome general feedback, questions, feature requests, or bug reports by creating a [Github issue](https://github.com/aws/aws-application-networking-k8s/issues/new).
3+
* **Q: How can I get involved with AWS Gateway API Controller?**
54

6-
Q: Where can I find AWS Gateway API Controller releases?
7-
A: AWS Gateway API Controller releases are tags of the Github repository. The [Github releases page](https://github.com/aws/aws-application-networking-k8s/releases) shows all the releases.
5+
A: We welcome general feedback, questions, feature requests, or bug reports by creating a [Github issue](https://github.com/aws/aws-application-networking-k8s/issues/new).
86

9-
Q: Which EKS CNI versions are supported?
10-
A: Your AWS VPC CNI must be v1.8.0 or later to work with VPC Lattice.
7+
8+
* **Q: Where can I find AWS Gateway API Controller releases?**
9+
10+
A: AWS Gateway API Controller releases are tags of the Github repository. The [Github releases page](https://github.com/aws/aws-application-networking-k8s/releases) shows all the releases.
11+
12+
13+
* **Q: Which EKS CNI versions are supported?**
14+
15+
A: Your AWS VPC CNI must be v1.8.0 or later to work with VPC Lattice.
16+
17+
18+
* **Q: Which versions of Gateway API are supported?**
19+
20+
A: AWS Gateway API Controller supports Gateway API CRD bundle versions between v0.6.1 and v1.0.0.
21+
The controller does not reject other versions, but will provide "best effort support" to it.
22+
Not all features of Gateway API are supported - for detailed features and limitation, please refer to individual API references.
23+
24+
By default, Gateway API v0.6.1 CRD bundle is included in the helm chart.

docs/guides/deploy.md

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,36 @@
33
Follow these instructions to create a cluster and deploy the AWS Gateway API Controller.
44
Run through them again for a second cluster to use with the extended example shown later.
55

6-
**NOTE**: You can get the yaml files used on this page by cloning the [AWS Gateway API Controller for VPC Lattice](https://github.com/aws/aws-application-networking-k8s) site. The files are in the `examples/` directory.
6+
**NOTE**: You can get the yaml files used on this page by cloning the [AWS Gateway API Controller](https://github.com/aws/aws-application-networking-k8s) repository.
7+
8+
## Cluster Setup
9+
10+
### Using EKS Cluster
11+
12+
EKS is a simple, recommended way of preparing a cluster for running services with AWS Gateway API Controller.
713

814
1. Set your region and cluster name as environment variables. See the [Amazon VPC Lattice FAQs](https://aws.amazon.com/vpc/lattice/faqs/) for a list of supported regions. For this example, we use `us-west-2`:
915
```bash
1016
export AWS_REGION=us-west-2
1117
export CLUSTER_NAME=my-cluster
1218
```
13-
2. You can use an existing EKS cluster or create a new one as shown here:
19+
1. You can use an existing EKS cluster or create a new one as shown here:
1420
```bash
1521
eksctl create cluster --name $CLUSTER_NAME --region $AWS_REGION
1622
```
17-
3. Configure security group to receive traffic from the VPC Lattice network. You must set up security groups so that they allow all Pods communicating with VPC Lattice to allow traffic from the VPC Lattice managed prefix lists. See [Control traffic to resources using security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) for details. Lattice has both an IPv4 and IPv6 prefix lists available.
18-
23+
1. Configure security group to receive traffic from the VPC Lattice network. You must set up security groups so that they allow all Pods communicating with VPC Lattice to allow traffic from the VPC Lattice managed prefix lists. See [Control traffic to resources using security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) for details. Lattice has both an IPv4 and IPv6 prefix lists available.
1924
```bash
2025
CLUSTER_SG=$(aws eks describe-cluster --name $CLUSTER_NAME --output json| jq -r '.cluster.resourcesVpcConfig.clusterSecurityGroupId')
2126
PREFIX_LIST_ID=$(aws ec2 describe-managed-prefix-lists --query "PrefixLists[?PrefixListName=="\'com.amazonaws.$AWS_REGION.vpc-lattice\'"].PrefixListId" | jq -r '.[]')
2227
aws ec2 authorize-security-group-ingress --group-id $CLUSTER_SG --ip-permissions "PrefixListIds=[{PrefixListId=${PREFIX_LIST_ID}}],IpProtocol=-1"
2328
PREFIX_LIST_ID_IPV6=$(aws ec2 describe-managed-prefix-lists --query "PrefixLists[?PrefixListName=="\'com.amazonaws.$AWS_REGION.ipv6.vpc-lattice\'"].PrefixListId" | jq -r '.[]')
2429
aws ec2 authorize-security-group-ingress --group-id $CLUSTER_SG --ip-permissions "PrefixListIds=[{PrefixListId=${PREFIX_LIST_ID_IPV6}}],IpProtocol=-1"
2530
```
26-
3. 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.
31+
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.
2732
```bash
2833
eksctl utils associate-iam-oidc-provider --cluster $CLUSTER_NAME --approve --region $AWS_REGION
2934
```
30-
4. Create a policy (`recommended-inline-policy.json`) in IAM with the following content that can invoke the gateway API and copy the policy arn for later use:
35+
1. Create a policy (`recommended-inline-policy.json`) in IAM with the following content that can invoke the gateway API and copy the policy arn for later use:
3136
```bash
3237
{
3338
"Version": "2012-10-17",
@@ -57,15 +62,15 @@ Run through them again for a second cluster to use with the extended example sho
5762
--policy-name VPCLatticeControllerIAMPolicy \
5863
--policy-document file://examples/recommended-inline-policy.json
5964
```
60-
5. Create the `aws-application-networking-system` namespace:
65+
1. Create the `aws-application-networking-system` namespace:
6166
```bash
6267
kubectl apply -f examples/deploy-namesystem.yaml
6368
```
64-
6. Retrieve the policy ARN:
69+
1. Retrieve the policy ARN:
6570
```bash
6671
export VPCLatticeControllerIAMPolicyArn=$(aws iam list-policies --query 'Policies[?PolicyName==`VPCLatticeControllerIAMPolicy`].Arn' --output text)
6772
```
68-
7. Create an iamserviceaccount for pod level permission:
73+
1. Create an iamserviceaccount for pod level permission:
6974
```bash
7075
eksctl create iamserviceaccount \
7176
--cluster=$CLUSTER_NAME \
@@ -76,7 +81,53 @@ Run through them again for a second cluster to use with the extended example sho
7681
--region $AWS_REGION \
7782
--approve
7883
```
79-
8. Run either `kubectl` or `helm` to deploy the controller:
84+
85+
#### IPv6 support
86+
87+
IPv6 address type is automatically used for your services and pods if
88+
[your cluster is configured to use IPv6 addresses](https://docs.aws.amazon.com/eks/latest/userguide/cni-ipv6.html).
89+
90+
```bash
91+
# To create an IPv6 cluster
92+
kubectl apply -f examples/ipv6-cluster.yaml
93+
```
94+
95+
If your cluster is configured to be dual-stack, you can set the IP address type
96+
of your service using the `ipFamilies` field. For example:
97+
98+
```yaml
99+
apiVersion: v1
100+
kind: Service
101+
metadata:
102+
name: ipv4-target-in-dual-stack-cluster
103+
spec:
104+
ipFamilies:
105+
- "IPv4"
106+
selector:
107+
app: parking
108+
ports:
109+
- protocol: TCP
110+
port: 80
111+
targetPort: 8090
112+
```
113+
114+
115+
### Using a self-managed Kubernetes cluster
116+
117+
You can install AWS Gateway API Controller to a self-managed Kubernetes cluster in AWS.
118+
119+
The controller utilizes [IMDS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) to get necessary information from instance metadata, such as AWS account ID and VPC ID.
120+
If your cluster is using IMDSv2, ensure the hop limit is 2 or higher to allow the access from the controller:
121+
122+
```bash
123+
aws ec2 modify-instance-metadata-options --http-put-response-hop-limit 2 --region <region> --instance-id <instance-id>
124+
```
125+
126+
Alternatively, you can manually provide configuration variables when installing the controller, as described in the next section.
127+
128+
## Controller Installation
129+
130+
1. Run either `kubectl` or `helm` to deploy the controller. Check [Environment Variables](../concepts/environment.md) for detailed explanation of each configuration option.
80131
```bash
81132
kubectl apply -f examples/deploy-v0.0.18.yaml
82133
```
@@ -89,16 +140,17 @@ Run through them again for a second cluster to use with the extended example sho
89140
oci://public.ecr.aws/aws-application-networking-k8s/aws-gateway-controller-chart\
90141
--version=v0.0.18 \
91142
--set=serviceAccount.create=false --namespace aws-application-networking-system \
92-
# awsRegion, clusterVpcId, clusterName, awsAccountId are required for case where IMDS is NOT AVAILABLE, e.g Fargate, self-managed clusters with IMDS access blocked
143+
# awsRegion, clusterVpcId, awsAccountId are required for case IMDS is not available.
93144
--set=awsRegion= \
94145
--set=clusterVpcId= \
95-
--set=clusterName= \
96146
--set=awsAccountId= \
97-
# latticeEndpoint is required for the case where the VPC Lattice endpoint is being overridden
98-
--set=latticeEndpoint= \
99-
147+
# clusterName is required except for EKS cluster.
148+
--set=clusterName= \
149+
# When specified, the controller will automatically create a service network with the name.
150+
--set=defaultServiceNetwork=my-hotel
100151
```
101-
9. Create the `amazon-vpc-lattice` GatewayClass:
152+
1. Create the `amazon-vpc-lattice` GatewayClass:
102153
```bash
103154
kubectl apply -f examples/gatewayclass.yaml
104155
```
156+
1. You are all set! Check our [Getting Started Guide](getstarted.md) to try setting up service-to-service communication.

docs/guides/getstarted.md

Lines changed: 28 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,46 @@ The first part of this section provides an example of setting up of service-to-s
66
The second section extends that example by creating another inventory service on a second cluster on a different VPC, and spreading traffic to that service across the two clusters and VPCs.
77
Both clusters are created using `eksctl`, with both clusters created from the same account by the same cluster admin.
88

9-
Using these examples as a foundation, see the [Configuration](configure/index.md) section for ways to further configure service-to-service communications.
9+
Using these examples as a foundation, see the [Configuration](../concepts/index.md) section for ways to further configure service-to-service communications.
1010

1111

12-
**NOTE**: You can get the yaml files used on this page by cloning the [AWS Gateway API Controller for VPC Lattice](https://github.com/aws/aws-application-networking-k8s) site. The files are in the `examples/` directory.
12+
**NOTE**: You can get the yaml files used on this page by cloning the [AWS Gateway API Controller](https://github.com/aws/aws-application-networking-k8s) repository.
1313

1414
## Set up single-cluster/VPC service-to-service communications
1515

1616
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:
1717

18-
![Single cluster/VPC service-to-service communications](images/example1.png)
18+
![Single cluster/VPC service-to-service communications](../images/example1.png)
1919

2020
### Steps
2121

22-
**Set up service-to-service communications**
22+
#### Setup service-to-service communications
2323

24-
1. Use AWS CLI to create a VPC Lattice service network, with the name `my-hotel`:
24+
1. AWS Gateway API Controller needs a VPC Lattice service network to operate.
25+
When `DEFAULT_SERVICE_NETWORK` environment variable is specified, the controller will automatically configure a service network for you.
26+
For example:
2527
```bash
26-
aws vpc-lattice create-service-network --name my-hotel
27-
{
28-
"arn": "<my-hotel-sn-arn>",
29-
"authType": "NONE",
30-
"id": "<my-hotel-sn-id>",
31-
"name": "my-hotel"
32-
}
28+
helm upgrade gateway-api-controller \
29+
oci://281979210680.dkr.ecr.us-west-2.amazonaws.com/aws-gateway-controller-chart \
30+
--reuse-values \
31+
--set=defaultServiceNetwork=my-hotel
3332
```
34-
35-
1. Create the service network VPC association between current k8s cluster VPC and `my-hotel` service network:
36-
```bash
37-
aws vpc-lattice create-service-network-vpc-association --service-network-identifier <my-hotel-sn-id> --vpc-identifier <k8s-cluster-vpc-id>
38-
{
39-
"arn": "<snva-arn>",
40-
"createdBy": "<timestamp>",
41-
"id": "<snva-id>",
42-
"status": "CREATE_IN_PROGRESS"
43-
}
44-
```
45-
46-
Wait until above ServiceNetworkVpcAssociation status change to `ACTIVE`:
33+
Alternatively, you can use AWS CLI to manually create a VPC Lattice service network, with the name `my-hotel`:
4734
```bash
48-
aws vpc-lattice get-service-network-vpc-association --service-network-vpc-association-identifier snva-0041ace3a8658371e
35+
aws vpc-lattice create-service-network --name my-hotel # grab service network ID
36+
aws vpc-lattice create-service-network-vpc-association --service-network-identifier <service-network-id> --vpc-identifier <k8s-cluster-vpc-id>
37+
```
38+
Ensure the service network created above is ready to accept traffic, by checking if the VPC association status is `ACTIVE`:
39+
```bash
40+
aws vpc-lattice list-service-network-vpc-associations --vpc-id <k8s-cluster-vpc-id>
4941
{
50-
....
51-
"status": "ACTIVE",
42+
"items": [
43+
{
44+
...
45+
"status": "ACTIVE",
46+
...
47+
}
48+
]
5249
}
5350
```
5451
1. Create the Kubernetes Gateway `my-hotel`:
@@ -120,7 +117,8 @@ This example creates a single cluster in a single VPC, then configures two route
120117
echo $ratesFQDN $inventoryFQDN
121118
rates-default-034e0056410499722.7d67968.vpc-lattice-svcs.us-west-2.on.aws inventory-default-0c54a5e5a426f92c2.7d67968.vpc-lattice-svcs.us-west-2.on.aws
122119
```
123-
**Verify service-to-service communications**
120+
121+
#### Verify service-to-service communications
124122

125123
1. Check connectivity from the `inventory-ver1` service to `parking` and `review` services:
126124
```bash
@@ -150,7 +148,7 @@ For example, it will:
150148

151149
The following figure illustrates this:
152150

153-
![Multiple clusters/VPCs service-to-service communications](images/example2.png)
151+
![Multiple clusters/VPCs service-to-service communications](../images/example2.png)
154152

155153
### Steps
156154

@@ -204,32 +202,3 @@ The following figure illustrates this:
204202
Requsting to Pod(inventory-ver1-74fc59977-wg8br): Inventory-ver1 handler pod....
205203
```
206204
You can see that the traffic is distributed between *inventory-ver1* and *inventory-ver2* as expected.
207-
208-
## IPv6 Support
209-
210-
IPv6 address type is automatically used for your services and pods if
211-
[your cluster is configured to use IPv6 addresses](https://docs.aws.amazon.com/eks/latest/userguide/cni-ipv6.html).
212-
213-
```bash
214-
# To create an IPv6 cluster
215-
kubectl apply -f examples/ipv6-cluster.yaml
216-
```
217-
218-
If your cluster is configured to be dual-stack, you can set the IP address type
219-
of your service using the `ipFamilies` field. For example:
220-
221-
```yaml
222-
apiVersion: v1
223-
kind: Service
224-
metadata:
225-
name: ipv4-target-in-dual-stack-cluster
226-
spec:
227-
ipFamilies:
228-
- "IPv4"
229-
selector:
230-
app: parking
231-
ports:
232-
- protocol: TCP
233-
port: 80
234-
targetPort: 8090
235-
```

0 commit comments

Comments
 (0)