Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,110 @@ spec:
description: aws contains settings specific to the Amazon Web
Services infrastructure provider.
properties:
cloudLoadBalancerConfig:
default:
dnsType: PlatformDefault
description: |-
cloudLoadBalancerConfig holds configuration related to DNS and cloud
load balancers. It allows configuration of in-cluster DNS as an alternative
to the platform default DNS implementation.
When using the ClusterHosted DNS type, Load Balancer IP addresses
must be provided for the API and internal API load balancers as well as the
ingress load balancer.
nullable: true
properties:
clusterHosted:
description: |-
clusterHosted holds the IP addresses of API, API-Int and Ingress Load
Balancers on Cloud Platforms. The DNS solution hosted within the cluster
use these IP addresses to provide resolution for API, API-Int and Ingress
services.
properties:
apiIntLoadBalancerIPs:
description: |-
apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the apiIntLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
maxLength: 39
minLength: 1
type: string
x-kubernetes-validations:
- message: value must be a valid IP address
rule: isIP(self)
maxItems: 16
type: array
x-kubernetes-list-type: set
apiLoadBalancerIPs:
description: |-
apiLoadBalancerIPs holds Load Balancer IPs for the API service.
These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Could be empty for private clusters.
Entries in the apiLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
maxLength: 39
minLength: 1
type: string
x-kubernetes-validations:
- message: value must be a valid IP address
rule: isIP(self)
maxItems: 16
type: array
x-kubernetes-list-type: set
ingressLoadBalancerIPs:
description: |-
ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the ingressLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
maxLength: 39
minLength: 1
type: string
x-kubernetes-validations:
- message: value must be a valid IP address
rule: isIP(self)
maxItems: 16
type: array
x-kubernetes-list-type: set
type: object
dnsType:
default: PlatformDefault
description: |-
dnsType indicates the type of DNS solution in use within the cluster. Its default value of
`PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
The cluster's use of the cloud's Load Balancers is unaffected by this setting.
The value is immutable after it has been set at install time.
Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
Enabling this functionality allows the user to start their own DNS solution outside the cluster after
installation is complete. The customer would be responsible for configuring this custom DNS solution,
and it can be run in addition to the in-cluster DNS solution.
enum:
- ClusterHosted
- PlatformDefault
type: string
x-kubernetes-validations:
- message: dnsType is immutable
rule: oldSelf == '' || self == oldSelf
type: object
x-kubernetes-validations:
- message: clusterHosted is permitted only when dnsType is
ClusterHosted
rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
? !has(self.clusterHosted) : true'
Comment on lines +1174 to +1277
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

Verify format: ip placement for schema validation compatibility.

The format: ip field is placed at the array level (lines 1199, 1219, 1238 for AWS; lines 1625, 1645, 1664 for GCP) rather than on individual items. In OpenAPI and Kubernetes validation schemas, the format keyword typically applies to the string type of items, not the array container. This placement may not enforce IP validation as intended.

If the format should be on items, apply this diff for the AWS section (and mirror for GCP):

              apiIntLoadBalancerIPs:
                description: |-
                  apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
                  These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
                  Entries in the apiIntLoadBalancerIPs must be unique.
                  A maximum of 16 IP addresses are permitted.
-               format: ip
                items:
                  description: IP is an IP address (for example, "10.0.0.0"
                    or "fd00::").
+                 format: ip
                  maxLength: 39

Also applies to: 1600-1703


🌐 Web query:

Does Kubernetes CRD validation support `format: ip` on array fields in OpenAPI v3 schemas, or should it be on the items?

💡 Result:

Use items. The OpenAPI/CRD schema "format" applies to string types only, so for an array you must put format (e.g. "ip", "ipv4", "ipv6") on the items schema (items.type: string + items.format: ...). Kubernetes docs note format can only be set when type is string, and examples/CEL examples validate items rather than the array itself. [1][2]

Sources:

  1. Kubernetes API docs: openAPIV3Schema field — "format is an OpenAPI v3 format string... NOTE: Can only be set if type is string." [turn1search2].
  2. Kubernetes CRD examples / CEL validation showing array items use (put format/constraints under items). [turn1search0].


Move format: ip from array level to items schema for proper IP validation.

The OpenAPI v3 format keyword applies only to string types, so for arrays you must place format (e.g., "ip", "ipv4", "ipv6") on the items schema, not the array container. Currently, format: ip is placed at the array level (lines 1199, 1219, 1238 for AWS; lines 1625, 1645, 1664 for GCP), which will not enforce IP validation as intended.

Apply this fix to all three IP list fields in both AWS and GCP sections:

              apiIntLoadBalancerIPs:
                description: |-
                  apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
                  These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
                  Entries in the apiIntLoadBalancerIPs must be unique.
                  A maximum of 16 IP addresses are permitted.
-               format: ip
                items:
                  description: IP is an IP address (for example, "10.0.0.0"
                    or "fd00::").
+                 format: ip
                  maxLength: 39

Apply the same pattern to apiLoadBalancerIPs and ingressLoadBalancerIPs in both AWS (lines 1199, 1219, 1238) and GCP (lines 1625, 1645, 1664) sections.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml
around lines 1174-1277 (and similarly apply to the GCP blocks referenced at
~1625-1664), the array-level "format: ip" is incorrectly placed on the array
node for apiIntLoadBalancerIPs, apiLoadBalancerIPs and ingressLoadBalancerIPs;
move the "format: ip" key out of the array object and into each field's "items"
schema (next to type: string and its validations), and remove the array-level
format so the OpenAPI string items actually enforce IP format validation for all
three IP list fields in both AWS and GCP sections.

region:
description: region holds the default AWS region for new AWS
resources created by the cluster.
Expand Down
2 changes: 1 addition & 1 deletion features.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
| NewOLM| | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> |
| NewOLMWebhookProviderOpenshiftServiceCA| | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> |
| AWSClusterHostedDNS| | | <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> |
| AWSClusterHostedDNSInstall| | | <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> |
| AWSDedicatedHosts| | | <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> |
| AWSDualStackInstall| | | <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> |
| AWSServiceLBNetworkSecurityGroup| | | <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 Expand Up @@ -73,6 +72,7 @@
| VSphereHostVMGroupZonal| | | <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> |
| VSphereMixedNodeEnv| | | <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> |
| VolumeGroupSnapshot| | | <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> |
| AWSClusterHostedDNSInstall| <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> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AdditionalRoutingCapabilities| <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> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AdminNetworkPolicy| <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> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AlibabaPlatform| <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> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
2 changes: 1 addition & 1 deletion features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ var (
contactPerson("barbacbd").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1468").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateGCPCustomAPIEndpointsInstall = newFeatureGate("GCPCustomAPIEndpointsInstall").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,110 @@ spec:
description: aws contains settings specific to the Amazon
Web Services infrastructure provider.
properties:
cloudLoadBalancerConfig:
default:
dnsType: PlatformDefault
description: |-
cloudLoadBalancerConfig holds configuration related to DNS and cloud
load balancers. It allows configuration of in-cluster DNS as an alternative
to the platform default DNS implementation.
When using the ClusterHosted DNS type, Load Balancer IP addresses
must be provided for the API and internal API load balancers as well as the
ingress load balancer.
nullable: true
properties:
clusterHosted:
description: |-
clusterHosted holds the IP addresses of API, API-Int and Ingress Load
Balancers on Cloud Platforms. The DNS solution hosted within the cluster
use these IP addresses to provide resolution for API, API-Int and Ingress
services.
properties:
apiIntLoadBalancerIPs:
description: |-
apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the apiIntLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example,
"10.0.0.0" or "fd00::").
maxLength: 39
minLength: 1
type: string
x-kubernetes-validations:
- message: value must be a valid IP address
rule: isIP(self)
maxItems: 16
type: array
x-kubernetes-list-type: set
apiLoadBalancerIPs:
description: |-
apiLoadBalancerIPs holds Load Balancer IPs for the API service.
These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Could be empty for private clusters.
Entries in the apiLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example,
"10.0.0.0" or "fd00::").
maxLength: 39
minLength: 1
type: string
x-kubernetes-validations:
- message: value must be a valid IP address
rule: isIP(self)
maxItems: 16
type: array
x-kubernetes-list-type: set
ingressLoadBalancerIPs:
description: |-
ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the ingressLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example,
"10.0.0.0" or "fd00::").
maxLength: 39
minLength: 1
type: string
x-kubernetes-validations:
- message: value must be a valid IP address
rule: isIP(self)
maxItems: 16
type: array
x-kubernetes-list-type: set
type: object
dnsType:
default: PlatformDefault
description: |-
dnsType indicates the type of DNS solution in use within the cluster. Its default value of
`PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
The cluster's use of the cloud's Load Balancers is unaffected by this setting.
The value is immutable after it has been set at install time.
Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
Enabling this functionality allows the user to start their own DNS solution outside the cluster after
installation is complete. The customer would be responsible for configuring this custom DNS solution,
and it can be run in addition to the in-cluster DNS solution.
enum:
- ClusterHosted
- PlatformDefault
type: string
x-kubernetes-validations:
- message: dnsType is immutable
rule: oldSelf == '' || self == oldSelf
type: object
x-kubernetes-validations:
- message: clusterHosted is permitted only when dnsType
is ClusterHosted
rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
? !has(self.clusterHosted) : true'
region:
description: region holds the default AWS region for
new AWS resources created by the cluster.
Expand Down
Loading