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
141 changes: 136 additions & 5 deletions config/v1/0000_10_config-operator_01_infrastructure.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,89 @@ spec:
type: string
name:
type: string
platformSpec:
description: platformSpec holds desired information specific to the
underlying infrastructure provider.
type: object
properties:
aws:
description: AWS contains settings specific to the Amazon Web Services
infrastructure provider.
type: object
properties:
serviceEndpoints:
description: serviceEndpoints list contains custom endpoints
which will override default service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
type: array
items:
description: AWSServiceEndpoint store the configuration of
a custom url to override existing defaults of AWS Services.
type: object
properties:
name:
description: name is the name of the AWS service. The
list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
type: string
pattern: ^[a-z0-9-]+$
url:
description: url is fully qualified URI with scheme https,
that overrides the default generated endpoint for a
client. This must be provided and cannot be empty.
type: string
pattern: ^https://
azure:
description: Azure contains settings specific to the Azure infrastructure
provider.
type: object
baremetal:
description: BareMetal contains settings specific to the BareMetal
platform.
type: object
gcp:
description: GCP contains settings specific to the Google Cloud
Platform infrastructure provider.
type: object
ibmcloud:
description: IBMCloud contains settings specific to the IBMCloud
infrastructure provider.
type: object
openstack:
description: OpenStack contains settings specific to the OpenStack
infrastructure provider.
type: object
ovirt:
description: Ovirt contains settings specific to the oVirt infrastructure
provider.
type: object
type:
description: type is the underlying infrastructure provider for
the cluster. This value controls whether infrastructure automation
such as service load balancers, dynamic volume provisioning, machine
creation and deletion, and other integrations are enabled. If
None, no infrastructure automation is enabled. Allowed values
are "AWS", "Azure", "BareMetal", "GCP", "Libvirt", "OpenStack",
"VSphere", "oVirt", and "None". Individual components may not
support all platforms, and must handle unrecognized platforms
as None if they do not support that platform.
type: string
enum:
- ""
- AWS
- Azure
- BareMetal
- GCP
- Libvirt
- OpenStack
- None
- VSphere
- oVirt
- IBMCloud
vsphere:
description: VSphere contains settings specific to the VSphere infrastructure
provider.
type: object
status:
description: status holds observed values from the cluster. They may not
be overridden.
Expand Down Expand Up @@ -82,6 +165,18 @@ spec:
description: "platform is the underlying infrastructure provider for
the cluster. \n Deprecated: Use platformStatus.type instead."
type: string
enum:
- ""
- AWS
- Azure
- BareMetal
- GCP
- Libvirt
- OpenStack
- None
- VSphere
- oVirt
- IBMCloud
platformStatus:
description: platformStatus holds status information specific to the
underlying infrastructure provider.
Expand All @@ -96,6 +191,28 @@ spec:
description: region holds the default AWS region for new AWS
resources created by the cluster.
type: string
serviceEndpoints:
description: ServiceEndpoints list contains custom endpoints
which will override default service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
type: array
items:
description: AWSServiceEndpoint store the configuration of
a custom url to override existing defaults of AWS Services.
type: object
properties:
name:
description: name is the name of the AWS service. The
list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
type: string
pattern: ^[a-z0-9-]+$
url:
description: url is fully qualified URI with scheme https,
that overrides the default generated endpoint for a
client. This must be provided and cannot be empty.
type: string
pattern: ^https://
azure:
description: Azure contains settings specific to the Azure infrastructure
provider.
Expand Down Expand Up @@ -225,16 +342,30 @@ spec:
to the nodes in the cluster.
type: string
type:
description: type is the underlying infrastructure provider for
description: "type is the underlying infrastructure provider for
the cluster. This value controls whether infrastructure automation
such as service load balancers, dynamic volume provisioning, machine
creation and deletion, and other integrations are enabled. If
None, no infrastructure automation is enabled. Allowed values
are "AWS", "Azure", "BareMetal", "GCP", "Libvirt", "OpenStack",
"VSphere", "oVirt", and "None". Individual components may not
support all platforms, and must handle unrecognized platforms
as None if they do not support that platform.
are \"AWS\", \"Azure\", \"BareMetal\", \"GCP\", \"Libvirt\", \"OpenStack\",
\"VSphere\", \"oVirt\", and \"None\". Individual components may
not support all platforms, and must handle unrecognized platforms
as None if they do not support that platform. \n This value will
be synced with to the `status.platform` and `status.platformStatus.type`.
Currently this value cannot be changed once set."
type: string
enum:
- ""
- AWS
- Azure
- BareMetal
- GCP
- Libvirt
- OpenStack
- None
- VSphere
- oVirt
- IBMCloud
vsphere:
description: VSphere contains settings specific to the VSphere infrastructure
provider.
Expand Down
119 changes: 119 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type InfrastructureSpec struct {
// The namespace for this config map is openshift-config.
// +optional
CloudConfig ConfigMapFileReference `json:"cloudConfig"`

// platformSpec holds desired information specific to the underlying
// infrastructure provider.
PlatformSpec PlatformSpec `json:"platformSpec,omitempty"`
}

