Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ const (
LoadBalancerTypeOpenShiftManagedDefault PlatformLoadBalancerType = "OpenShiftManagedDefault"
)

type InternalDNSRecordsType string

const (
InternalDNSRecordsDisabled InternalDNSRecordsType = "Disabled"
InternalDNSRecordsEnabled InternalDNSRecordsType = "Enabled"
)
Comment on lines +186 to +191
Copy link
Contributor

Choose a reason for hiding this comment

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

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?


// PlatformType is a specific supported infrastructure provider.
// +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt;EquinixMetal;PowerVS;AlibabaCloud;Nutanix;External
type PlatformType string
Expand Down Expand Up @@ -1026,6 +1033,15 @@ type BareMetalPlatformStatus struct {
// +optional
LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`

// internalDNSRecords determines whether we deploy with internal records enabled for
// api, api-int, and ingress.
Comment on lines +1036 to +1037
Copy link
Contributor

Choose a reason for hiding this comment

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

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

// +kubebuilder:validation:Optional
Copy link
Contributor

Choose a reason for hiding this comment

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

This is essentially a duplicate of the +optional marker below. We prefer the use of the +optional marker so let's remove this one.

// +kubebuilder:validation:Enum=Enabled;Disabled
// +openshift:validation:featureGate=OnPremInternalDNSRecords
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, this isn't a real marker. Let's remove this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Heh, yeah I was throwing stuff at the wall when I had trouble with the feature gate.

// +openshift:enable:FeatureGate=OnPremInternalDNSRecords
// +optional
InternalDNSRecords InternalDNSRecordsType `json:"internalDNSRecords"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is an optional field and the zero value is invalid, this should have omitempty.


Comment on lines +1036 to +1044
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
// +listType=atomic
// +kubebuilder:validation:MaxItems=32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,14 @@ spec:
rule: 'self == oldSelf || (size(self) == 2 && isIP(self[0])
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
internalDNSRecords:
description: |-
internalDNSRecords determines whether we deploy with internal records enabled for
api, api-int, and ingress.
enum:
- Enabled
- Disabled
type: string
loadBalancer:
default:
type: OpenShiftManagedDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,14 @@ spec:
rule: 'self == oldSelf || (size(self) == 2 && isIP(self[0])
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
internalDNSRecords:
description: |-
internalDNSRecords determines whether we deploy with internal records enabled for
api, api-int, and ingress.
enum:
- Enabled
- Disabled
type: string
loadBalancer:
default:
type: OpenShiftManagedDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,14 @@ spec:
rule: 'self == oldSelf || (size(self) == 2 && isIP(self[0])
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
internalDNSRecords:
description: |-
internalDNSRecords determines whether we deploy with internal records enabled for
api, api-int, and ingress.
enum:
- Enabled
- Disabled
type: string
loadBalancer:
default:
type: OpenShiftManagedDefault
Expand Down
1 change: 1 addition & 0 deletions config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ infrastructures.config.openshift.io:
- HighlyAvailableArbiter
- HighlyAvailableArbiter+DualReplica
- NutanixMultiSubnets
- OnPremInternalDNSRecords
- VSphereHostVMGroupZonal
- VSphereMultiNetworks
FilenameOperatorName: config-operator
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
| NodeSwap| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| NutanixMultiSubnets| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| OVNObservability| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| OnPremInternalDNSRecords| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| PreconfiguredUDNAddresses| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| SignatureStores| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| SigstoreImageVerification| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
7 changes: 7 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,4 +872,11 @@ var (
enhancementPR("https://github.com/openshift/enhancements/pull/1785").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
FeatureGateOnPremInternalDNSRecords = newFeatureGate("OnPremInternalDNSRecords").
reportProblemsToJiraComponent("Networking / On-Prem DNS").
contactPerson("bnemec").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1803").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
)
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,14 @@ spec:
rule: 'self == oldSelf || (size(self) == 2 && isIP(self[0])
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
internalDNSRecords:
description: |-
internalDNSRecords determines whether we deploy with internal records enabled for
api, api-int, and ingress.
enum:
- Enabled
- Disabled
type: string
loadBalancer:
default:
type: OpenShiftManagedDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,14 @@ spec:
rule: 'self == oldSelf || (size(self) == 2 && isIP(self[0])
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
internalDNSRecords:
description: |-
internalDNSRecords determines whether we deploy with internal records enabled for
api, api-int, and ingress.
enum:
- Enabled
- Disabled
type: string
loadBalancer:
default:
type: OpenShiftManagedDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,14 @@ spec:
rule: 'self == oldSelf || (size(self) == 2 && isIP(self[0])
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
internalDNSRecords:
description: |-
internalDNSRecords determines whether we deploy with internal records enabled for
api, api-int, and ingress.
enum:
- Enabled
- Disabled
type: string
loadBalancer:
default:
type: OpenShiftManagedDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ controllerconfigs.machineconfiguration.openshift.io:
- HighlyAvailableArbiter
- HighlyAvailableArbiter+DualReplica
- NutanixMultiSubnets
- OnPremInternalDNSRecords
- VSphereMultiNetworks
FilenameOperatorName: machine-config
FilenameOperatorOrdering: "01"
Expand Down
Loading