Bug 1877693 - dnsrecords specify recordTTL as 30 but the value is null in AWS Route 53
Summary: dnsrecords specify recordTTL as 30 but the value is null in AWS Route 53
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Candace Holman
QA Contact: Hongan Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-10 08:15 UTC by Hongan Li
Modified: 2022-08-04 22:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:17:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-ingress-operator pull 491 0 None closed Bug 1877693: dnsrecords specify recordTTL as 30 but the value is nul… 2021-02-02 21:14:10 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:18:17 UTC

Description Hongan Li 2020-09-10 08:15:40 UTC
Description of problem:
When checking https://bugzilla.redhat.com/show_bug.cgi?id=1869387#c4 and found that the DNSRecords shows incorrect Type and TTL for non-gov AWS cluster. e.g.

$ aws route53 list-resource-record-sets --hosted-zone-id $zone_id --query 'ResourceRecordSets[?contains(Name,`apps`)==`true`]' 
[
    {
        "Name": "\\052.apps.hongli-46bv.qe.devcluster.openshift.com.",
        "Type": "A",
        "AliasTarget": {
            "HostedZoneId": "ZLMOA37VPKANP",
            "DNSName": "a6bf1bd31181a4d64b3e8bd31d375aff-e3c151ab4f44d630.elb.us-east-2.amazonaws.com.",
            "EvaluateTargetHealth": false
        }
    }
]

$ oc -n openshift-ingress-operator get dnsrecords/default-wildcard -oyaml
spec:
  dnsName: '*.apps.hongli-46bv.qe.devcluster.openshift.com.'
  recordTTL: 30
  recordType: CNAME
  targets:
  - a6bf1bd31181a4d64b3e8bd31d375aff-e3c151ab4f44d630.elb.us-east-2.amazonaws.com



Version-Release number of selected component (if applicable):
4.6.0-0.nightly-2020-09-08-123737

How reproducible:
100%

Steps to Reproduce:
1. spin up a cluster on AWS (non-gov)
2. check the DNSRecords
   $ oc -n openshift-ingress-operator get dnsrecords/default-wildcard -oyaml
3. check the records that created by dns controller on AWS console (or by aws cli) 

Actual results:
The DNSRecords says Type is CNAME and TTL is 30, but actually the Type is A and TTL is null on AWS Route 53. 

Expected results:
1. The Type in DNSRecords should be "A".
2. Should set the TTL of apps records to 30 in AWS Route 53.

Additional info:

Comment 1 Andrew McDermott 2020-09-10 11:55:15 UTC
I’m adding UpcomingSprint, because I was occupied by fixing bugs with
higher priority/severity, developing new features with higher
priority, or developing new features to improve stability at a macro
level. I will revisit this bug next sprint.

Comment 2 mfisher 2020-09-15 16:15:28 UTC
Target set to 4.7 while investigation is either ongoing or pending.  Will be considered for earlier release versions when diagnosed and resolved.

Comment 3 Daneyon Hansen 2020-09-15 16:35:59 UTC
Hongan,

This is expected behavior. Ingress Operator will always create a CNAME record type and the provider implementation will convert the type if needed. We decided on this approach since Alias records are specific to AWS.

Comment 4 Hongan Li 2020-09-17 07:23:19 UTC
Hi Daneyon,
There are two issues listed in this BZ (since both in `dnsrecords.spec`, but if that confused then I can file new one)

First issue is about the CNAME, I agree with you that Alias is specific to AWS and provider implementation indeed create A (or CNAME for GovCloud) type.

And another issue is the TTL, seems it is not configured on AWS side. I'm updating the title to make it clearer.

Comment 5 Daneyon Hansen 2020-10-01 16:23:46 UTC
I’m adding UpcomingSprint because I was occupied by fixing bugs with higher priority/severity, developing new features with higher priority, or developing new features to improve stability at a macro level. I will revisit this bug next sprint.

Comment 6 Daneyon Hansen 2020-10-23 15:52:09 UTC
I’m adding UpcomingSprint because I was occupied by fixing bugs with higher priority/severity, developing new features with higher priority, or developing new features to improve stability at a macro level. I will revisit this bug next sprint.

Comment 7 Daneyon Hansen 2020-11-12 16:52:39 UTC
I’m adding UpcomingSprint because I was occupied by fixing bugs with higher priority/severity, developing new features with higher priority, or developing new features to improve stability at a macro level. I will revisit this bug next sprint.

Comment 8 Candace Holman 2020-11-16 20:03:10 UTC
Hi Hongan,

Thanks for noticing that the TTL did not show up on the AWS side.  However, in this case, the TTL actually should not appear, as TTL is not allowed for a Route 53 AliasTarget type. In summary, for non-gov-cloud Route 53, a CNAME record with TTL becomes an A record with no TTL. We have updated the comments in the code to reflect this special case.

Best Regards,
Candace

Comment 10 Hongan Li 2020-11-26 03:12:39 UTC
Tested with 4.7.0-0.nightly-2020-11-25-114114 and passed.

# oc explain dnsrecords.spec.recordTTL
KIND:     DNSRecord
VERSION:  ingress.operator.openshift.io/v1

FIELD:    recordTTL <integer>

DESCRIPTION:
     recordTTL is the record TTL in seconds. If zero, the default is 30.
     RecordTTL will not be used in AWS regions Alias targets, but will be used
     in CNAME targets, per AWS API contract.

Comment 13 errata-xmlrpc 2021-02-24 15:17:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


Note You need to log in before you can comment on or make changes to this bug.