// InfrastructureStatus describes the infrastructure the cluster is leveraging.
Expand Down Expand Up @@ -65,6 +69,7 @@ type InfrastructureStatus struct {
}

// PlatformType is a specific supported infrastructure provider.
// +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud
type PlatformType string

const (
Expand Down Expand Up @@ -110,6 +115,55 @@ const (
IBMCloudProviderTypeVPC IBMCloudProviderType = "VPC"
)

// PlatformSpec holds the desired state specific to the underlying infrastructure provider
// of the current cluster. Since these are used at spec-level for the underlying cluster, it
// is supposed that only one of the spec structs is set.
type PlatformSpec struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

indicate how these are vetted, validated, and promoted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these

wdym by these? individual platform specs or something else.

// type is the underlying infrastructure provider for the cluster. This
// value controls whether infrastructure automation such as service load
// balancers, dynamic volume provisioning, machine creation and deletion, and
// other integrations are enabled. If None, no infrastructure automation is
Copy link
Contributor

Choose a reason for hiding this comment

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

how will you migrate existing clusters on update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k
personally, the platformSpec should be empty nil <=> no configuration for infra like we support today.
and when users want to modify existing clusters to add infra specific desired state, the validations should force them to set the type and corresponding platformSpec.

But if you think emptying out the spec to just platform type and empty platform spec is more suitable, which i don't think we should be doing, we (same team that is doing the platformstatus migration) can write the migration to set it.

secondary, there is planned change to validations (in openshift kube-apiserver) to make sure the type doesn't change once set. i.e when the platformSpec is once set, it can't change the type.

// enabled. Allowed values are "AWS", "Azure", "BareMetal", "GCP", "Libvirt",
// "OpenStack", "VSphere", "oVirt", and "None". Individual components may not support
// all platforms, and must handle unrecognized platforms as None if they do
// not support that platform.
//
// +unionDiscriminator
Type PlatformType `json:"type"`

// AWS contains settings specific to the Amazon Web Services infrastructure provider.
// +optional
AWS *AWSPlatformSpec `json:"aws,omitempty"`

// Azure contains settings specific to the Azure infrastructure provider.
// +optional
Azure *AzurePlatformSpec `json:"azure,omitempty"`

// GCP contains settings specific to the Google Cloud Platform infrastructure provider.
// +optional
GCP *GCPPlatformSpec `json:"gcp,omitempty"`

// BareMetal contains settings specific to the BareMetal platform.
// +optional
BareMetal *BareMetalPlatformSpec `json:"baremetal,omitempty"`

// OpenStack contains settings specific to the OpenStack infrastructure provider.
// +optional
OpenStack *OpenStackPlatformSpec `json:"openstack,omitempty"`

// Ovirt contains settings specific to the oVirt infrastructure provider.
// +optional
Ovirt *OvirtPlatformSpec `json:"ovirt,omitempty"`

// VSphere contains settings specific to the VSphere infrastructure provider.
// +optional
VSphere *VSpherePlatformSpec `json:"vsphere,omitempty"`

// IBMCloud contains settings specific to the IBMCloud infrastructure provider.
// +optional
IBMCloud *IBMCloudPlatformSpec `json:"ibmcloud,omitempty"`
}

