-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Valentin Widmer
committed
Dec 14, 2023
1 parent
72c3395
commit dae1487
Showing
14 changed files
with
535 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Amazon VPC Lattice | ||
|
||
This pattern demonstrates how to expose an EKS cluster hosted application to an internal consumer through Amazon VPC Lattice. | ||
|
||
- [Documentation](https://docs.aws.amazon.com/vpc-lattice/latest/ug/what-is-vpc-lattice.html) | ||
- [AWS Gateway API Controller](https://www.gateway-api-controller.eks.aws.dev/) | ||
|
||
## Scenario | ||
|
||
With this soluton we showcase how to configure Amazon VPC Lattice using the AWS Gateway API Controller in order to manage Amazon VPC Lattice resources through native K8S Gateway API objects. This pattern deploys two distinct VPCs with a client application running in one of them and a server application in the other. The server application is deployed inside an EKS cluster and made exposed to the client application through Amazon VPC Lattice which establishes connectivity between the two applications. Further we demonstrate how to configure a custom domain name for the exposed service using Amazon Route53. | ||
|
||
![diagram](assets/diagram.png) | ||
|
||
|
||
## Deploy | ||
|
||
See [here](https://aws-ia.github.io/terraform-aws-eks-blueprints/getting-started/#prerequisites) for the prerequisites and steps to deploy this pattern. | ||
|
||
## Validate | ||
|
||
In order to test the connectivty between the client and server, please follow the steps outlined below: | ||
|
||
1. Login to the management console of your AWS account and navigate to the EC2 service | ||
2. Select your the EC2 Instance with the name **client**, click **Connect**, choose **Session Manager** and click **Connect** | ||
3. Within the console test the connecvity to the server application by entering the following command: | ||
|
||
```sh | ||
curl -I http://server.example.com | ||
``` | ||
|
||
If everythign works as expected yous should receive the following response: | ||
![output](assets/server-response.jpeg) | ||
|
||
## Destroy | ||
|
||
{% | ||
include-markdown "../../docs/_partials/destroy.md" | ||
%} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
name: demo-application | ||
description: A Helm chart to deploy the demo-application | ||
type: application | ||
version: 1.0.0 |
22 changes: 22 additions & 0 deletions
22
patterns/vpc-lattice/charts/demo-application/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: server | ||
labels: | ||
app: server | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: server | ||
template: | ||
metadata: | ||
labels: | ||
app: server | ||
spec: | ||
containers: | ||
- name: server | ||
image: public.ecr.aws/x2j8p8w7/http-server:latest | ||
env: | ||
- name: PodName | ||
value: "server pod" |
6 changes: 6 additions & 0 deletions
6
patterns/vpc-lattice/charts/demo-application/templates/gateway-class.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: GatewayClass | ||
metadata: | ||
name: amazon-vpc-lattice | ||
spec: | ||
controllerName: application-networking.k8s.aws/gateway-api-controller |
11 changes: 11 additions & 0 deletions
11
patterns/vpc-lattice/charts/demo-application/templates/gateway.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: Gateway | ||
metadata: | ||
name: my-services | ||
namespace: apps | ||
spec: | ||
gatewayClassName: amazon-vpc-lattice | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 |
20 changes: 20 additions & 0 deletions
20
patterns/vpc-lattice/charts/demo-application/templates/httproute.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: server | ||
namespace: apps | ||
spec: | ||
hostnames: | ||
- server.example.com | ||
parentRefs: | ||
- name: my-services | ||
sectionName: http | ||
rules: | ||
- backendRefs: | ||
- name: server | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: / |
11 changes: 11 additions & 0 deletions
11
patterns/vpc-lattice/charts/demo-application/templates/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: server | ||
spec: | ||
selector: | ||
app: server | ||
ports: | ||
- protocol: TCP | ||
port: 8090 | ||
targetPort: 8090 |
Oops, something went wrong.