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

Registering multiple hostnames fails because of newline character #4390

Open
wandb-zacharyblasczyk opened this issue Apr 16, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@wandb-zacharyblasczyk
Copy link

What happened:

I have created an ingress with the following annotations to be able to access my k8s service via ALB from multiple hostnames.

apiVersion: v1
items:
- apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    annotations:
      alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:..../a08f50c0-3a50-4dde-bd7f-676060c01e5e
      alb.ingress.kubernetes.io/inbound-cidrs: |
        0.0.0.0/0,10.0.0.0/16
      alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]'
      alb.ingress.kubernetes.io/load-balancer-name: example-alb-k8s
      alb.ingress.kubernetes.io/scheme: internet-facing
      alb.ingress.kubernetes.io/target-type: ip
      external-dns.alpha.kubernetes.io/hostname: |
        subdomain-a.hostedzone.com,subdomain-b.hostedzone.com
      external-dns.alpha.kubernetes.io/ingress-hostname-source: annotation-only

Debug logs indicate an erroneous newline character \n in the DNS record for subdomain-b.hostedzone.com:

time="..." level=debug 
msg="Endpoints generated from ingress: default/example: 
[subdomain-a.hostedzone.com 0 IN CNAME  ${ALB_DNS} [] subdomain-b.hostedzone.com/n 0 IN CNAME  ${ALB_DNS} []]"

What you expected to happen:

I expected external DNS to create two sets of records, one for each of the following:

  • subdomain-a.hostedzone.com
  • subdomain-b.hostedzone.com

Ideally, whitespace should be handled similarly to how the AWS Load Balancer does for the alb.ingress.kubernetes.io/inbound-cidrs.

How to reproduce it (as minimally and precisely as possible):

Annotate your ingress with both of these:

external-dns.alpha.kubernetes.io/hostname: |
  subdomain-a.hostedzone.com,subdomain-b.hostedzone.com
external-dns.alpha.kubernetes.io/ingress-hostname-source: annotation-only

Environment:

  • External-DNS version (use external-dns --version): registry.k8s.io/external-dns/external-dns:v0.14.0
  • DNS provider: Route53
@wandb-zacharyblasczyk wandb-zacharyblasczyk added the kind/bug Categorizes issue or PR as related to a bug. label Apr 16, 2024
@wandb-zacharyblasczyk wandb-zacharyblasczyk changed the title Registering multiple Registering multiple hostname fails because of newline character Apr 16, 2024
@wandb-zacharyblasczyk wandb-zacharyblasczyk changed the title Registering multiple hostname fails because of newline character Registering multiple hostnames fails because of newline character Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant