Skip to content

Commit 9e0b71a

Browse files
committed
Add CloudDNSIPs to CloudLoadBalancerConfig
CloudDNSIPs hold the upstream DNS server IPs. These will be used to configure the in-cluster CoreDNS instance when DNSType is set to ClusterHostedDNS.
1 parent 22c7448 commit 9e0b71a

31 files changed

Lines changed: 1271 additions & 95 deletions

File tree

config/v1/types_infrastructure.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ type GCPResourceTag struct {
870870
// Load Balancer configuration needs to be provided so that the DNS solution hosted
871871
// within the cluster can be configured with those values.
872872
// +kubebuilder:validation:XValidation:rule="has(self.dnsType) && self.dnsType != 'ClusterHosted' ? !has(self.clusterHosted) : true",message="clusterHosted is permitted only when dnsType is ClusterHosted"
873+
// TODO: Is it useful to have a kubebuilder validation for CloudDnsIPs too?
873874
// +union
874875
type CloudLoadBalancerConfig struct {
875876
// dnsType indicates the type of DNS solution in use within the cluster. Its default value of
@@ -897,6 +898,19 @@ type CloudLoadBalancerConfig struct {
897898
// +optional
898899
// +unionMember,optional
899900
ClusterHosted *CloudLoadBalancerIPs `json:"clusterHosted,omitempty"`
901+
902+
// cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
903+
// These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
904+
// For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
905+
// This field is only valid when dnsType is set to ClusterHosted.
906+
// When dnsType is not ClusterHosted, this field must not be set.
907+
// Entries in cloudDnsIPs must be unique.
908+
// A maximum of 16 IP addresses are permitted.
909+
// +kubebuilder:validation:Format=ip
910+
// +listType=set
911+
// +kubebuilder:validation:MaxItems=16
912+
// +optional
913+
CloudDnsIPs []IP `json:"cloudDnsIPs,omitempty"`
900914
}
901915

902916
// CloudLoadBalancerIPs contains the Load Balancer IPs for the cloud's API,

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,28 @@ spec:
12621262
ingress load balancer.
12631263
nullable: true
12641264
properties:
1265+
cloudDnsIPs:
1266+
description: |-
1267+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1268+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1269+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1270+
This field is only valid when dnsType is set to ClusterHosted.
1271+
When dnsType is not ClusterHosted, this field must not be set.
1272+
Entries in cloudDnsIPs must be unique.
1273+
A maximum of 16 IP addresses are permitted.
1274+
format: ip
1275+
items:
1276+
description: IP is an IP address (for example, "10.0.0.0"
1277+
or "fd00::").
1278+
maxLength: 39
1279+
minLength: 1
1280+
type: string
1281+
x-kubernetes-validations:
1282+
- message: value must be a valid IP address
1283+
rule: isIP(self)
1284+
maxItems: 16
1285+
type: array
1286+
x-kubernetes-list-type: set
12651287
clusterHosted:
12661288
description: |-
12671289
clusterHosted holds the IP addresses of API, API-Int and Ingress Load
@@ -1467,6 +1489,28 @@ spec:
14671489
must be provided for the API and internal API load balancers as well as the
14681490
ingress load balancer.
14691491
properties:
1492+
cloudDnsIPs:
1493+
description: |-
1494+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1495+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1496+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1497+
This field is only valid when dnsType is set to ClusterHosted.
1498+
When dnsType is not ClusterHosted, this field must not be set.
1499+
Entries in cloudDnsIPs must be unique.
1500+
A maximum of 16 IP addresses are permitted.
1501+
format: ip
1502+
items:
1503+
description: IP is an IP address (for example, "10.0.0.0"
1504+
or "fd00::").
1505+
maxLength: 39
1506+
minLength: 1
1507+
type: string
1508+
x-kubernetes-validations:
1509+
- message: value must be a valid IP address
1510+
rule: isIP(self)
1511+
maxItems: 16
1512+
type: array
1513+
x-kubernetes-list-type: set
14701514
clusterHosted:
14711515
description: |-
14721516
clusterHosted holds the IP addresses of API, API-Int and Ingress Load
@@ -1844,6 +1888,28 @@ spec:
18441888
ingress load balancer.
18451889
nullable: true
18461890
properties:
1891+
cloudDnsIPs:
1892+
description: |-
1893+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1894+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1895+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1896+
This field is only valid when dnsType is set to ClusterHosted.
1897+
When dnsType is not ClusterHosted, this field must not be set.
1898+
Entries in cloudDnsIPs must be unique.
1899+
A maximum of 16 IP addresses are permitted.
1900+
format: ip
1901+
items:
1902+
description: IP is an IP address (for example, "10.0.0.0"
1903+
or "fd00::").
1904+
maxLength: 39
1905+
minLength: 1
1906+
type: string
1907+
x-kubernetes-validations:
1908+
- message: value must be a valid IP address
1909+
rule: isIP(self)
1910+
maxItems: 16
1911+
type: array
1912+
x-kubernetes-list-type: set
18471913
clusterHosted:
18481914
description: |-
18491915
clusterHosted holds the IP addresses of API, API-Int and Ingress Load

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,28 @@ spec:
15061506
ingress load balancer.
15071507
nullable: true
15081508
properties:
1509+
cloudDnsIPs:
1510+
description: |-
1511+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1512+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1513+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1514+
This field is only valid when dnsType is set to ClusterHosted.
1515+
When dnsType is not ClusterHosted, this field must not be set.
1516+
Entries in cloudDnsIPs must be unique.
1517+
A maximum of 16 IP addresses are permitted.
1518+
format: ip
1519+
items:
1520+
description: IP is an IP address (for example, "10.0.0.0"
1521+
or "fd00::").
1522+
maxLength: 39
1523+
minLength: 1
1524+
type: string
1525+
x-kubernetes-validations:
1526+
- message: value must be a valid IP address
1527+
rule: isIP(self)
1528+
maxItems: 16
1529+
type: array
1530+
x-kubernetes-list-type: set
15091531
clusterHosted:
15101532
description: |-
15111533
clusterHosted holds the IP addresses of API, API-Int and Ingress Load

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,28 @@ spec:
12621262
ingress load balancer.
12631263
nullable: true
12641264
properties:
1265+
cloudDnsIPs:
1266+
description: |-
1267+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1268+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1269+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1270+
This field is only valid when dnsType is set to ClusterHosted.
1271+
When dnsType is not ClusterHosted, this field must not be set.
1272+
Entries in cloudDnsIPs must be unique.
1273+
A maximum of 16 IP addresses are permitted.
1274+
format: ip
1275+
items:
1276+
description: IP is an IP address (for example, "10.0.0.0"
1277+
or "fd00::").
1278+
maxLength: 39
1279+
minLength: 1
1280+
type: string
1281+
x-kubernetes-validations:
1282+
- message: value must be a valid IP address
1283+
rule: isIP(self)
1284+
maxItems: 16
1285+
type: array
1286+
x-kubernetes-list-type: set
12651287
clusterHosted:
12661288
description: |-
12671289
clusterHosted holds the IP addresses of API, API-Int and Ingress Load
@@ -1467,6 +1489,28 @@ spec:
14671489
must be provided for the API and internal API load balancers as well as the
14681490
ingress load balancer.
14691491
properties:
1492+
cloudDnsIPs:
1493+
description: |-
1494+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1495+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1496+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1497+
This field is only valid when dnsType is set to ClusterHosted.
1498+
When dnsType is not ClusterHosted, this field must not be set.
1499+
Entries in cloudDnsIPs must be unique.
1500+
A maximum of 16 IP addresses are permitted.
1501+
format: ip
1502+
items:
1503+
description: IP is an IP address (for example, "10.0.0.0"
1504+
or "fd00::").
1505+
maxLength: 39
1506+
minLength: 1
1507+
type: string
1508+
x-kubernetes-validations:
1509+
- message: value must be a valid IP address
1510+
rule: isIP(self)
1511+
maxItems: 16
1512+
type: array
1513+
x-kubernetes-list-type: set
14701514
clusterHosted:
14711515
description: |-
14721516
clusterHosted holds the IP addresses of API, API-Int and Ingress Load
@@ -1844,6 +1888,28 @@ spec:
18441888
ingress load balancer.
18451889
nullable: true
18461890
properties:
1891+
cloudDnsIPs:
1892+
description: |-
1893+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1894+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1895+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1896+
This field is only valid when dnsType is set to ClusterHosted.
1897+
When dnsType is not ClusterHosted, this field must not be set.
1898+
Entries in cloudDnsIPs must be unique.
1899+
A maximum of 16 IP addresses are permitted.
1900+
format: ip
1901+
items:
1902+
description: IP is an IP address (for example, "10.0.0.0"
1903+
or "fd00::").
1904+
maxLength: 39
1905+
minLength: 1
1906+
type: string
1907+
x-kubernetes-validations:
1908+
- message: value must be a valid IP address
1909+
rule: isIP(self)
1910+
maxItems: 16
1911+
type: array
1912+
x-kubernetes-list-type: set
18471913
clusterHosted:
18481914
description: |-
18491915
clusterHosted holds the IP addresses of API, API-Int and Ingress Load

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-OKD.crd.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,28 @@ spec:
15061506
ingress load balancer.
15071507
nullable: true
15081508
properties:
1509+
cloudDnsIPs:
1510+
description: |-
1511+
cloudDnsIPs holds the IP addresses of the cloud platform DNS servers.
1512+
These DNS server IP addresses are used when the cluster DNS type is ClusterHosted.
1513+
For AWS, the DNS IPs are typically the VPC's CIDR base address plus 2 (e.g., 10.0.0.2 for VPC 10.0.0.0/16).
1514+
This field is only valid when dnsType is set to ClusterHosted.
1515+
When dnsType is not ClusterHosted, this field must not be set.
1516+
Entries in cloudDnsIPs must be unique.
1517+
A maximum of 16 IP addresses are permitted.
1518+
format: ip
1519+
items:
1520+
description: IP is an IP address (for example, "10.0.0.0"
1521+
or "fd00::").
1522+
maxLength: 39
1523+
minLength: 1
1524+
type: string
1525+
x-kubernetes-validations:
1526+
- message: value must be a valid IP address
1527+
rule: isIP(self)
1528+
maxItems: 16
1529+
type: array
1530+
x-kubernetes-list-type: set
15091531
clusterHosted:
15101532
description: |-
15111533
clusterHosted holds the IP addresses of API, API-Int and Ingress Load

0 commit comments

Comments
 (0)