-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(azure): dns metadata (tags) support #5984
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
Open
vaspoz
wants to merge
3
commits into
kubernetes-sigs:master
Choose a base branch
from
vaspoz:azure-metadata-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -511,6 +511,62 @@ Ensure that your nginx-ingress deployment has the following arg: added to it: | |
|
|
||
| For more details see here: [nginx-ingress external-dns](https://github.com/kubernetes-sigs/external-dns/blob/HEAD/docs/faq.md#why-is-externaldns-only-adding-a-single-ip-address-in-route-53-on-aws-when-using-the-nginx-ingress-controller-how-do-i-get-it-to-use-the-fqdn-of-the-elb-assigned-to-my-nginx-ingress-controller-service-instead) | ||
|
|
||
| ## DNS Record Metadata (Tags) | ||
|
|
||
| External-DNS supports setting Azure resource metadata (tags) on DNS records using annotations on Kubernetes resources. | ||
|
|
||
| ### Usage with Ingress | ||
|
|
||
| ```yaml | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: my-ingress | ||
| annotations: | ||
| external-dns.alpha.kubernetes.io/azure-metadata-cost-center: "12345" | ||
| external-dns.alpha.kubernetes.io/azure-metadata-owner: backend-team | ||
| spec: | ||
| rules: | ||
| - host: app.example.com | ||
| http: | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: my-service | ||
| port: | ||
| number: 80 | ||
| ``` | ||
|
|
||
| ### Usage with Gateway API (HTTPRoute) | ||
|
|
||
| ```yaml | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | ||
| metadata: | ||
| name: my-route | ||
| annotations: | ||
| external-dns.alpha.kubernetes.io/azure-metadata-environment: production | ||
| external-dns.alpha.kubernetes.io/azure-metadata-app: myapp | ||
| spec: | ||
| parentRefs: | ||
| - name: my-gateway | ||
| hostnames: | ||
| - "api.example.com" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: This is under discussion in gateway-api if this is what we should support or not. |
||
| rules: | ||
| - backendRefs: | ||
| - name: my-service | ||
| port: 8080 | ||
| ``` | ||
|
|
||
| **Note:** Metadata annotations must be placed directly on each route resource (HTTPRoute, TLSRoute, GRPCRoute, etc.). Gateway annotations are not automatically inherited by routes. | ||
|
|
||
| ### Annotation Format | ||
|
|
||
| Metadata annotations must follow the format: | ||
| `external-dns.alpha.kubernetes.io/azure-metadata-<key>: <value>` | ||
|
|
||
| ## Deploy ExternalDNS | ||
|
|
||
| Connect your `kubectl` client to the cluster you want to test ExternalDNS with. Then apply one of the following manifests file to deploy ExternalDNS. | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not looks consistent with other providers like aws or cloudflare
Could we have
Current approach will require way to many annotaions on objects, and I did not get from first look that two annotations actually represent tags. There are of course limitations on number of annotitionas and character limit on annotations values. I think we better be consistent for now.
Kubernetes has 63 characters limitation on the annotation name. Example
external-dns.alpha.kubernetes.io/azure-metadata-cost-centeris already 59....