Open
Description
Describe the bug
When changing the name of a recordsets.route53.services.k8s.aws to update its DNS record, the controller creates a new record but does not delete the previous one. This behavior results in dangling records, which can lead to stale DNS entries and potential misconfigurations.
Steps to reproduce
- Create a recordsets.route53.services.k8s.aws resource, for example:
apiVersion: route53.services.k8s.aws/v1alpha1
kind: RecordSet
metadata:
name: test-http-default
namespace: test
spec:
aliasTarget:
dnsName: ------.cloudfront.net
evaluateTargetHealth: false
hostedZoneID: Z2FDTNDATAQYW2
hostedZoneID: Z-------
name: cato
recordType: A
- After the record is created, verify that the DNS record cato exists in the Route53 hosted zone.
- Now, edit the name field in the spec to change it from cato to cheto:
apiVersion: route53.services.k8s.aws/v1alpha1
kind: RecordSet
metadata:
name: test-http-default
namespace: test
spec:
aliasTarget:
dnsName: ------.cloudfront.net
evaluateTargetHealth: false
hostedZoneID: Z2FDTNDATAQYW2
hostedZoneID: Z-------
name: cheto
recordType: A
Expected outcome
The original record (cato) should be deleted, and a new record (cheto) should be created.
Environment
- Kubernetes version v1.30.4-eks-a737599
- AWS service Route-53