-
Notifications
You must be signed in to change notification settings - Fork 76
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
API changes to support infra creation #1485
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance"` | ||
|
||
// The Name of Power VS zone where the cluster will be created | ||
Zone string `json:"zone"` | ||
|
||
// ResourceGroup name under which the resources will be created. | ||
ResourceGroup string `json:"resourceGroup"` | ||
|
||
// VPC contains information about IBM Cloud VPC resources | ||
// +optional | ||
VPC VPCResource `json:"vpc"` | ||
|
||
// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. | ||
// +optional | ||
ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` |
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.
IMO everything should be optional and can have some default values if not supplied to have backward compatibility
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.
agree, I think we can make use of webhooks to handle it.
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.
we need a discussion about this, like what fields can be default set and what values.
// ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed. | ||
// +kubebuilder:validation:MinLength=1 | ||
// Deprecated: use ServiceInstance.ID instead |
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.
why just ID? there are other fields like name, regex
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.
My intention was to refer ServiceInstanceID to ServiceInstance.ID, But yes we can use anything out of Name, ID, Regex, Update it accrodingly
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.
make sense
Ready bool `json:"ready"` | ||
|
||
// serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. | ||
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance,omitempty"` |
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.
in status we can have just the id
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance,omitempty"` | ||
|
||
// Network is the reference to the Network to use for this cluster. | ||
Network IBMPowerVSResourceReference `json:"network,omitempty"` |
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.
same here, lets have only id here
Network IBMPowerVSResourceReference `json:"network,omitempty"` | ||
|
||
// VPC holds the status of VPC resources | ||
VPC VPCResource `json:"vpc,omitempty"` |
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.
again lets use only id in the status
Subnet Subnet `json:"subnet"` | ||
|
||
// TransitGateway holds the resource details of TransitGateway | ||
TransitGateway TransitGateway `json:"transitGateway"` |
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 believe TransitGateway itself is a different component and works like connector between the vpc and classic n/w, so wondering if we need to define outside the vpc data structures
api/v1beta2/ibmvpccluster_types.go
Outdated
type VPCLoadBalancerStatus struct { | ||
// Name of the VPC load balancer. | ||
// +optional | ||
Name string `json:"name,omitempty"` |
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.
in the status we shouldn't be mentioning the name
43ebc19
to
00219a6
Compare
Addressed first set of review comments. |
00219a6
to
5f202fe
Compare
5f202fe
to
270b2ce
Compare
270b2ce
to
f36b32e
Compare
Addressed all the review comments |
Zone string `json:"zone"` | ||
|
||
// resourceGroup name under which the resources will be created. | ||
ResourceGroup string `json:"resourceGroup"` |
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.
lets have this as optional and use the default resource group when not supplied
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance"` | ||
|
||
// zone is the name of Power VS zone where the cluster will be created | ||
Zone string `json:"zone"` |
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.
we need have this as an optional to have a backward compatibility, lets also had a link which talks about all the possible values - https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server
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.
What should be the default zone to use. Also I think we can validate this filed to have value when ServiceInstance info is not provided.
api/v1beta2/ibmvpcmachine_types.go
Outdated
@@ -78,6 +78,9 @@ type IBMVPCResourceReference struct { | |||
// +kubebuilder:validation:MinLength=1 | |||
// +optional | |||
Name *string `json:"name,omitempty"` | |||
|
|||
// IBM Cloud VPC zone | |||
Zone *string `json:"vpcZone,omitempty"` |
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.
As we have already a zone field in the IBMVPCMachineSpec
, this entry may create confusion here
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.
Will remove it from here and create new resource VPCResource type with zone.
91fb6bf
to
6c7a301
Compare
6c7a301
to
d5d080b
Compare
d5d080b
to
ff65733
Compare
e3a9a29
to
9443ac2
Compare
|
||
// vpcSubnet contains information about IBM Cloud VPC Subnet resources | ||
// +optional | ||
VPCSubnet *Subnet `json:"vpcSubnet,omitempty"` |
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.
VPCSubnet *Subnet `json:"vpcSubnet,omitempty"` | |
VPCSubnet []Subnet `json:"vpcSubnet,omitempty"` |
api/v1beta2/ibmvpccluster_types.go
Outdated
// +kubebuilder:default=control-plane | ||
// +kubebuilder:validation:Enum=control-plane | ||
// +optional | ||
Scheme *LoadBalancerScheme `json:"scheme,omitempty"` |
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.
change it to Public
COSBucket *ResourceReference `json:"cosBucket,omitempty"` | ||
|
||
// loadBalancers reference to IBM Cloud VPC Loadbalancer. | ||
LoadBalancers []VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` |
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.
Explore on using map instead of slice
LoadBalancers []VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` | |
LoadBalancers map[string]VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` |
// (https://coreos.github.io/ignition/) for bootstrapping (requires | ||
// BootstrapFormatIgnition feature flag to be enabled). | ||
// +optional | ||
CosBucket *CosBucket `json:"cosBucket,omitempty"` |
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.
CosBucket *CosBucket `json:"cosBucket,omitempty"` | |
CosInstance *CosInstance `json:"cosInstance,omitempty"` |
Use annotations to support existing way of creating cluster |
9443ac2
to
49aa805
Compare
49aa805
to
a2d2a73
Compare
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.
Lets start using this terminology PowerVS workspace
instead of service instance
Network IBMPowerVSResourceReference `json:"network"` | ||
|
||
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. | ||
// +optional | ||
ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` | ||
|
||
// serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. | ||
// Power VS service is a container for all Power VS instances at a specific geographic region. |
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.
// Power VS service is a container for all Power VS instances at a specific geographic region. | |
// Power Virtual Server workspace is a container for all Power Virtual Server instances at a specific geographic region. |
Zone *string `json:"zone,omitempty"` | ||
|
||
// resourceGroup name under which the resources will be created. | ||
// when omitted Default resource group will be used. |
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.
This is not a Default
one by name, IBM cloud can set some other name as well for the default if I'm not wrong, lets modify the message accordingly.
// +optional | ||
VPCSubnets []Subnet `json:"vpcSubnets,omitempty"` | ||
|
||
// transitGateway contains information about IBM Cloud TransitGateway. |
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.
it will be great if you can add a link to the ibm cloud document for more information.
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.
and the purpose of this entity here
// +optional | ||
TransitGateway *TransitGateway `json:"transitGateway,omitempty"` | ||
|
||
// loadBalancers is optional configuration for configuring loadbalancers to control plane or data plane nodes. |
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.
information needs to added to to mention why is this optional and what happens user doesn't supply
Name *string `json:"name,omitempty"` | ||
|
||
// IBM Cloud VPC zone | ||
Zone *string `json:"zone,omitempty"` |
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.
why do we need this? can we just create subnets in all the zones by default.?
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.
This is reference used for VPC. zone indicates vpc zone and yes as of today only one subnet is created associated to this zone.
// Version defines which version of Ignition will be used to generate bootstrap data. | ||
// | ||
// +optional | ||
// +kubebuilder:default="2.3" |
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.
why it is set to 2.3 version?
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.
Capi doc says only v2 is tested https://cluster-api.sigs.k8s.io/tasks/experimental-features/ignition#note
|
||
// Ignition defined options related to the bootstrapping systems where Ignition is used. | ||
// +optional | ||
Ignition *Ignition `json:"ignition,omitempty"` |
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.
why a struct here? right now I see just a version, do we expect anything else in the future?
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.
Took a reference from other provider(aws).
api/v1beta2/ibmvpccluster_types.go
Outdated
} | ||
|
||
// LoadBalancerScheme defines the scheme of a load balancer. | ||
type LoadBalancerScheme string |
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.
where is this used?
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.
not used, will be removed.
2309e2d
to
1db1e21
Compare
1db1e21
to
8f8ed21
Compare
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.
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.
/unhold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Karthik-K-N, mkumatag, Prajyot-Parab The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Contains the API changes to infra creation as a part of Power VS cluster creation
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
/area provider/ibmcloud
Release note:
Partially fixes: #1450