diff --git a/machine/v1/types_powervsprovider.go b/machine/v1/types_powervsprovider.go index 4612d9a4186..c131139c543 100644 --- a/machine/v1/types_powervsprovider.go +++ b/machine/v1/types_powervsprovider.go @@ -11,6 +11,15 @@ type PowerVSResourceType string // PowerVSProcessorType enum attribute to identify the PowerVS instance processor type type PowerVSProcessorType string +// IBMVPCLoadBalancerType is the type of LoadBalancer to use when registering +// an instance with load balancers specified in LoadBalancerNames +type IBMVPCLoadBalancerType string + +// ApplicationLoadBalancerType is possible values for IBMVPCLoadBalancerType. +const ( + ApplicationLoadBalancerType IBMVPCLoadBalancerType = "Application" // Application Load Balancer for VPC (ALB) +) + const ( // PowerVSResourceTypeID enum property to identify an ID type resource reference PowerVSResourceTypeID PowerVSResourceType = "ID" @@ -121,6 +130,11 @@ type PowerVSMachineProviderConfig struct { // default, which is subject to change over time. The current default is 32. // +optional MemoryGiB int32 `json:"memoryGiB,omitempty"` + + // loadBalancers is the set of load balancers to which the new control plane instance + // should be added once it is created. + // +optional + LoadBalancers []LoadBalancerReference `json:"loadBalancers,omitempty"` } // PowerVSResource is a reference to a specific PowerVS resource by ID, Name or RegEx @@ -150,7 +164,7 @@ type PowerVSResource struct { // // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). // +openshift:compatibility-gen:level=1 -//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PowerVSMachineProviderStatus struct { metav1.TypeMeta `json:",inline"` @@ -190,3 +204,24 @@ type PowerVSSecretReference struct { // +optional Name string `json:"name,omitempty"` } + +// LoadBalancerReference is a reference to a load balancer on IBM Cloud virtual private cloud(VPC). +type LoadBalancerReference struct { + // name of the LoadBalancer in IBM Cloud VPC. + // The name should be between 1 and 63 characters long and may consist of lowercase alphanumeric characters and hyphens only. + // The value must not end with a hyphen. + // It is a reference to existing LoadBalancer created by openshift installer component. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + Name string `json:"name"` + // type of the LoadBalancer service supported by IBM Cloud VPC. + // Currently, only Application LoadBalancer is supported. + // More details about Application LoadBalancer + // https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui + // Supported values are Application. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum:="Application" + Type IBMVPCLoadBalancerType `json:"type"` +} diff --git a/machine/v1/zz_generated.deepcopy.go b/machine/v1/zz_generated.deepcopy.go index d63873943de..83c0d21ad4b 100644 --- a/machine/v1/zz_generated.deepcopy.go +++ b/machine/v1/zz_generated.deepcopy.go @@ -559,6 +559,22 @@ func (in *GCPFailureDomain) DeepCopy() *GCPFailureDomain { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerReference) DeepCopyInto(out *LoadBalancerReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerReference. +func (in *LoadBalancerReference) DeepCopy() *LoadBalancerReference { + if in == nil { + return nil + } + out := new(LoadBalancerReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NutanixCategory) DeepCopyInto(out *NutanixCategory) { *out = *in @@ -729,6 +745,11 @@ func (in *PowerVSMachineProviderConfig) DeepCopyInto(out *PowerVSMachineProvider in.Image.DeepCopyInto(&out.Image) in.Network.DeepCopyInto(&out.Network) out.Processors = in.Processors + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make([]LoadBalancerReference, len(*in)) + copy(*out, *in) + } return } diff --git a/machine/v1/zz_generated.swagger_doc_generated.go b/machine/v1/zz_generated.swagger_doc_generated.go index 226c28d5c80..6c9282548e0 100644 --- a/machine/v1/zz_generated.swagger_doc_generated.go +++ b/machine/v1/zz_generated.swagger_doc_generated.go @@ -319,6 +319,16 @@ func (NutanixResourceIdentifier) SwaggerDoc() map[string]string { return map_NutanixResourceIdentifier } +var map_LoadBalancerReference = map[string]string{ + "": "LoadBalancerReference is a reference to a load balancer on IBM Cloud virtual private cloud(VPC).", + "name": "name of the LoadBalancer in IBM Cloud VPC. The name should be between 1 and 63 characters long and may consist of lowercase alphanumeric characters and hyphens only. The value must not end with a hyphen. It is a reference to existing LoadBalancer created by openshift installer component.", + "type": "type of the LoadBalancer service supported by IBM Cloud VPC. Currently, only Application LoadBalancer is supported. More details about Application LoadBalancer https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui Supported values are Application.", +} + +func (LoadBalancerReference) SwaggerDoc() map[string]string { + return map_LoadBalancerReference +} + var map_PowerVSMachineProviderConfig = map[string]string{ "": "PowerVSMachineProviderConfig is the type that will be embedded in a Machine.Spec.ProviderSpec field for a PowerVS virtual machine. It is used by the PowerVS machine actuator to create a single Machine.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "userDataSecret": "userDataSecret contains a local reference to a secret that contains the UserData to apply to the instance.", @@ -331,6 +341,7 @@ var map_PowerVSMachineProviderConfig = map[string]string{ "processorType": "processorType is the VM instance processor type. It must be set to one of the following values: Dedicated, Capped or Shared. Dedicated: resources are allocated for a specific client, The hypervisor makes a 1:1 binding of a partition’s processor to a physical processor core. Shared: Shared among other clients. Capped: Shared, but resources do not expand beyond those that are requested, the amount of CPU time is Capped to the value specified for the entitlement. if the processorType is selected as Dedicated, then processors value cannot be fractional. When omitted, this means that the user has no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is Shared.", "processors": "processors is the number of virtual processors in a virtual machine. when the processorType is selected as Dedicated the processors value cannot be fractional. maximum value for the Processors depends on the selected SystemType. when SystemType is set to e880 or e980 maximum Processors value is 143. when SystemType is set to s922 maximum Processors value is 15. minimum value for Processors depends on the selected ProcessorType. when ProcessorType is set as Shared or Capped, The minimum processors is 0.5. when ProcessorType is set as Dedicated, The minimum processors is 1. When omitted, this means that the user has no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The default is set based on the selected ProcessorType. when ProcessorType selected as Dedicated, the default is set to 1. when ProcessorType selected as Shared or Capped, the default is set to 0.5.", "memoryGiB": "memoryGiB is the size of a virtual machine's memory, in GiB. maximum value for the MemoryGiB depends on the selected SystemType. when SystemType is set to e880 maximum MemoryGiB value is 7463 GiB. when SystemType is set to e980 maximum MemoryGiB value is 15307 GiB. when SystemType is set to s922 maximum MemoryGiB value is 942 GiB. The minimum memory is 32 GiB. When omitted, this means the user has no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is 32.", + "loadBalancers": "loadBalancers is the set of load balancers to which the new control plane instance should be added once it is created.", } func (PowerVSMachineProviderConfig) SwaggerDoc() map[string]string { diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 85d83f3f830..ad9d04bd63d 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -581,6 +581,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/machine/v1.DataDiskProperties": schema_openshift_api_machine_v1_DataDiskProperties(ref), "github.com/openshift/api/machine/v1.FailureDomains": schema_openshift_api_machine_v1_FailureDomains(ref), "github.com/openshift/api/machine/v1.GCPFailureDomain": schema_openshift_api_machine_v1_GCPFailureDomain(ref), + "github.com/openshift/api/machine/v1.LoadBalancerReference": schema_openshift_api_machine_v1_LoadBalancerReference(ref), "github.com/openshift/api/machine/v1.NutanixCategory": schema_openshift_api_machine_v1_NutanixCategory(ref), "github.com/openshift/api/machine/v1.NutanixMachineProviderConfig": schema_openshift_api_machine_v1_NutanixMachineProviderConfig(ref), "github.com/openshift/api/machine/v1.NutanixMachineProviderStatus": schema_openshift_api_machine_v1_NutanixMachineProviderStatus(ref), @@ -28886,6 +28887,36 @@ func schema_openshift_api_machine_v1_GCPFailureDomain(ref common.ReferenceCallba } } +func schema_openshift_api_machine_v1_LoadBalancerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "LoadBalancerReference is a reference to a load balancer on IBM Cloud virtual private cloud(VPC).", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the LoadBalancer in IBM Cloud VPC. The name should be between 1 and 63 characters long and may consist of lowercase alphanumeric characters and hyphens only. The value must not end with a hyphen. It is a reference to existing LoadBalancer created by openshift installer component.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of the LoadBalancer service supported by IBM Cloud VPC. Currently, only Application LoadBalancer is supported. More details about Application LoadBalancer https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui Supported values are Application.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "type"}, + }, + }, + } +} + func schema_openshift_api_machine_v1_NutanixCategory(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -29291,12 +29322,26 @@ func schema_openshift_api_machine_v1_PowerVSMachineProviderConfig(ref common.Ref Format: "int32", }, }, + "loadBalancers": { + SchemaProps: spec.SchemaProps{ + Description: "loadBalancers is the set of load balancers to which the new control plane instance should be added once it is created.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/machine/v1.LoadBalancerReference"), + }, + }, + }, + }, + }, }, Required: []string{"serviceInstance", "image", "network", "keyPairName"}, }, }, Dependencies: []string{ - "github.com/openshift/api/machine/v1.PowerVSResource", "github.com/openshift/api/machine/v1.PowerVSSecretReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + "github.com/openshift/api/machine/v1.LoadBalancerReference", "github.com/openshift/api/machine/v1.PowerVSResource", "github.com/openshift/api/machine/v1.PowerVSSecretReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, } } diff --git a/openapi/openapi.json b/openapi/openapi.json index 7c04a43367c..69484142c81 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -16745,6 +16745,26 @@ } } }, + "com.github.openshift.api.machine.v1.LoadBalancerReference": { + "description": "LoadBalancerReference is a reference to a load balancer on IBM Cloud virtual private cloud(VPC).", + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "name of the LoadBalancer in IBM Cloud VPC. The name should be between 1 and 63 characters long and may consist of lowercase alphanumeric characters and hyphens only. The value must not end with a hyphen. It is a reference to existing LoadBalancer created by openshift installer component.", + "type": "string", + "default": "" + }, + "type": { + "description": "type of the LoadBalancer service supported by IBM Cloud VPC. Currently, only Application LoadBalancer is supported. More details about Application LoadBalancer https://cloud.ibm.com/docs/vpc?topic=vpc-load-balancers-about&interface=ui Supported values are Application.", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.machine.v1.NutanixCategory": { "description": "NutanixCategory identifies a pair of prism category key and value", "type": "object", @@ -16977,6 +16997,14 @@ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, + "loadBalancers": { + "description": "loadBalancers is the set of load balancers to which the new control plane instance should be added once it is created.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.machine.v1.LoadBalancerReference" + } + }, "memoryGiB": { "description": "memoryGiB is the size of a virtual machine's memory, in GiB. maximum value for the MemoryGiB depends on the selected SystemType. when SystemType is set to e880 maximum MemoryGiB value is 7463 GiB. when SystemType is set to e980 maximum MemoryGiB value is 15307 GiB. when SystemType is set to s922 maximum MemoryGiB value is 942 GiB. The minimum memory is 32 GiB. When omitted, this means the user has no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is 32.", "type": "integer",