-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Vanity Name and Bring Your Own Certificates (#85)
* Add environment variable to allow specifying lattice service endpoint * Update lattice sdk APIs to the version which contains BYOC * Update with right byoc SDK * Use 1st hostname of HTTProute as lattice customer-domain-name * Add logic to parse certARN and pass it to lattice * Postpone targetgroup/target reconcile during HTTPRoute delete (#83) * Add some examples that uses vanity name and customer own certificates * Add unit test on hostname parse logic * Add unit test for parsing certificate ARN * Fix go fmt * Add lattice-assigned-dns annotation to httproute * Add doc on how to configure custom domain name * minor update on custom domain name doc * Minor update to custom doman name doc * Add doc on BYOC certification * Add doc on BYOC * Add nil check to avoid crashing
- Loading branch information
1 parent
60dae41
commit 3f0846a
Showing
14 changed files
with
526 additions
and
48 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
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,33 @@ | ||
# Configure a Custom Domain Name for HTTPRoute | ||
Today when you create a HTTPRoute using `amazon-vpc-lattice` gatewayclass, Lattice gateway-api-controller creates a AWS VPC Lattice Service during reconciliation. And VPC Lattice generates a unique Fully Qualified Domain Name (FQDN). However, this VPC Lattice generated domain name is not easy for customers to remember and use. | ||
|
||
If you'd prefer to use a custom domain name for a HTTPRoute, you can specify them in hostname field of HTTPRoute. Here is one example | ||
|
||
``` | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: HTTPRoute | ||
metadata: | ||
name: review | ||
spec: | ||
hostnames: | ||
- review.my-test.com <----------- this is the custom domain name | ||
parentRefs: | ||
- name: my-hotel | ||
sectionName: http | ||
rules: | ||
- backendRefs: | ||
- name: review2 | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /review2 | ||
``` | ||
|
||
## Notes | ||
|
||
* You MUST have a registered domain name (e.g. `my-test.com`) in route53 and complete the `Prerequisites` mentioned in [TODO - public BYOC doc](http://dev-dsk-tnmat-1d-8836d755.us-east-1.amazon.com/mercury/build/AWSMercuryDocs/AWSMercuryDocs-3.0/AL2_x86_64/DEV.STD.PTHREAD/build/server-root/vpc-lattice/latest/ug/service-custom-domain-name.html#dns-associate-custom) | ||
|
||
* In addition, you NEED to manually associate your custom domain name with your service following [TODO - public BYOC doc](http://dev-dsk-tnmat-1d-8836d755.us-east-1.amazon.com/mercury/build/AWSMercuryDocs/AWSMercuryDocs-3.0/AL2_x86_64/DEV.STD.PTHREAD/build/server-root/vpc-lattice/latest/ug/service-custom-domain-name.html#dns-associate-custom). We do have [github issue](https://github.com/aws/aws-application-networking-k8s/issues/88), an enhancement request, to automate this process |
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,113 @@ | ||
# HTTPS and Bring Your Own Certificte (BYOC) | ||
## Securing Traffic using HTTPS | ||
|
||
Today, the HTTPRoute owner can specify all incoming traffic `MUST` use HTTPs. e.g. | ||
|
||
``` | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: Gateway | ||
metadata: | ||
name: my-hotel | ||
spec: | ||
gatewayClassName: amazon-vpc-lattice | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
- name: https <-------------- specify HTTPs listener | ||
protocol: HTTPS | ||
port: 443 | ||
``` | ||
|
||
``` | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: HTTPRoute | ||
metadata: | ||
name: rates | ||
spec: | ||
parentRefs: | ||
- name: my-hotel | ||
sectionName: http | ||
- name: my-hotel | ||
sectionName: https <--- specify all traffic MUST use HTTPs | ||
rules: | ||
- backendRefs: | ||
- name: parking | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /parking | ||
- backendRefs: | ||
- name: review | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /review | ||
``` | ||
|
||
In this case, VPC Lattice service will automatically generate a managed ACM certificate and use it for encryting client to service traffic. | ||
|
||
## Bring Your Own Certificate (BYOC) | ||
|
||
If customer desires to use custom domain name along with their own certificate, they can do following: | ||
* follow [TODO Bring Your Own Certicate DOC](http://dev-dsk-tnmat-1d-8836d755.us-east-1.amazon.com/mercury/build/AWSMercuryDocs/AWSMercuryDocs-3.0/AL2_x86_64/DEV.STD.PTHREAD/build/server-root/vpc-lattice/latest/ug/service-byoc.html), and get ACM certificate ARN | ||
* specify certificate ARN | ||
|
||
``` | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: Gateway | ||
metadata: | ||
name: my-hotel | ||
spec: | ||
gatewayClassName: amazon-vpc-lattice | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
- name: https | ||
protocol: HTTPS | ||
port: 443 | ||
- name: rates-with-custom-cert | ||
protocol: HTTPS | ||
port: 443 | ||
tls: | ||
mode: Terminate | ||
options: | ||
application-networking.k8s.aws/certificate-arn: arn:aws:acm:us-west-2:<account>:certificate/4555204d-07e1-43f0-a533-d02750f41545 | ||
``` | ||
|
||
* associate HTTPRoute to this | ||
|
||
``` | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: HTTPRoute | ||
metadata: | ||
name: rates | ||
spec: | ||
parentRefs: | ||
- name: my-hotel | ||
sectionName: http | ||
- name: my-hotel | ||
sectionName: rates-with-custom-cert <-----using custom defined certification | ||
rules: | ||
- backendRefs: | ||
- name: parking | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /parking | ||
- backendRefs: | ||
- name: review | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /review | ||
``` |
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,19 @@ | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: HTTPRoute | ||
metadata: | ||
name: review | ||
spec: | ||
hostnames: | ||
- review.my-test.com | ||
parentRefs: | ||
- name: my-hotel | ||
sectionName: http | ||
rules: | ||
- backendRefs: | ||
- name: review2 | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /review2 |
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/v1alpha2 | ||
kind: Gateway | ||
metadata: | ||
name: my-hotel | ||
spec: | ||
gatewayClassName: amazon-vpc-lattice | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
- name: https | ||
protocol: HTTPS | ||
port: 443 | ||
- name: tls-with-customer-cert | ||
protocol: HTTPS | ||
port: 443 | ||
tls: | ||
mode: Terminate | ||
options: | ||
application-networking.k8s.aws/certificate-arn: arn:aws:acm:us-west-2:<account>:certificate/4555204d-07e1-43f0-a533-d02750f41545 |
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,19 @@ | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: HTTPRoute | ||
metadata: | ||
name: review | ||
spec: | ||
hostnames: | ||
- review.my-test.com | ||
parentRefs: | ||
- name: my-hotel | ||
sectionName: tls-with-customer-cert | ||
rules: | ||
- backendRefs: | ||
- name: review1 | ||
kind: Service | ||
port: 8090 | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /review1 |
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
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
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
Oops, something went wrong.