From 33d3af959ec8c741e2aff35597c56bed5ff313bf Mon Sep 17 00:00:00 2001 From: cjschaef Date: Thu, 14 Mar 2024 14:42:48 -0500 Subject: [PATCH] VPC: VPCCluster definition extension Extend the VPCCluster definition to include additional VPC resources and expand configuration options. --- api/v1beta1/ibmvpc_conversion.go | 8 + api/v1beta1/zz_generated.conversion.go | 46 ++-- api/v1beta2/ibmvpccluster_types.go | 114 +++++++- api/v1beta2/zz_generated.deepcopy.go | 217 ++++++++++++++- ...cture.cluster.x-k8s.io_ibmvpcclusters.yaml | 253 +++++++++++++++++- ...uster.x-k8s.io_ibmvpcclustertemplates.yaml | 117 ++++++++ 6 files changed, 711 insertions(+), 44 deletions(-) diff --git a/api/v1beta1/ibmvpc_conversion.go b/api/v1beta1/ibmvpc_conversion.go index 3679f88b4..f049de2bf 100644 --- a/api/v1beta1/ibmvpc_conversion.go +++ b/api/v1beta1/ibmvpc_conversion.go @@ -223,3 +223,11 @@ func Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_stri func Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in *infrav1beta2.VPCLoadBalancerSpec, out *VPCLoadBalancerSpec, s apiconversion.Scope) error { return autoConvert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in, out, s) } + +func Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in *infrav1beta2.IBMVPCClusterSpec, out *IBMVPCClusterSpec, s apiconversion.Scope) error { + return autoConvert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in, out, s) +} + +func Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in *infrav1beta2.IBMVPCClusterStatus, out *IBMVPCClusterStatus, s apiconversion.Scope) error { + return autoConvert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in, out, s) +} diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go index 16331b361..e7f4373d6 100644 --- a/api/v1beta1/zz_generated.conversion.go +++ b/api/v1beta1/zz_generated.conversion.go @@ -259,21 +259,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCClusterSpec)(nil), (*IBMVPCClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(a.(*v1beta2.IBMVPCClusterSpec), b.(*IBMVPCClusterSpec), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*IBMVPCClusterStatus)(nil), (*v1beta2.IBMVPCClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(a.(*IBMVPCClusterStatus), b.(*v1beta2.IBMVPCClusterStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCClusterStatus)(nil), (*IBMVPCClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(a.(*v1beta2.IBMVPCClusterStatus), b.(*IBMVPCClusterStatus), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*IBMVPCMachine)(nil), (*v1beta2.IBMVPCMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(a.(*IBMVPCMachine), b.(*v1beta2.IBMVPCMachine), scope) }); err != nil { @@ -444,6 +434,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1beta2.IBMVPCClusterSpec)(nil), (*IBMVPCClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(a.(*v1beta2.IBMVPCClusterSpec), b.(*IBMVPCClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.IBMVPCClusterStatus)(nil), (*IBMVPCClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(a.(*v1beta2.IBMVPCClusterStatus), b.(*IBMVPCClusterStatus), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1beta2.IBMVPCMachineSpec)(nil), (*IBMVPCMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(a.(*v1beta2.IBMVPCMachineSpec), b.(*IBMVPCMachineSpec), scope) }); err != nil { @@ -1267,14 +1267,12 @@ func autoConvert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in *v1be } else { out.ControlPlaneLoadBalancer = nil } + // WARNING: in.COSInstance requires manual conversion: does not exist in peer-type + // WARNING: in.LoadBalancers requires manual conversion: does not exist in peer-type + // WARNING: in.NetworkSpec requires manual conversion: does not exist in peer-type return nil } -// Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in *v1beta2.IBMVPCClusterSpec, out *IBMVPCClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in, out, s) -} - func autoConvert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(in *IBMVPCClusterStatus, out *v1beta2.IBMVPCClusterStatus, s conversion.Scope) error { if err := Convert_v1beta1_VPC_To_v1beta2_VPC(&in.VPC, &out.VPC, s); err != nil { return err @@ -1297,26 +1295,24 @@ func Convert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(in *IBMV } func autoConvert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in *v1beta2.IBMVPCClusterStatus, out *IBMVPCClusterStatus, s conversion.Scope) error { - if err := Convert_v1beta2_VPC_To_v1beta1_VPC(&in.VPC, &out.VPC, s); err != nil { - return err - } + out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + out.ControlPlaneLoadBalancerState = VPCLoadBalancerState(in.ControlPlaneLoadBalancerState) + // WARNING: in.COSInstance requires manual conversion: does not exist in peer-type + // WARNING: in.NetworkStatus requires manual conversion: does not exist in peer-type out.Ready = in.Ready + // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type if err := Convert_v1beta2_Subnet_To_v1beta1_Subnet(&in.Subnet, &out.Subnet, s); err != nil { return err } + if err := Convert_v1beta2_VPC_To_v1beta1_VPC(&in.VPC, &out.VPC, s); err != nil { + return err + } if err := Convert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint(&in.VPCEndpoint, &out.VPCEndpoint, s); err != nil { return err } - out.ControlPlaneLoadBalancerState = VPCLoadBalancerState(in.ControlPlaneLoadBalancerState) - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) return nil } -// Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in *v1beta2.IBMVPCClusterStatus, out *IBMVPCClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in, out, s) -} - func autoConvert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(in *IBMVPCMachine, out *v1beta2.IBMVPCMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(&in.Spec, &out.Spec, s); err != nil { diff --git a/api/v1beta2/ibmvpccluster_types.go b/api/v1beta2/ibmvpccluster_types.go index 3581aa78a..c5fa618b6 100644 --- a/api/v1beta2/ibmvpccluster_types.go +++ b/api/v1beta2/ibmvpccluster_types.go @@ -54,6 +54,18 @@ type IBMVPCClusterSpec struct { // ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. // +optional ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` + + // cosInstance is the IBM COS instance to use for cluster resources. + // +optional + COSInstance *COSInstance `json:"cosInstance,omitempty"` + + // loadBalancers is a set of VPC Load Balancers definition to use for the cluster. + // +optional + LoadBalancers []*VPCLoadBalancerSpec `json:"loadbalancers,omitempty"` + + // networkSpec represents the VPC network to use for the cluster. + // +optional + NetworkSpec *VPCNetworkSpec `json:"networkSpec,omitempty"` } // VPCLoadBalancerSpec defines the desired state of an VPC load balancer. @@ -103,25 +115,111 @@ type VPCLoadBalancerStatus struct { ControllerCreated *bool `json:"controllerCreated,omitempty"` } +// VPCNetworkSpec defines the desired state of the network resources for the cluster. +type VPCNetworkSpec struct { + // computeSubnetsSpec is a set of Subnet's which define the Compute subnets. + ComputeSubnetsSpec []Subnet `json:"computeSubnetsSpec,omitempty"` + + // controlPlaneSubnetsSpec is a set of Subnet's which define the Control Plane subnets. + ControlPlaneSubnetsSpec []Subnet `json:"controlPlaneSubentsSpec,omitempty"` + + // resourceGroup is the name of the Resource Group containing all of the newtork resources. + // This can be different than the Resource Group containing the remaining cluster resources. + ResourceGroup *string `json:"resourceGroup,omitempty"` + + // securityGroups is a set of SecurityGroup's which define the VPC Security Groups that manage traffic within and out of the VPC. + SecurityGroups []SecurityGroup `json:"securityGroups,omitempty"` + + // vpc defines the IBM Cloud VPC. + VPC *VPCResource `json:"vpc,omitempty"` +} + +// SecurityGroup dummy. +// TODO(cjschaef): Dummy SecurityGroup until it is defined in a common location. +type SecurityGroup struct { + Name string `json:"name"` +} + +// COSInstance dummy. +// TODO(cjschaef): Dummy COSInstance until it is defined in a common location. +type COSInstance struct { + Name string `json:"name"` +} + +// VPCResource dummy. +// TODO(cjschaef): Dummy VPCResource until it is defined in a common location. +type VPCResource struct { + Name string `json:"name"` +} + // IBMVPCClusterStatus defines the observed state of IBMVPCCluster. type IBMVPCClusterStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file - VPC VPC `json:"vpc,omitempty"` - // Ready is true when the provider resource is ready. + // Conditions defines current service state of the load balancer. // +optional - Ready bool `json:"ready"` - Subnet Subnet `json:"subnet,omitempty"` - VPCEndpoint VPCEndpoint `json:"vpcEndpoint,omitempty"` + Conditions capiv1beta1.Conditions `json:"conditions,omitempty"` // ControlPlaneLoadBalancerState is the status of the load balancer. + // dep: rely on NetworkStatus instead. // +optional ControlPlaneLoadBalancerState VPCLoadBalancerState `json:"controlPlaneLoadBalancerState,omitempty"` - // Conditions defines current service state of the load balancer. + // COSInstance is the reference to the IBM Cloud COS Instance used for the cluster. + COSInstance *ResourceReference `json:"cosInstance,omitempty"` + + // networkStatus is the status of the VPC network in its entirety resources. + NetworkStatus *VPCNetworkStatus `json:"networkStatus,omitempty"` + + // ready is true when the provider resource is ready. + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // resourceGroup is the reference to the IBM Cloud VPC resource group under which the resources will be created. + ResourceGroup *ResourceReference `json:"resourceGroupID,omitempty"` + + // dep: rely on NetworkStatus instead. + Subnet Subnet `json:"subnet,omitempty"` + + // dep: rely on NetworkStatus instead. + VPC VPC `json:"vpc,omitempty"` + + // dep: rely on ControlPlaneEndpoint + VPCEndpoint VPCEndpoint `json:"vpcEndpoint,omitempty"` +} + +// VPCNetworkStatus provides details on the status of VPC network resources. +type VPCNetworkStatus struct { + // computeSubnets references the VPC Subnets for the cluster's Data Plane. // +optional - Conditions capiv1beta1.Conditions `json:"conditions,omitempty"` + ComputeSubnets []*VPCResourceStatus `json:"computeSubnets,omitempty"` + + // controlPlaneSubnets references the VPC Subnets for the cluster's Control Plane. + // +optional + ControlPlaneSubnets []*VPCResourceStatus `json:"controlPlaneSubnets,omitempty"` + + // loadBalancers references the VPC Load Balancer's for the cluster. + // +optional + LoadBalancers []VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` + + // publicGateways references the VPC Public Gateways for the cluster. + // +optional + PublicGateways []*VPCResourceStatus `json:"publicGateways,omitempty"` + + // securityGroups references the VPC Security Groups for the cluster. + // +optional + SecurityGroups []*VPCResourceStatus `json:"securityGroups,omitempty"` + + // vpc references the IBM Cloud VPC. + // +optional + VPC *VPCResourceStatus `json:"vpc,omitempty"` +} + +// VPCResourceStatus identifies a resource by crn and type and whether it was created by the controller. +type VPCResourceStatus struct { + // crn defines the IBM Cloud CRN of the resource. + // +required + CRN string `json:"crn"` } // VPC holds the VPC information. diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 031aa6671..96691cc24 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -42,6 +42,21 @@ func (in *AdditionalListenerSpec) DeepCopy() *AdditionalListenerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *COSInstance) DeepCopyInto(out *COSInstance) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new COSInstance. +func (in *COSInstance) DeepCopy() *COSInstance { + if in == nil { + return nil + } + out := new(COSInstance) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CosInstance) DeepCopyInto(out *CosInstance) { *out = *in @@ -859,6 +874,27 @@ func (in *IBMVPCClusterSpec) DeepCopyInto(out *IBMVPCClusterSpec) { *out = new(VPCLoadBalancerSpec) (*in).DeepCopyInto(*out) } + if in.COSInstance != nil { + in, out := &in.COSInstance, &out.COSInstance + *out = new(COSInstance) + **out = **in + } + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make([]*VPCLoadBalancerSpec, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VPCLoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + } + } + if in.NetworkSpec != nil { + in, out := &in.NetworkSpec, &out.NetworkSpec + *out = new(VPCNetworkSpec) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterSpec. @@ -874,9 +910,6 @@ func (in *IBMVPCClusterSpec) DeepCopy() *IBMVPCClusterSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IBMVPCClusterStatus) DeepCopyInto(out *IBMVPCClusterStatus) { *out = *in - out.VPC = in.VPC - in.Subnet.DeepCopyInto(&out.Subnet) - in.VPCEndpoint.DeepCopyInto(&out.VPCEndpoint) if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make(v1beta1.Conditions, len(*in)) @@ -884,6 +917,24 @@ func (in *IBMVPCClusterStatus) DeepCopyInto(out *IBMVPCClusterStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.COSInstance != nil { + in, out := &in.COSInstance, &out.COSInstance + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.NetworkStatus != nil { + in, out := &in.NetworkStatus, &out.NetworkStatus + *out = new(VPCNetworkStatus) + (*in).DeepCopyInto(*out) + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + in.Subnet.DeepCopyInto(&out.Subnet) + out.VPC = in.VPC + in.VPCEndpoint.DeepCopyInto(&out.VPCEndpoint) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterStatus. @@ -1301,6 +1352,21 @@ func (in *ResourceReference) DeepCopy() *ResourceReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. +func (in *SecurityGroup) DeepCopy() *SecurityGroup { + if in == nil { + return nil + } + out := new(SecurityGroup) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Subnet) DeepCopyInto(out *Subnet) { *out = *in @@ -1466,6 +1532,136 @@ func (in *VPCLoadBalancerStatus) DeepCopy() *VPCLoadBalancerStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNetworkSpec) DeepCopyInto(out *VPCNetworkSpec) { + *out = *in + if in.ComputeSubnetsSpec != nil { + in, out := &in.ComputeSubnetsSpec, &out.ComputeSubnetsSpec + *out = make([]Subnet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ControlPlaneSubnetsSpec != nil { + in, out := &in.ControlPlaneSubnetsSpec, &out.ControlPlaneSubnetsSpec + *out = make([]Subnet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(string) + **out = **in + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]SecurityGroup, len(*in)) + copy(*out, *in) + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(VPCResource) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNetworkSpec. +func (in *VPCNetworkSpec) DeepCopy() *VPCNetworkSpec { + if in == nil { + return nil + } + out := new(VPCNetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNetworkStatus) DeepCopyInto(out *VPCNetworkStatus) { + *out = *in + if in.ComputeSubnets != nil { + in, out := &in.ComputeSubnets, &out.ComputeSubnets + *out = make([]*VPCResourceStatus, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VPCResourceStatus) + **out = **in + } + } + } + if in.ControlPlaneSubnets != nil { + in, out := &in.ControlPlaneSubnets, &out.ControlPlaneSubnets + *out = make([]*VPCResourceStatus, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VPCResourceStatus) + **out = **in + } + } + } + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make([]VPCLoadBalancerStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PublicGateways != nil { + in, out := &in.PublicGateways, &out.PublicGateways + *out = make([]*VPCResourceStatus, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VPCResourceStatus) + **out = **in + } + } + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]*VPCResourceStatus, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VPCResourceStatus) + **out = **in + } + } + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(VPCResourceStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNetworkStatus. +func (in *VPCNetworkStatus) DeepCopy() *VPCNetworkStatus { + if in == nil { + return nil + } + out := new(VPCNetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCResource) DeepCopyInto(out *VPCResource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCResource. +func (in *VPCResource) DeepCopy() *VPCResource { + if in == nil { + return nil + } + out := new(VPCResource) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VPCResourceReference) DeepCopyInto(out *VPCResourceReference) { *out = *in @@ -1496,6 +1692,21 @@ func (in *VPCResourceReference) DeepCopy() *VPCResourceReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCResourceStatus) DeepCopyInto(out *VPCResourceStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCResourceStatus. +func (in *VPCResourceStatus) DeepCopy() *VPCResourceStatus { + if in == nil { + return nil + } + out := new(VPCResourceStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VPCVolume) DeepCopyInto(out *VPCVolume) { *out = *in diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml index da9f3a699..46d6e56e9 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml @@ -285,6 +285,122 @@ spec: private type: boolean type: object + cosInstance: + description: cosInstance is the IBM COS instance to use for cluster + resources. + properties: + name: + type: string + required: + - name + type: object + loadbalancers: + description: loadBalancers is a set of VPC Load Balancers definition + to use for the cluster. + items: + description: VPCLoadBalancerSpec defines the desired state of an + VPC load balancer. + properties: + additionalListeners: + description: AdditionalListeners sets the additional listeners + for the control plane load balancer. + items: + description: |- + AdditionalListenerSpec defines the desired state of an + additional listener on an VPC load balancer. + properties: + port: + description: Port sets the port for the additional listener. + format: int64 + maximum: 65535 + minimum: 1 + type: integer + required: + - port + type: object + type: array + x-kubernetes-list-map-keys: + - port + x-kubernetes-list-type: map + id: + description: id of the loadbalancer + type: string + name: + description: Name sets the name of the VPC load balancer. + maxLength: 63 + type: string + public: + default: true + description: public indicates that load balancer is public or + private + type: boolean + type: object + type: array + networkSpec: + description: networkSpec represents the VPC network to use for the + cluster. + properties: + computeSubnetsSpec: + description: computeSubnetsSpec is a set of Subnet's which define + the Compute subnets. + items: + description: Subnet describes a subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + zone: + type: string + type: object + type: array + controlPlaneSubentsSpec: + description: controlPlaneSubnetsSpec is a set of Subnet's which + define the Control Plane subnets. + items: + description: Subnet describes a subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + zone: + type: string + type: object + type: array + resourceGroup: + description: |- + resourceGroup is the name of the Resource Group containing all of the newtork resources. + This can be different than the Resource Group containing the remaining cluster resources. + type: string + securityGroups: + description: securityGroups is a set of SecurityGroup's which + define the VPC Security Groups that manage traffic within and + out of the VPC. + items: + description: |- + SecurityGroup dummy. + TODO(cjschaef): Dummy SecurityGroup until it is defined in a common location. + properties: + name: + type: string + required: + - name + type: object + type: array + vpc: + description: vpc defines the IBM Cloud VPC. + properties: + name: + type: string + required: + - name + type: object + type: object region: description: The IBM Cloud Region the cluster lives in. type: string @@ -352,14 +468,135 @@ spec: type: object type: array controlPlaneLoadBalancerState: - description: ControlPlaneLoadBalancerState is the status of the load - balancer. + description: |- + ControlPlaneLoadBalancerState is the status of the load balancer. + dep: rely on NetworkStatus instead. type: string + cosInstance: + description: COSInstance is the reference to the IBM Cloud COS Instance + used for the cluster. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object + networkStatus: + description: networkStatus is the status of the VPC network in its + entirety resources. + properties: + computeSubnets: + description: computeSubnets references the VPC Subnets for the + cluster's Data Plane. + items: + description: VPCResourceStatus identifies a resource by crn + and type and whether it was created by the controller. + properties: + crn: + description: crn defines the IBM Cloud CRN of the resource. + type: string + required: + - crn + type: object + type: array + controlPlaneSubnets: + description: controlPlaneSubnets references the VPC Subnets for + the cluster's Control Plane. + items: + description: VPCResourceStatus identifies a resource by crn + and type and whether it was created by the controller. + properties: + crn: + description: crn defines the IBM Cloud CRN of the resource. + type: string + required: + - crn + type: object + type: array + loadBalancers: + description: loadBalancers references the VPC Load Balancer's + for the cluster. + items: + description: VPCLoadBalancerStatus defines the status VPC load + balancer. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + hostname: + description: hostname is the hostname of load balancer. + type: string + id: + description: id of VPC load balancer. + type: string + state: + description: State is the status of the load balancer. + type: string + type: object + type: array + publicGateways: + description: publicGateways references the VPC Public Gateways + for the cluster. + items: + description: VPCResourceStatus identifies a resource by crn + and type and whether it was created by the controller. + properties: + crn: + description: crn defines the IBM Cloud CRN of the resource. + type: string + required: + - crn + type: object + type: array + securityGroups: + description: securityGroups references the VPC Security Groups + for the cluster. + items: + description: VPCResourceStatus identifies a resource by crn + and type and whether it was created by the controller. + properties: + crn: + description: crn defines the IBM Cloud CRN of the resource. + type: string + required: + - crn + type: object + type: array + vpc: + description: vpc references the IBM Cloud VPC. + properties: + crn: + description: crn defines the IBM Cloud CRN of the resource. + type: string + required: + - crn + type: object + type: object ready: - description: Ready is true when the provider resource is ready. + default: false + description: ready is true when the provider resource is ready. type: boolean + resourceGroupID: + description: resourceGroup is the reference to the IBM Cloud VPC resource + group under which the resources will be created. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object subnet: - description: Subnet describes a subnet. + description: 'dep: rely on NetworkStatus instead.' properties: cidr: type: string @@ -371,9 +608,7 @@ spec: type: string type: object vpc: - description: |- - INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - Important: Run "make" to regenerate code after modifying this file + description: 'dep: rely on NetworkStatus instead.' properties: id: type: string @@ -384,7 +619,7 @@ spec: - name type: object vpcEndpoint: - description: VPCEndpoint describes a VPCEndpoint. + description: 'dep: rely on ControlPlaneEndpoint' properties: address: type: string @@ -397,6 +632,8 @@ spec: required: - address type: object + required: + - ready type: object type: object served: true diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml index c0178c41e..f4800f17c 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml @@ -134,6 +134,123 @@ spec: or private type: boolean type: object + cosInstance: + description: cosInstance is the IBM COS instance to use for + cluster resources. + properties: + name: + type: string + required: + - name + type: object + loadbalancers: + description: loadBalancers is a set of VPC Load Balancers + definition to use for the cluster. + items: + description: VPCLoadBalancerSpec defines the desired state + of an VPC load balancer. + properties: + additionalListeners: + description: AdditionalListeners sets the additional + listeners for the control plane load balancer. + items: + description: |- + AdditionalListenerSpec defines the desired state of an + additional listener on an VPC load balancer. + properties: + port: + description: Port sets the port for the additional + listener. + format: int64 + maximum: 65535 + minimum: 1 + type: integer + required: + - port + type: object + type: array + x-kubernetes-list-map-keys: + - port + x-kubernetes-list-type: map + id: + description: id of the loadbalancer + type: string + name: + description: Name sets the name of the VPC load balancer. + maxLength: 63 + type: string + public: + default: true + description: public indicates that load balancer is + public or private + type: boolean + type: object + type: array + networkSpec: + description: networkSpec represents the VPC network to use + for the cluster. + properties: + computeSubnetsSpec: + description: computeSubnetsSpec is a set of Subnet's which + define the Compute subnets. + items: + description: Subnet describes a subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + zone: + type: string + type: object + type: array + controlPlaneSubentsSpec: + description: controlPlaneSubnetsSpec is a set of Subnet's + which define the Control Plane subnets. + items: + description: Subnet describes a subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + zone: + type: string + type: object + type: array + resourceGroup: + description: |- + resourceGroup is the name of the Resource Group containing all of the newtork resources. + This can be different than the Resource Group containing the remaining cluster resources. + type: string + securityGroups: + description: securityGroups is a set of SecurityGroup's + which define the VPC Security Groups that manage traffic + within and out of the VPC. + items: + description: |- + SecurityGroup dummy. + TODO(cjschaef): Dummy SecurityGroup until it is defined in a common location. + properties: + name: + type: string + required: + - name + type: object + type: array + vpc: + description: vpc defines the IBM Cloud VPC. + properties: + name: + type: string + required: + - name + type: object + type: object region: description: The IBM Cloud Region the cluster lives in. type: string