Skip to content
Merged
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

Large diffs are not rendered by default.

143 changes: 0 additions & 143 deletions config/v1/0000_10_config-operator_01_infrastructure-Default.crd.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

170 changes: 0 additions & 170 deletions config/v1/stable.infrastructure.testsuite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,176 +12,6 @@ tests:
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
- name: Should be able to pass 2 IP addresses to apiServerInternalIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
apiServerInternalIPs:
- 192.0.2.1
- "2001:db8::1"
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
apiServerInternalIPs:
- 192.0.2.1
- "2001:db8::1"
- name: Should not be able to pass not-an-IP to apiServerInternalIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
apiServerInternalIPs:
- not-an-ip-address
expectedError: "Invalid value: \"not-an-ip-address\""
- name: Should not be able to pass 2 IPv4 addresses to apiServerInternalIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
apiServerInternalIPs:
- 192.0.2.1
- 192.0.2.2
expectedError: "apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
- name: Should not be able to pass 2 IPv6 addresses to apiServerInternalIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
apiServerInternalIPs:
- "2001:db8::1"
- "2001:db8::2"
expectedError: "apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
- name: Should not be able to pass more than 2 entries to apiServerInternalIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
apiServerInternalIPs:
- 192.0.2.1
- "2001:db8::1"
- 192.0.2.2
expectedError: "Too many: 3: must have at most 2 items"
- name: Should be able to pass 2 IP addresses to ingressIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
ingressIPs:
- 192.0.2.1
- "2001:db8::1"
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
ingressIPs:
- 192.0.2.1
- "2001:db8::1"
- name: Should not be able to pass not-an-IP to ingressIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
ingressIPs:
- not-an-ip-address
expectedError: "Invalid value: \"not-an-ip-address\""
- name: Should not be able to pass 2 IPv4 addresses to ingressIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
ingressIPs:
- 192.0.2.1
- 192.0.2.2
expectedError: "ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
- name: Should not be able to pass 2 IPv6 addresses to ingressIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
ingressIPs:
- "2001:db8::1"
- "2001:db8::2"
expectedError: "ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
- name: Should not be able to pass more than 2 entries to ingressIPs in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
ingressIPs:
- 192.0.2.1
- "2001:db8::1"
- 192.0.2.2
expectedError: "Too many: 3: must have at most 2 items"
- name: Should be able to pass 2 IP subnets addresses to machineNetworks in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
machineNetworks:
- "192.0.2.0/24"
- "2001:db8::0/32"
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
machineNetworks:
- "192.0.2.0/24"
- "2001:db8::0/32"
- name: Should not be able to pass not-a-CIDR to machineNetworks in the platform spec
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: BareMetal
baremetal:
machineNetworks:
- 192.0.2.1
expectedError: "Invalid value: \"192.0.2.1\""
onUpdate:
- name: Should be able to change External platformName from unknown to something else
initial: |
Expand Down
161 changes: 2 additions & 159 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,48 +729,7 @@ type BareMetalPlatformLoadBalancer struct {

// BareMetalPlatformSpec holds the desired state of the BareMetal infrastructure provider.
// This only includes fields that can be modified in the cluster.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
type BareMetalPlatformSpec struct {
// apiServerInternalIPs are the IP addresses to contact the Kubernetes API
// server that can be used by components inside the cluster, like kubelets
// using the infrastructure rather than Kubernetes networking. These are the
// IPs for a self-hosted load balancer in front of the API servers.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.apiServerInternalIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 ? self.exists_one(x, x.contains(':')) : true",message="apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=set
// +optional
APIServerInternalIPs []IP `json:"apiServerInternalIPs"`

// ingressIPs are the external IPs which route to the default ingress
// controller. The IPs are suitable targets of a wildcard DNS record used to
// resolve default route host names.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.ingressIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 ? self.exists_one(x, x.contains(':')) : true",message="ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=set
// +optional
IngressIPs []IP `json:"ingressIPs"`

// machineNetworks are IP networks used to connect all the OpenShift cluster
// nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
// for example "10.0.0.0/8" or "fd00::/8".
// +listType=set
// +kubebuilder:validation:MaxItems=32
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}
type BareMetalPlatformSpec struct{}

// BareMetalPlatformStatus holds the current status of the BareMetal infrastructure provider.
// For more information about the network architecture used with the BareMetal platform type, see:
Expand Down Expand Up @@ -823,12 +782,6 @@ type BareMetalPlatformStatus struct {
// +openshift:enable:FeatureSets=CustomNoUpgrade;TechPreviewNoUpgrade
// +optional
LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`

// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
// +listType=set
// +kubebuilder:validation:MaxItems=32
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}

// OpenStackPlatformLoadBalancer defines the load balancer used by the cluster on OpenStack platform.
Expand All @@ -854,48 +807,7 @@ type OpenStackPlatformLoadBalancer struct {

// OpenStackPlatformSpec holds the desired state of the OpenStack infrastructure provider.
// This only includes fields that can be modified in the cluster.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
type OpenStackPlatformSpec struct {
// apiServerInternalIPs are the IP addresses to contact the Kubernetes API
// server that can be used by components inside the cluster, like kubelets
// using the infrastructure rather than Kubernetes networking. These are the
// IPs for a self-hosted load balancer in front of the API servers.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.apiServerInternalIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 ? self.exists_one(x, x.contains(':')) : true",message="apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=set
// +optional
APIServerInternalIPs []IP `json:"apiServerInternalIPs"`

// ingressIPs are the external IPs which route to the default ingress
// controller. The IPs are suitable targets of a wildcard DNS record used to
// resolve default route host names.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.ingressIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 ? self.exists_one(x, x.contains(':')) : true",message="ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=set
// +optional
IngressIPs []IP `json:"ingressIPs"`

// machineNetworks are IP networks used to connect all the OpenShift cluster
// nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
// for example "10.0.0.0/8" or "fd00::/8".
// +listType=set
// +kubebuilder:validation:MaxItems=32
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}
type OpenStackPlatformSpec struct{}

// OpenStackPlatformStatus holds the current status of the OpenStack infrastructure provider.
type OpenStackPlatformStatus struct {
Expand Down Expand Up @@ -949,12 +861,6 @@ type OpenStackPlatformStatus struct {
// +kubebuilder:default={"type": "OpenShiftManagedDefault"}
// +optional
LoadBalancer *OpenStackPlatformLoadBalancer `json:"loadBalancer,omitempty"`

// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
// +listType=set
// +kubebuilder:validation:MaxItems=32
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}

// OvirtPlatformLoadBalancer defines the load balancer used by the cluster on Ovirt platform.
Expand Down Expand Up @@ -1234,8 +1140,6 @@ type VSpherePlatformNodeNetworking struct {
// VSpherePlatformSpec holds the desired state of the vSphere infrastructure provider.
// In the future the cloud provider operator, storage operator and machine operator will
// use these fields for configuration.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
type VSpherePlatformSpec struct {
// vcenters holds the connection details for services to communicate with vCenter.
// Currently, only a single vCenter is supported.
Expand All @@ -1259,45 +1163,6 @@ type VSpherePlatformSpec struct {
// return the first one found.
// +optional
NodeNetworking VSpherePlatformNodeNetworking `json:"nodeNetworking,omitempty"`

// apiServerInternalIPs are the IP addresses to contact the Kubernetes API
// server that can be used by components inside the cluster, like kubelets
// using the infrastructure rather than Kubernetes networking. These are the
// IPs for a self-hosted load balancer in front of the API servers.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.apiServerInternalIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 ? self.exists_one(x, x.contains(':')) : true",message="apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=set
// +optional
APIServerInternalIPs []IP `json:"apiServerInternalIPs"`

// ingressIPs are the external IPs which route to the default ingress
// controller. The IPs are suitable targets of a wildcard DNS record used to
// resolve default route host names.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.ingressIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 ? self.exists_one(x, x.contains(':')) : true",message="ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=set
// +optional
IngressIPs []IP `json:"ingressIPs"`

// machineNetworks are IP networks used to connect all the OpenShift cluster
// nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
// for example "10.0.0.0/8" or "fd00::/8".
// +listType=set
// +kubebuilder:validation:MaxItems=32
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}

// VSpherePlatformStatus holds the current status of the vSphere infrastructure provider.
Expand Down Expand Up @@ -1349,12 +1214,6 @@ type VSpherePlatformStatus struct {
// +openshift:enable:FeatureSets=CustomNoUpgrade;TechPreviewNoUpgrade
// +optional
LoadBalancer *VSpherePlatformLoadBalancer `json:"loadBalancer,omitempty"`

// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
// +listType=set
// +kubebuilder:validation:MaxItems=32
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}

// IBMCloudServiceEndpoint stores the configuration of a custom url to
Expand Down Expand Up @@ -1755,19 +1614,3 @@ type InfrastructureList struct {

Items []Infrastructure `json:"items"`
}

// CIDR is an IP address range in CIDR notation (for example, "10.0.0.0/8" or "fd00::/8").
// +kubebuilder:validation:Pattern=`(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(3[0-2]|[1-2][0-9]|[0-9]))$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))$)`
// + ---
// + The regex for the IPv4 and IPv6 CIDR range was taken from
// + https://blog.markhatton.co.uk/2011/03/15/regular-expressions-for-ip-addresses-cidr-ranges-and-hostnames/
// + The resulting regex is an OR of both regexes.
type CIDR string

// IP is an IP address (for example, "10.0.0.0" or "fd00::").
// +kubebuilder:validation:Pattern=`(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*)`
// + ---
// + The regex for the IPv4 and IPv6 address was taken from
// + https://blog.markhatton.co.uk/2011/03/15/regular-expressions-for-ip-addresses-cidr-ranges-and-hostnames/
// + The resulting regex is an OR of both regexes.
type IP string
Loading