// PlatformStatus holds the current status specific to the underlying infrastructure provider
// of the current cluster. Since these are used at status-level for the underlying cluster, it
// is supposed that only one of the status structs is set.
Expand All @@ -122,6 +176,9 @@ type PlatformStatus struct {
// "OpenStack", "VSphere", "oVirt", and "None". Individual components may not support
// all platforms, and must handle unrecognized platforms as None if they do
// not support that platform.
//
// This value will be synced with to the `status.platform` and `status.platformStatus.type`.
// Currently this value cannot be changed once set.
Type PlatformType `json:"type"`

// AWS contains settings specific to the Amazon Web Services infrastructure provider.
Expand Down Expand Up @@ -157,12 +214,50 @@ type PlatformStatus struct {
IBMCloud *IBMCloudPlatformStatus `json:"ibmcloud,omitempty"`
}

// AWSServiceEndpoint store the configuration of a custom url to
// override existing defaults of AWS Services.
type AWSServiceEndpoint struct {
// name is the name of the AWS service.
// The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
// This must be provided and cannot be empty.
//
// +kubebuilder:validation:Pattern=`^[a-z0-9-]+$`
Name string `json:"name"`

// url is fully qualified URI with scheme https, that overrides the default generated
// endpoint for a client.
// This must be provided and cannot be empty.
//
// +kubebuilder:validation:Pattern=`^https://`
URL string `json:"url"`
Copy link
Contributor

Choose a reason for hiding this comment

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

@damemi do we default to required or optional? Is there any downside to simply specifying everything?

}

// AWSPlatformSpec holds the desired state of the Amazon Web Services infrastructure provider.
// This only includes fields that can be modified in the cluster.
type AWSPlatformSpec struct {
// serviceEndpoints list contains custom endpoints which will override default
// service endpoint of AWS Services.
// There must be only one ServiceEndpoint for a service.
// +optional
ServiceEndpoints []AWSServiceEndpoint `json:"serviceEndpoints,omitempty"`
}

// AWSPlatformStatus holds the current status of the Amazon Web Services infrastructure provider.
type AWSPlatformStatus struct {
// region holds the default AWS region for new AWS resources created by the cluster.
Region string `json:"region"`

// ServiceEndpoints list contains custom endpoints which will override default
// service endpoint of AWS Services.
// There must be only one ServiceEndpoint for a service.
// +optional
ServiceEndpoints []AWSServiceEndpoint `json:"serviceEndpoints,omitempty"`
}

// AzurePlatformSpec holds the desired state of the Azure infrastructure provider.
// This only includes fields that can be modified in the cluster.
type AzurePlatformSpec struct{}

// AzurePlatformStatus holds the current status of the Azure infrastructure provider.
type AzurePlatformStatus struct {
// resourceGroupName is the Resource Group for new Azure resources created for the cluster.
Expand All @@ -174,6 +269,10 @@ type AzurePlatformStatus struct {
NetworkResourceGroupName string `json:"networkResourceGroupName,omitempty"`
}

// GCPPlatformSpec holds the desired state of the Google Cloud Platform infrastructure provider.
// This only includes fields that can be modified in the cluster.
type GCPPlatformSpec struct{}

// GCPPlatformStatus holds the current status of the Google Cloud Platform infrastructure provider.
type GCPPlatformStatus struct {
// resourceGroupName is the Project ID for new GCP resources created for the cluster.
Expand All @@ -183,6 +282,10 @@ type GCPPlatformStatus struct {
Region string `json:"region"`
}

// BareMetalPlatformSpec holds the desired state of the BareMetal infrastructure provider.
// This only includes fields that can be modified in the cluster.
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:
// https://github.com/openshift/installer/blob/master/docs/design/baremetal/networking-infrastructure.md
Expand All @@ -206,6 +309,10 @@ type BareMetalPlatformStatus struct {
NodeDNSIP string `json:"nodeDNSIP,omitempty"`
}

// OpenStackPlatformSpec holds the desired state of the OpenStack infrastructure provider.
// This only includes fields that can be modified in the cluster.
type OpenStackPlatformSpec struct{}

// OpenStackPlatformStatus holds the current status of the OpenStack infrastructure provider.
type OpenStackPlatformStatus struct {
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
Expand All @@ -231,6 +338,10 @@ type OpenStackPlatformStatus struct {
NodeDNSIP string `json:"nodeDNSIP,omitempty"`
}

// OvirtPlatformSpec holds the desired state of the oVirt infrastructure provider.
// This only includes fields that can be modified in the cluster.
type OvirtPlatformSpec struct{}

// OvirtPlatformStatus holds the current status of the oVirt infrastructure provider.
type OvirtPlatformStatus struct {
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
Expand All @@ -252,6 +363,10 @@ type OvirtPlatformStatus struct {
NodeDNSIP string `json:"nodeDNSIP,omitempty"`
}

// VSpherePlatformSpec holds the desired state of the vSphere infrastructure provider.
// This only includes fields that can be modified in the cluster.
type VSpherePlatformSpec struct{}

// VSpherePlatformStatus holds the current status of the vSphere infrastructure provider.
type VSpherePlatformStatus struct {
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
Expand All @@ -273,6 +388,10 @@ type VSpherePlatformStatus struct {
NodeDNSIP string `json:"nodeDNSIP,omitempty"`
}

// IBMCloudPlatformSpec holds the desired state of the IBMCloud infrastructure provider.
// This only includes fields that can be modified in the cluster.
type IBMCloudPlatformSpec struct{}

//IBMCloudPlatformStatus holds the current status of the IBMCloud infrastructure provider.
type IBMCloudPlatformStatus struct {
// Location is where the cluster has been deployed
Expand Down
Loading