Skip to content

Commit 348370f

Browse files
Merge pull request #2460 from cybertron/disable-internal-dns
OPNET-678: Add internalDNSRecords field
2 parents 6711368 + c72fe4d commit 348370f

File tree

30 files changed

+7399
-0
lines changed

30 files changed

+7399
-0
lines changed

config/v1/tests/infrastructures.config.openshift.io/OnPremDNSRecords.yaml

Lines changed: 464 additions & 0 deletions
Large diffs are not rendered by default.

config/v1/types_infrastructure.go

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,17 @@ const (
183183
LoadBalancerTypeOpenShiftManagedDefault PlatformLoadBalancerType = "OpenShiftManagedDefault"
184184
)
185185

186+
// DNSRecordsType defines whether api, api-int, and ingress records are provided by
187+
// the internal DNS infrastructure or must be configured external to the cluster.
188+
// +kubebuilder:validation:Enum=Internal;External
189+
// +enum
190+
type DNSRecordsType string
191+
192+
const (
193+
DNSRecordsTypeExternal DNSRecordsType = "External"
194+
DNSRecordsTypeInternal DNSRecordsType = "Internal"
195+
)
196+
186197
// PlatformType is a specific supported infrastructure provider.
187198
// +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt;EquinixMetal;PowerVS;AlibabaCloud;Nutanix;External
188199
type PlatformType string
@@ -1022,6 +1033,7 @@ type BareMetalPlatformSpec struct {
10221033
// BareMetalPlatformStatus holds the current status of the BareMetal infrastructure provider.
10231034
// For more information about the network architecture used with the BareMetal platform type, see:
10241035
// https://github.com/openshift/installer/blob/master/docs/design/baremetal/networking-infrastructure.md
1036+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=OnPremDNSRecords,rule="!has(self.dnsRecordsType) || self.dnsRecordsType == 'Internal' || (has(self.loadBalancer) && self.loadBalancer.type == 'UserManaged')",message="dnsRecordsType may only be set to External when loadBalancer.type is UserManaged"
10251037
type BareMetalPlatformStatus struct {
10261038
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
10271039
// by components inside the cluster, like kubelets using the infrastructure rather
@@ -1074,6 +1086,22 @@ type BareMetalPlatformStatus struct {
10741086
// +optional
10751087
LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`
10761088

1089+
// dnsRecordsType determines whether records for api, api-int, and ingress
1090+
// are provided by the internal DNS service or externally.
1091+
// Allowed values are `Internal`, `External`, and omitted.
1092+
// When set to `Internal`, records are provided by the internal infrastructure and
1093+
// no additional user configuration is required for the cluster to function.
1094+
// When set to `External`, records are not provided by the internal infrastructure
1095+
// and must be configured by the user on a DNS server outside the cluster.
1096+
// Cluster nodes must use this external server for their upstream DNS requests.
1097+
// This value may only be set when loadBalancer.type is set to UserManaged.
1098+
// When omitted, this means the user has no opinion and the platform is left
1099+
// to choose reasonable defaults. These defaults are subject to change over time.
1100+
// The current default is `Internal`.
1101+
// +openshift:enable:FeatureGate=OnPremDNSRecords
1102+
// +optional
1103+
DNSRecordsType DNSRecordsType `json:"dnsRecordsType,omitempty"`
1104+
10771105
// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
10781106
// +listType=atomic
10791107
// +kubebuilder:validation:MaxItems=32
@@ -1150,6 +1178,7 @@ type OpenStackPlatformSpec struct {
11501178
}
11511179

11521180
// OpenStackPlatformStatus holds the current status of the OpenStack infrastructure provider.
1181+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=OnPremDNSRecords,rule="!has(self.dnsRecordsType) || self.dnsRecordsType == 'Internal' || (has(self.loadBalancer) && self.loadBalancer.type == 'UserManaged')",message="dnsRecordsType may only be set to External when loadBalancer.type is UserManaged"
11531182
type OpenStackPlatformStatus struct {
11541183
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
11551184
// by components inside the cluster, like kubelets using the infrastructure rather
@@ -1206,6 +1235,22 @@ type OpenStackPlatformStatus struct {
12061235
// +optional
12071236
LoadBalancer *OpenStackPlatformLoadBalancer `json:"loadBalancer,omitempty"`
12081237

1238+
// dnsRecordsType determines whether records for api, api-int, and ingress
1239+
// are provided by the internal DNS service or externally.
1240+
// Allowed values are `Internal`, `External`, and omitted.
1241+
// When set to `Internal`, records are provided by the internal infrastructure and
1242+
// no additional user configuration is required for the cluster to function.
1243+
// When set to `External`, records are not provided by the internal infrastructure
1244+
// and must be configured by the user on a DNS server outside the cluster.
1245+
// Cluster nodes must use this external server for their upstream DNS requests.
1246+
// This value may only be set when loadBalancer.type is set to UserManaged.
1247+
// When omitted, this means the user has no opinion and the platform is left
1248+
// to choose reasonable defaults. These defaults are subject to change over time.
1249+
// The current default is `Internal`.
1250+
// +openshift:enable:FeatureGate=OnPremDNSRecords
1251+
// +optional
1252+
DNSRecordsType DNSRecordsType `json:"dnsRecordsType,omitempty"`
1253+
12091254
// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
12101255
// +listType=atomic
12111256
// +kubebuilder:validation:MaxItems=32
@@ -1240,6 +1285,7 @@ type OvirtPlatformLoadBalancer struct {
12401285
type OvirtPlatformSpec struct{}
12411286

12421287
// OvirtPlatformStatus holds the current status of the oVirt infrastructure provider.
1288+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=OnPremDNSRecords,rule="!has(self.dnsRecordsType) || self.dnsRecordsType == 'Internal' || (has(self.loadBalancer) && self.loadBalancer.type == 'UserManaged')",message="dnsRecordsType may only be set to External when loadBalancer.type is UserManaged"
12431289
type OvirtPlatformStatus struct {
12441290
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
12451291
// by components inside the cluster, like kubelets using the infrastructure rather
@@ -1286,6 +1332,22 @@ type OvirtPlatformStatus struct {
12861332
// +kubebuilder:default={"type": "OpenShiftManagedDefault"}
12871333
// +optional
12881334
LoadBalancer *OvirtPlatformLoadBalancer `json:"loadBalancer,omitempty"`
1335+
1336+
// dnsRecordsType determines whether records for api, api-int, and ingress
1337+
// are provided by the internal DNS service or externally.
1338+
// Allowed values are `Internal`, `External`, and omitted.
1339+
// When set to `Internal`, records are provided by the internal infrastructure and
1340+
// no additional user configuration is required for the cluster to function.
1341+
// When set to `External`, records are not provided by the internal infrastructure
1342+
// and must be configured by the user on a DNS server outside the cluster.
1343+
// Cluster nodes must use this external server for their upstream DNS requests.
1344+
// This value may only be set when loadBalancer.type is set to UserManaged.
1345+
// When omitted, this means the user has no opinion and the platform is left
1346+
// to choose reasonable defaults. These defaults are subject to change over time.
1347+
// The current default is `Internal`.
1348+
// +openshift:enable:FeatureGate=OnPremDNSRecords
1349+
// +optional
1350+
DNSRecordsType DNSRecordsType `json:"dnsRecordsType,omitempty"`
12891351
}
12901352

12911353
// VSpherePlatformLoadBalancer defines the load balancer used by the cluster on VSphere platform.
@@ -1683,6 +1745,7 @@ type VSpherePlatformSpec struct {
16831745
}
16841746

16851747
// VSpherePlatformStatus holds the current status of the vSphere infrastructure provider.
1748+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=OnPremDNSRecords,rule="!has(self.dnsRecordsType) || self.dnsRecordsType == 'Internal' || (has(self.loadBalancer) && self.loadBalancer.type == 'UserManaged')",message="dnsRecordsType may only be set to External when loadBalancer.type is UserManaged"
16861749
type VSpherePlatformStatus struct {
16871750
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
16881751
// by components inside the cluster, like kubelets using the infrastructure rather
@@ -1735,6 +1798,22 @@ type VSpherePlatformStatus struct {
17351798
// +optional
17361799
LoadBalancer *VSpherePlatformLoadBalancer `json:"loadBalancer,omitempty"`
17371800

1801+
// dnsRecordsType determines whether records for api, api-int, and ingress
1802+
// are provided by the internal DNS service or externally.
1803+
// Allowed values are `Internal`, `External`, and omitted.
1804+
// When set to `Internal`, records are provided by the internal infrastructure and
1805+
// no additional user configuration is required for the cluster to function.
1806+
// When set to `External`, records are not provided by the internal infrastructure
1807+
// and must be configured by the user on a DNS server outside the cluster.
1808+
// Cluster nodes must use this external server for their upstream DNS requests.
1809+
// This value may only be set when loadBalancer.type is set to UserManaged.
1810+
// When omitted, this means the user has no opinion and the platform is left
1811+
// to choose reasonable defaults. These defaults are subject to change over time.
1812+
// The current default is `Internal`.
1813+
// +openshift:enable:FeatureGate=OnPremDNSRecords
1814+
// +optional
1815+
DNSRecordsType DNSRecordsType `json:"dnsRecordsType,omitempty"`
1816+
17381817
// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
17391818
// +listType=atomic
17401819
// +kubebuilder:validation:MaxItems=32
@@ -2108,6 +2187,7 @@ type NutanixPrismElementEndpoint struct {
21082187
}
21092188

21102189
// NutanixPlatformStatus holds the current status of the Nutanix infrastructure provider.
2190+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=OnPremDNSRecords,rule="!has(self.dnsRecordsType) || self.dnsRecordsType == 'Internal' || (has(self.loadBalancer) && self.loadBalancer.type == 'UserManaged')",message="dnsRecordsType may only be set to External when loadBalancer.type is UserManaged"
21112191
type NutanixPlatformStatus struct {
21122192
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
21132193
// by components inside the cluster, like kubelets using the infrastructure rather
@@ -2151,6 +2231,22 @@ type NutanixPlatformStatus struct {
21512231
// +kubebuilder:default={"type": "OpenShiftManagedDefault"}
21522232
// +optional
21532233
LoadBalancer *NutanixPlatformLoadBalancer `json:"loadBalancer,omitempty"`
2234+
2235+
// dnsRecordsType determines whether records for api, api-int, and ingress
2236+
// are provided by the internal DNS service or externally.
2237+
// Allowed values are `Internal`, `External`, and omitted.
2238+
// When set to `Internal`, records are provided by the internal infrastructure and
2239+
// no additional user configuration is required for the cluster to function.
2240+
// When set to `External`, records are not provided by the internal infrastructure
2241+
// and must be configured by the user on a DNS server outside the cluster.
2242+
// Cluster nodes must use this external server for their upstream DNS requests.
2243+
// This value may only be set when loadBalancer.type is set to UserManaged.
2244+
// When omitted, this means the user has no opinion and the platform is left
2245+
// to choose reasonable defaults. These defaults are subject to change over time.
2246+
// The current default is `Internal`.
2247+
// +openshift:enable:FeatureGate=OnPremDNSRecords
2248+
// +optional
2249+
DNSRecordsType DNSRecordsType `json:"dnsRecordsType,omitempty"`
21542250
}
21552251

21562252
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

0 commit comments

Comments
 (0)