Skip to content
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

Add AWS_INSTANCE_IPV6 support to the AWS-SD provider #4721

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

mjlshen
Copy link
Contributor

@mjlshen mjlshen commented Sep 4, 2024

Description
As reported in the issue, the AWS-SD provider did not support the AWS_INSTANCE_IPV6 attribute type: https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html

Fixes #4713

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 4, 2024
@mloiseleur
Copy link
Contributor

/ok-to-test
@mjlshen Thanks for this PR, it looks good. 🤔 Shouldn't it be added to documentation, too ?

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Sep 4, 2024
@mjlshen
Copy link
Contributor Author

mjlshen commented Sep 4, 2024

Thanks for this PR, it looks good. 🤔 Shouldn't it be added to documentation, too ?

@mloiseleur I took a brief look, but couldn't find a good place for documenting specific providers. I could work on extending the tutorial for this provider to have an IPv6 example? https://kubernetes-sigs.github.io/external-dns/v0.14.2/tutorials/aws-sd/ or if there was a different place you had in mind?

@mloiseleur
Copy link
Contributor

Since it's an update to the aws sd provider, yes, it make sense to me.

@szuecs
Copy link
Contributor

szuecs commented Sep 5, 2024

code lgtm from my side

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 18, 2024
@mloiseleur
Copy link
Contributor

@mjlshen would you please extend the aws sd tutorial with this information ?
After that, I think we are good to go.

@mjlshen
Copy link
Contributor Author

mjlshen commented Oct 19, 2024

Yes, sorry, I am trying, but struggling to reproduce this issue exactly. Will do once I figure it out.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 22, 2024
@mjlshen
Copy link
Contributor Author

mjlshen commented Oct 22, 2024

@mloiseleur Ok I finally figured out a way to create AAAA records with the AWS-SD provider. The main issue I ran into was the lack of dualstack load balancer support in the AWS-SD provider when compared to the AWS provider. Currently, whenever a load balancer is detected, the AWS-SD provider only creates an A record:

if ep.RecordType == endpoint.RecordTypeCNAME {
if p.isAWSLoadBalancer(target) {
attr[sdInstanceAttrAlias] = target
} else {
attr[sdInstanceAttrCname] = target
}

i.e. the AWS-SD doesn't have the equivalent of #1079 yet from the AWS provider. I chose to document this gap for now instead of attempting to also fix this in the PR, though I will also file an issue to track this.

Comment on lines 312 to 331
> The AWS-SD provider does not currently support dualstack loadbalancers and will only create A records for these at this time. See the AWS provider and the [AWS Load Balancer Controller Tutorial](./aws-load-balancer-controller.md) for dualstack loadbalancer support.

```yaml
apiVersion: v1
kind: Service
metadata:
name: nginx
annotations:
external-dns.alpha.kubernetes.io/hostname: nginx.external-dns-test.my-org.com
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ipFamilies:
- "IPv6"
type: NodePort
ports:
- port: 80
name: http
targetPort: 80
selector:
app: nginx
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The AWS-SD provider does not currently support dualstack loadbalancers and will only create A records for these at this time. See the AWS provider and the [AWS Load Balancer Controller Tutorial](./aws-load-balancer-controller.md) for dualstack loadbalancer support.
```yaml
apiVersion: v1
kind: Service
metadata:
name: nginx
annotations:
external-dns.alpha.kubernetes.io/hostname: nginx.external-dns-test.my-org.com
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ipFamilies:
- "IPv6"
type: NodePort
ports:
- port: 80
name: http
targetPort: 80
selector:
app: nginx
```
```yaml
apiVersion: v1
kind: Service
metadata:
name: nginx
annotations:
external-dns.alpha.kubernetes.io/hostname: nginx.external-dns-test.my-org.com
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ipFamilies:
- "IPv6"
type: NodePort
ports:
- port: 80
name: http
targetPort: 80
selector:
app: nginx
```
:information_source: The AWS-SD provider does not currently support dualstack loadbalancers and will only create A records for these at this time. See the AWS provider and the [AWS Load Balancer Controller Tutorial](./aws-load-balancer-controller.md) for dualstack loadbalancer support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks, updated! I also changed loadbalancer --> load balancer because I realized that it should be two words :D

@mloiseleur
Copy link
Contributor

I have tiny suggestion about documentation order and we are good to go.
Thanks @mjlshen 👍

@mloiseleur
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 22, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mloiseleur

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 22, 2024
@k8s-ci-robot k8s-ci-robot merged commit 4033eec into kubernetes-sigs:master Oct 22, 2024
13 checks passed
@mjlshen mjlshen deleted the 4713-aws-sd-ipv6 branch October 22, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External-dns pod crash looping on EKS IPV6 clusters when using provider aws-sd
4 participants