Skip to content

OCPBUGS-60492: Skip Gateway Service DNS record creation on platforms with ClusterHostedDNS is configured #1269

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sadasu
Copy link
Contributor

@sadasu sadasu commented Aug 14, 2025

When in-cluster DNS/custom-DNS is configured on AWS and GCP, skip creating Gateway Service DNS record.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 14, 2025
@openshift-ci-robot
Copy link
Contributor

@sadasu: This pull request references Jira Issue OCPBUGS-60492, which is invalid:

  • expected the bug to target the "4.20.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

When in-cluster DNS/custom-DNS is configured on AWS and GCP, skip creating Gateway Service DNS record.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from frobware and gcs278 August 14, 2025 11:04
@sadasu
Copy link
Contributor Author

sadasu commented Aug 14, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 14, 2025
@openshift-ci-robot
Copy link
Contributor

@sadasu: This pull request references Jira Issue OCPBUGS-60492, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @gpei

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from gpei August 14, 2025 11:04
Comment on lines 202 to 204
if !checkPlatformSupport(infraConfig) {
log.Info("infrastructure 'cluster' has unsupported configuration; reconciliation will be skipped")
return reconcile.Result{}, nil
}

domains := getGatewayHostnames(&gateway)
var errs []error
errs = append(errs, r.ensureDNSRecordsForGateway(ctx, &gateway, &service, domains.List(), infraConfig, dnsConfig)...)
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be useful to create the DNSRecord CR, but with dnsManagementState: Unmanaged, to serve as a reference for what DNS record the cluster-admin is expected to create. So I would suggest still calling ensureDNSRecordsForGateway but changing it to to set dnsManagementState: Unmanaged when the platform is not supported. Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My reasoning for putting the check here vs ensureDNSRecordsForGateway was that this check would give the same outcome for each domain within ensureDNSRecordsForGateway.

I see that creating the DNSRecord CR could be useful, so updated implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

My reasoning for putting the check here vs ensureDNSRecordsForGateway was that this check would give the same outcome for each domain within ensureDNSRecordsForGateway.

If you're concerned about the performance impact, you can call checkClusterHostedDNS (previously checkPlatformSupport) in Reconcile and pass the Boolean result to ensureDNSRecordsForGateway.

Comment on lines 291 to 294
// checkPlatformSupport return true if the platform supports gateway service dns.
// Gateway service dns is currently not supported when in-cluster DNS is configured
// for AWS or GCP platforms.
func checkPlatformSupport(infraConfig *configv1.Infrastructure) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor grammar and capitalization corrections:

Suggested change
// checkPlatformSupport return true if the platform supports gateway service dns.
// Gateway service dns is currently not supported when in-cluster DNS is configured
// for AWS or GCP platforms.
func checkPlatformSupport(infraConfig *configv1.Infrastructure) bool {
// checkPlatformSupport returns true if the platform supports gateway service DNS.
// Gateway service DNS is currently not supported when in-cluster DNS is configured
// for AWS or GCP platforms.
func checkPlatformSupport(infraConfig *configv1.Infrastructure) bool {

Also, I wonder whether the name might be misleading. We don't manage DNS at all on some platforms, but that isn't what this function checks; it only checks whether platforms on which we can manage the DNS records have some alternative custom DNS record management. Maybe a name like checkUsePlatformDefaultDNS? Or invert the Boolean value and condition, and rename the function to checkClusterHostedDNS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to invert the Boolean value and condition, and rename the function to checkClusterHostedDNS.

When ClusterHostedDNS is enabled, create Gateway Service DNS records
with DNS Policy `Unmanaged`.
@sadasu sadasu force-pushed the gateway-service-with-custom-dns branch from 8d7424c to fb9ca0b Compare August 14, 2025 21:10
@sadasu
Copy link
Contributor Author

sadasu commented Aug 15, 2025

/retest-required

@candita
Copy link
Contributor

candita commented Aug 15, 2025

It would be good to investigate this CI failure. It seems related to me, being GCP and DNS.

=== NAME TestAll/parallel/TestInternalLoadBalancerGlobalAccessGCP
operator_test.go:1295: Expected conditions: map[Admitted:True Available:True DNSManaged:True DNSReady:True LoadBalancerManaged:True LoadBalancerReady:True]
Current conditions: map[Admitted:True Available:False DNSManaged:True DNSReady:False Degraded:True DeploymentAvailable:True DeploymentReplicasAllAvailable:True DeploymentReplicasMinAvailable:True DeploymentRollingOut:False EvaluationConditionsDetected:False LoadBalancerManaged:True LoadBalancerProgressing:False LoadBalancerReady:False Progressing:False Upgradeable:True]
...
"message": "One or more other status conditions indicate a degraded state: LoadBalancerReady=False (SyncLoadBalancerFailed: The service-controller component is reporting SyncLoadBalancerFailed events like: Error syncing load balancer: failed to ensure load balancer: googleapi: Error 400: Resource 'projects/XXXXXXXXXXXXXXXXXXXXXX/zones/us-central1-c/instances/ci-op-b4v9j4c3-76b3b-j7ls4-worker-c-sz59r' is expected to be in the subnetwork 'projects/XXXXXXXXXXXXXXXXXXXXXX/regions/us-central1/subnetworks/ci-op-b4v9j4c3-76b3b-j7ls4-master-subnet' but is in the subnetwork 'projects/XXXXXXXXXXXXXXXXXXXXXX/regions/us-central1/subnetworks/ci-op-b4v9j4c3-76b3b-j7ls4-worker-subnet'., wrongSubnetwork\nThe cloud-controller-manager logs may contain more details.)"
},

Comment on lines +250 to +252
if checkClusterHostedDNS(infraConfig) {
dnsPolicy = iov1.UnmanagedDNS
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please explain in a comment how this solves the problem of missing DNS name for Gateway objects?

Copy link
Contributor Author

@sadasu sadasu Aug 16, 2025

Choose a reason for hiding this comment

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

custom-dns is enabled by the customer when they do not want OpenShift to use the cloud provider's default DNS. So, setting the dnsPolicy to iov1.UnmanagedDNS to cause the Gateway API controller to skip configuring the cloud's DNS.

Copy link
Contributor

@candita candita Aug 18, 2025

Choose a reason for hiding this comment

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

In that case, can the tests provide whatever DNS is likely to be used instead, or at least something resembling DNS? We can't just assume it all works without testing it. Changing the name of this PR might help too.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, can the tests provide whatever DNS is likely to be used instead, or at least something resembling DNS? We can't just assume it all works without testing it. Changing the name of this PR might help too.

The custom DNS CI workflows do that: install using on-cluster networking and then add user-provisioned DNS after the install. We will need to add those jobs to run in this repo.

@patrickdillon
Copy link
Contributor

patrickdillon commented Aug 18, 2025

I suspect we do not need this PR, or to perform a specific conditional for custom DNS

Results are in, and it looks like the installer configuring the DNS zones to nil is not sufficient to resolve this issue.

So I think we do need a check in the ingress controller, but I would not make it specific to custom DNS, but rather based on the presence of the cloud PrivateZone and PublicZone in the DNS config.

@sadasu
Copy link
Contributor Author

sadasu commented Aug 18, 2025

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 18, 2025
@Miciah
Copy link
Contributor

Miciah commented Aug 18, 2025

/approve
/lgtm

I prefer if the Git commit message references the Jira issue and follows the Kubernetes commit message guidelines, but the changes look fine to me.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2025
Copy link
Contributor

openshift-ci bot commented Aug 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2025
@sadasu
Copy link
Contributor Author

sadasu commented Aug 18, 2025

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 18, 2025
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD afb2160 and 2 for PR HEAD fb9ca0b in total

@sadasu
Copy link
Contributor Author

sadasu commented Aug 19, 2025

/retest-required

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD afb2160 and 2 for PR HEAD fb9ca0b in total

1 similar comment
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD afb2160 and 2 for PR HEAD fb9ca0b in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 52a0048 and 1 for PR HEAD fb9ca0b in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 52a0048 and 2 for PR HEAD fb9ca0b in total

1 similar comment
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 52a0048 and 2 for PR HEAD fb9ca0b in total

Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

@sadasu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-operator fb9ca0b link true /test e2e-gcp-operator

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@sadasu
Copy link
Contributor Author

sadasu commented Aug 20, 2025

/hold

We've identified that with custom-dns, when no Public and Private zones are specified in the DNS CR, no additional changes are required in the CIO for Gateway controller.
I think this PR can even be closed.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2025
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants