generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 71
Support ExternalDNS integration by DNSEndpoint #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5788d1d
Bump go version to 1.20
3f88a8e
Update github action
8ea8801
Update Go version on docker build
c2038c4
ExternalDNS DNSEndpoint support
cfb1b58
Add documentation
e378ef0
Merge branch 'main' into external-dns-crd
bba5168
Address comments and add unit test
6ecbacf
Address comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,94 @@ | ||
|
|
||
| --- | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.5.0 | ||
| api-approved.kubernetes.io: "https://github.com/kubernetes-sigs/external-dns/pull/2007" | ||
| creationTimestamp: null | ||
| name: dnsendpoints.externaldns.k8s.io | ||
| spec: | ||
| group: externaldns.k8s.io | ||
| names: | ||
| kind: DNSEndpoint | ||
| listKind: DNSEndpointList | ||
| plural: dnsendpoints | ||
| singular: dnsendpoint | ||
| scope: Namespaced | ||
| versions: | ||
| - name: v1alpha1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| properties: | ||
| apiVersion: | ||
| description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
| type: string | ||
| kind: | ||
| description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: DNSEndpointSpec defines the desired state of DNSEndpoint | ||
| properties: | ||
| endpoints: | ||
| items: | ||
| description: Endpoint is a high-level way of a connection between a service and an IP | ||
| properties: | ||
| dnsName: | ||
| description: The hostname of the DNS record | ||
| type: string | ||
| labels: | ||
| additionalProperties: | ||
| type: string | ||
| description: Labels stores labels defined for the Endpoint | ||
| type: object | ||
| providerSpecific: | ||
| description: ProviderSpecific stores provider specific config | ||
| items: | ||
| description: ProviderSpecificProperty holds the name and value of a configuration which is specific to individual DNS providers | ||
| properties: | ||
| name: | ||
| type: string | ||
| value: | ||
| type: string | ||
| type: object | ||
| type: array | ||
| recordTTL: | ||
| description: TTL for the record | ||
| format: int64 | ||
| type: integer | ||
| recordType: | ||
| description: RecordType type of record, e.g. CNAME, A, SRV, TXT etc | ||
| type: string | ||
| setIdentifier: | ||
| description: Identifier to distinguish multiple records with the same name and type (e.g. Route53 records with routing policies other than 'simple') | ||
| type: string | ||
| targets: | ||
| description: The targets the DNS record points to | ||
| items: | ||
| type: string | ||
| type: array | ||
| type: object | ||
| type: array | ||
| type: object | ||
| status: | ||
| description: DNSEndpointStatus defines the observed state of DNSEndpoint | ||
| properties: | ||
| observedGeneration: | ||
| description: The generation observed by the external-dns controller. | ||
| format: int64 | ||
| type: integer | ||
| type: object | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} | ||
| status: | ||
| acceptedNames: | ||
| kind: "" | ||
| plural: "" | ||
| conditions: [] | ||
| storedVersions: [] |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| # Configure a Custom Domain Name for HTTPRoute | ||
| When you create a HTTPRoute under `amazon-vpc-lattice` gatewayclass, the controller creates a AWS VPC Lattice Service during reconciliation. | ||
| VPC Lattice generates a unique Fully Qualified Domain Name (FQDN) for you; however, this auto-generated domain name is not easy to remember. | ||
|
|
||
| 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 | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
| ## Managing DNS records using ExternalDNS | ||
|
|
||
| To register custom domain names to your DNS provider, we recommend using [ExternalDNS](https://github.com/kubernetes-sigs/external-dns). | ||
| AWS Gateway API Controller supports ExternalDNS integration through CRD source - the controller will manage `DNSEndpoint` resource for you. | ||
|
|
||
| 1. Install `DNSEndpoint` CRD. This is bundled with both Gateway API Controller Helm chart and `examples/deploy-*.yaml` manifest, but also can be installed manually by the following command: | ||
| ```sh | ||
| kubectl apply -f config/crds/bases/externaldns.k8s.io_dnsendpoints.yaml | ||
| ``` | ||
| If the CRD does not exist, `DNSEndpoint` resource will not be created or managed by the controller. | ||
| 1. Restart the controller if running already. | ||
| 1. Run ExternalDNS controller watching `crd` source. | ||
| The following example command runs ExternalDNS compiled from source, using AWS Route53 provider: | ||
| ```sh | ||
| build/external-dns --source crd --crd-source-apiversion externaldns.k8s.io/v1alpha1 \ | ||
| --crd-source-kind DNSEndpoint --provider aws | ||
| ``` | ||
| 1. Create HTTPRoutes and Services. The controller should create `DNSEndpoint` resource owned by the HTTPRoute you created. | ||
| 1. ExternalDNS will watch the changes and create DNS record on the configured DNS provider. | ||
|
|
||
| ## Notes | ||
|
|
||
| * 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). | ||
| * 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). | ||
|
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.