-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VPC: VPCCluster definition extension #1683
Closed
+711
−44
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"` | ||
} | ||
Comment on lines
+137
to
+153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
// 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. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the shared basic types is added in time, this should be
COSInstanceReference
, fromtypes.go
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm dropping this reference, as I don't plan to manage COS resources.
Instead, I will incorporate a new
ImageSpec
, which will have details about the expected VSI Custom Image, which could include a COS ObjectURL, to create a new Custom Image from, if necessary.