-
Notifications
You must be signed in to change notification settings - Fork 85
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: Extend VPC Machine API's #1978
VPC: Extend VPC Machine API's #1978
Conversation
Hi @cjschaef. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
// CatalogOffering is the Catalog Offering OS image which would be installed on the instance. | ||
// An OfferingCRN or VersionCRN is required, the PlanCRN is optional. | ||
// +optional | ||
CatalogOffering *IBMCloudCatalogOffering `json:"catalogOffering,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.
For my understanding, how would this respective image would be imported to VPC or the global catalog images are generally available to all the VPC?
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.
Alos since this catalogOffering is specific to os image should we rename the member to indicate that?
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.
Sure, I can rename it.
In the cases I have used, this documentation provides details on creating a Private Catalog: https://cloud.ibm.com/docs/account?topic=account-restrict-by-user&interface=ui
And details on creating a sharable VPC Custom Image: https://cloud.ibm.com/docs/vpc?topic=vpc-custom-image-cloud-private-catalog&interface=ui
// Image is the OS image which would be install on the instance. | ||
// ID will take higher precedence over Name if both specified. | ||
Image *IBMVPCResourceReference `json:"image"` | ||
|
||
// LoadBalancerPoolMembers is the set of IBM Cloud VPC Load Balancer Backend Pools the machine should be added to as a member. | ||
// +optional | ||
LoadBalancerPoolMembers []VPCLoadBalancerBackendPoolMember `json:"loadBalancerPoolMembers,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.
We used to attach the machine to all the loadbalancers defined in cluster.Loadbalancer, Do you plan to avoid that and register to only loadbalancers set here?
What will happen when this is omitted?
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.
The current code has some hardcoded values and expectations on attaching Machines to LB's.
I am trying to avoid doing that, especially since it is currently hardcoded to one LB.
I would expect that all machines CAPI creates then would be added into LB pools then, if we rely on Cluster definitions, which I do not expect is valid. Is that a fair assumption, if we rely on the Cluster resource?
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 can do this way as well, but my point is eventually the lb referred by VPCLoadBalancerBackendPoolMember.Loadbalancer is created by cluster reconciler, So why can't we directly use it.
api/v1beta2/ibmvpcmachine_types.go
Outdated
|
||
// DedicatedHost is the name of the underlying provisioned host in the VPC on which the instance will be created. | ||
// +optional | ||
DedicatedHost *VPCResource `json:"dedicatedHost,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.
For optional field for our better understanding lets mention what will happen when the field is omited.
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 update.
// LoadBalancerPoolMembers is the status of IBM Cloud VPC Load Balancer Backend Pools the machine is a member. | ||
// +optional | ||
// +k8s:conversion-gen=false | ||
LoadBalancerPoolMembers []VPCLoadBalancerBackendPoolMember `json:"loadBalancerPoolMembers,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.
Is it required here? Is it just to verify that the machine is already registered to LB?
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.
Yes, that is the intention, to track and make sure the Machine is in the required pools.
|
||
// Port defines the Port the Load Balancer Pool Member listens for traffic. | ||
// +required | ||
Port int64 `json:"port"` |
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.
Any reasons for defining Port as int64 and wieght as pointer?
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.
Yes, Port is required for LB member creation, for which we do not expect to always use 6443
.
And weight is not required, hence it is made optional.
@@ -36,10 +39,23 @@ type IBMVPCMachineSpec struct { | |||
// Name of the instance. | |||
Name string `json:"name,omitempty"` | |||
|
|||
// CatalogOffering is the Catalog Offering OS image which would be installed on the instance. | |||
// An OfferingCRN or VersionCRN is required, the PlanCRN is optional. |
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 don't see lot of information how we are consuming this in the create instance API, it will be great if you can point all the details in this PR which talks about how user will be using this field in the create flow.
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 provided what details are available (not many) in regard to using an offering in place of a Custom Image
This is what I had to piece together to create VSI's (instances) with an offering instead
#1978 (comment)
api/v1beta2/ibmvpcmachine_types.go
Outdated
|
||
// DedicatedHost is the name of the underlying provisioned host in the VPC on which the instance will be created. | ||
// +optional | ||
DedicatedHost *VPCResource `json:"dedicatedHost,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.
is this related to placement_target
field name in the create flow or something else?
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.
Yes, that is the expected field. We will need to keep parity for allowing DedicateHostIdentities
to be supported for Machines (VSI's).
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.
well, this is not limited to Host right, I see following combinations -
- dedicated host
- dedicated host group
- placement group
So instead of making this field just to host, lets make it more generic so that user can consume for any of the above options..
Correct me if I'm missing something 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.
I refactored to support the three options for placement target now.
2f0692e
to
eac62b0
Compare
/ok-to-test |
type VPCMachinePlacementTarget struct { | ||
// DedicatedHost defines the Dedicated Host to place a VPC Machine (Instance) on. | ||
// +optional | ||
DedicatedHost *VPCResource `json:"dedicatedHost,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.
I'm not sure if VPCResource is a right option here because I see following fields for the value used for this field:
// The unique identifier for this dedicated host.
ID *string `json:"id,omitempty"`
// The CRN for this dedicated host.
CRN *string `json:"crn,omitempty"`
// The URL for this dedicated host.
Href *string `json:"href,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.
The expectation is that the user would provide an ID or a name of the existing resource, and a lookup would be performed for those resources (to retrieve the ID if not supplied) and use that in the API calls, for whichever of the 3 was provided. Each of these three options has a Name or ID field, which the user could provide, simplifying the user experience.
api/v1beta2/ibmvpcmachine_types.go
Outdated
// CatalogOfferingImage is the Catalog Offering OS image which would be installed on the instance. | ||
// An OfferingCRN or VersionCRN is required, the PlanCRN is optional. | ||
// +optional | ||
CatalogOfferingImage *IBMCloudCatalogOffering `json:"catalogOfferingImage,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.
https://cloud.ibm.com/docs/account?topic=account-restrict-by-user&interface=ui looking at this it is not just to do with image, I think its better to remove the Image from the fieldname.
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.
cc @Karthik-K-N
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 have remove Image from the field.
api/v1beta2/ibmvpcmachine_types.go
Outdated
// InstanceStatus is the status of the GCP instance for this machine. | ||
// Conditions deefines current service state of the IBMVPCMachine. | ||
// +optional | ||
// +k8s:conversion-gen=false |
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.
any reason for adding +k8s:conversion-gen=false
marker?
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.
The generator could not perform conversion on this field. I added this field instead.
However, I retried the manual conversion this type and it appears it made linting and everything happy this time.
Hopefully this actually works in the CI checks.
// SecurityGroups defines a set of IBM Cloud VPC Security Groups to attach to the network interface. | ||
// +optional | ||
// +k8s:conversion-gen=false | ||
SecurityGroups []VPCResource `json:"securityGroups,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.
Adding his field throwing error in the apidiff CI job - https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-ibmcloud/1978/pull-cluster-api-provider-ibmcloud-apidiff/1842074223984513024
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.
Per comment above, I retried the manual conversion, so hopefully that resolves this failure now.
Extend the VPC Machine API's to include additional fields and types for more VPC Machine configuration support. Related: kubernetes-sigs#1977
eac62b0
to
d606bba
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.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cjschaef, mkumatag 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 |
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.
/lgtm
/hold cancel
Extend the VPC Machine API's to include additional fields and types for more VPC Machine configuration support.
Related: #1977
What this PR does / why we need it:
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: