Uh oh!
There was an error while loading. Please reload this page.
OPNET-678: Add internalDNSRecords field - #2460
Conversation
Hello @cybertron! Some important instructions when contributing to openshift/api: |
Skipping CI for Draft Pull Request. |
| // api, api-int, and ingress. | ||
| // +kubebuilder:validation:Optional | ||
| // +kubebuilder:validation:Enum=Enabled;Disabled | ||
| // +openshift:validation:featureGate=OnPremInternalDNSRecords |
There was a problem hiding this comment.
AFAIK, this isn't a real marker. Let's remove this.
There was a problem hiding this comment.
Heh, yeah I was throwing stuff at the wall when I had trouble with the feature gate.
| // internalDNSRecords determines whether we deploy with internal records enabled for | ||
| // api, api-int, and ingress. | ||
| // +kubebuilder:validation:Optional |
There was a problem hiding this comment.
This is essentially a duplicate of the +optional marker below. We prefer the use of the +optional marker so let's remove this one.
| // +openshift:validation:featureGate=OnPremInternalDNSRecords | ||
| // +openshift:enable:FeatureGate=OnPremInternalDNSRecords | ||
| // +optional | ||
| InternalDNSRecords InternalDNSRecordsType `json:"internalDNSRecords"` |
There was a problem hiding this comment.
Because this is an optional field and the zero value is invalid, this should have omitempty.
| type InternalDNSRecordsType string | ||
| const ( | ||
| InternalDNSRecordsDisabled InternalDNSRecordsType = "Disabled" | ||
| InternalDNSRecordsEnabled InternalDNSRecordsType = "Enabled" | ||
| ) |
There was a problem hiding this comment.
Normally we try to avoid the terminology Enabled and Disabled where possible because the terms can often be overloaded and cause confusion.
What if instead of naming the field this applies to internalDNSRecords, what if we named it something like dnsRecordsPolicy (or maybe dnsRecordsType? not sure which one is better) and we had Internal and External as the options?
| // internalDNSRecords determines whether we deploy with internal records enabled for | ||
| // api, api-int, and ingress. |
There was a problem hiding this comment.
Please include validation constraints in the GoDoc here so that this is more end-user friendly. This is the text used in our generated API documentation and what users will see when they use something like oc explain ... so we should make sure it reads appropriately as end-user documentation.
Some good guidelines for things to take into consideration for inclusion in the GoDoc are here: https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#write-user-readable-documentation-in-godoc
| // internalDNSRecords determines whether we deploy with internal records enabled for | ||
| // api, api-int, and ingress. | ||
| // +kubebuilder:validation:Optional | ||
| // +kubebuilder:validation:Enum=Enabled;Disabled | ||
| // +openshift:validation:featureGate=OnPremInternalDNSRecords | ||
| // +openshift:enable:FeatureGate=OnPremInternalDNSRecords | ||
| // +optional | ||
| InternalDNSRecords InternalDNSRecordsType `json:"internalDNSRecords"` | ||
There was a problem hiding this comment.
This looks like we have only added this to the BareMetalPlatformStatus type? Is this because the OpenShift installer will end up setting this value at install time?
There was a problem hiding this comment.
If I understand the EP correctly as well, this sounds like this should only be possible to set when loadBalancer is set to UserManaged?
Do we need some additional validation logic (maybe a CEL expression) to enforce that?
There was a problem hiding this comment.
Yes, this will be populated by the installer. I have a validation in the installer to ensure it isn't set when it shouldn't be, but I can move that here if it would be better.
I should also note that this is only a partial version of the change. Because these are per-platform types we'll need to apply the same change to the other on-prem platforms once we know what it should look like.
JoelSpeed
commented
Sep 9, 2025
/test lint |
3ddd0ad to
09cb604Comparecybertron
commented
Sep 17, 2025
I think this latest revision should address all of the comments so far, except moving the validation to the api layer. If we ever make this modifiable after initial install we'll have to do that, but I'd just as soon defer that effort until/if it's needed. Willing to move it here if you'd prefer though. |
| // +optional | ||
| LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"` | ||
| // DNSRecordsType determines whether records for api, api-int, and ingress |
There was a problem hiding this comment.
| // DNSRecordsType determines whether records for api, api-int, and ingress | |
| // dnsRecordsType determines whether records for api, api-int, and ingress |
| // are provided by the internal DNS service or externally. `Internal` configures | ||
| // DNS records in the internal service. `External` means no records will be |
There was a problem hiding this comment.
Internal allows DNS resolution for components within the cluster right? It's configuring coredns?
There was a problem hiding this comment.
It's configuring a coredns instance on each host. This is separate from the coredns pod that is part of the dns-operator.
| // DNSRecordsType determines whether records for api, api-int, and ingress | ||
| // are provided by the internal DNS service or externally. `Internal` configures | ||
| // DNS records in the internal service. `External` means no records will be | ||
| // provided and must be configured external to the cluster. `External` is only | ||
| // allowed when a user-managed loadbalancer is configured. When unset, the | ||
| // internal records will be provided. | ||
| // api, api-int, and ingress. |
There was a problem hiding this comment.
For enum based fields we generally try to follow a pattern like:
dnsRecordsType ...
Allowed values are Internal, External, and omitted.
When set to Internal, ...
When set to External, ...
When omitted, ...
| DNSRecordsExternal DNSRecordsType = "External" | ||
| DNSRecordsInternal DNSRecordsType = "Internal" |
There was a problem hiding this comment.
| DNSRecordsExternalDNSRecordsType="External" | |
| DNSRecordsInternalDNSRecordsType="Internal" | |
| DNSRecordsTypeExternalDNSRecordsType="External" | |
| DNSRecordsTypeInternalDNSRecordsType="Internal" |
everettraven
commented
Sep 19, 2025
Is this API currently immutable? How do we enforce that? |
cybertron
commented
Sep 23, 2025
This field is only part of the Infrastructure status. There's nothing in the spec to allow it to be modified. |
cybertron
commented
Sep 23, 2025
Oh shoot, I had some stale changes in my editor. I'll fix that. |
569c8f8 to
80ec627CompareUh oh!
There was an error while loading. Please reload this page.
| // When set to `External`, records are not provided by the internal infrastructure | ||
| // and must be configured by the user. This value may only be set when a | ||
| // user-managed loadbalancer is configured. | ||
| // When omitted, the behavior will be the same as `Internal`. |
There was a problem hiding this comment.
For the omitted scenario we have some standard terminology we've used throughout OpenShift APIs:
When omitted, this means the user has no opinion and the platform is left
to choose reasonable defaults. These defaults are subject to change over time.
The current default is {default}
80ec627 to
862d02eCompare862d02e to
5e9cb14Comparecybertron
commented
Oct 16, 2025
Rebased and marking ready for review |
everettraven
commented
Oct 20, 2025
@cybertron It looks like this needs a rebase. Could you also update the PR description to provide some additional information as to what work with PR is associated with? Thanks! |
5e9cb14 to
88219abCompare41fd623 to
c72fe4dCompareopenshift-ci-robot
commented
Nov 12, 2025
Scheduling tests matching the |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cybertron
commented
Nov 12, 2025
/verified by @cybertron I've tested this by vendoring it into the affected projects in my local dev cluster. |
openshift-ci-robot
commented
Nov 12, 2025
@cybertron: This PR has been marked as verified by DetailsIn response to this:
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-robot
commented
Nov 12, 2025
cybertron
commented
Nov 13, 2025
/retest-required This should have no effect on an aws cluster. Looks like maybe a quota issue? |
cybertron
commented
Nov 13, 2025
/retest-required As far as I can tell, this is failing on the following error: Which appears to be a server-side issue on console.redhat.com. |
cybertron
commented
Nov 13, 2025
/retest-required And now we're failing on rate limiting from AWS. |
cybertron
commented
Nov 14, 2025
/retest-required I see this job finally passed last night, hopefully the issues have been fixed. |
openshift-ci-robot
commented
Nov 14, 2025
cybertron
commented
Nov 14, 2025
/retest-required Failed on a totally different set of tests this time. :-/ |
cybertron
commented
Nov 17, 2025
/retest-required |
@cybertron: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Uh oh!
There was an error while loading. Please reload this page.
Pulling in the internalDNSRecords field from openshift/api#2460
Pulling in the internalDNSRecords field from openshift/api#2460
Specifically looking to pull in the dnsRecordsType field from openshift/api#2460
Adds a new field to the Infrastructure object that allows control over the behavior of the on-prem internal DNS records. It can be set to either Internal or External, where Internal is the default (and previous) behavior, and External suppresses generation of the internal records so they can be managed outside the cluster. Currently, External can only be used with a UserManaged loadbalancer.