Skip to content
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: Add infrastructure creation proposal #1657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cjschaef
Copy link
Contributor

Add a new proposal with details and images for creating and deleting VPC resources for the IBMVPCCluster definition.

What this PR does / why we need it:
Adds a new proposal to extend VPC Cluster support to create necessary resources based on design.

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 # N/A

Special notes for your reviewer:
We expect to break up our enhancements into the following sets:

  1. API updates - likely break down into multiple smaller PR's
  2. Implement missing/new creation/reconcile logic for new resources
  3. Implement deletion/cleanup of resources as necessary.

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added the area/provider/ibmcloud Issues or PRs related to ibmcloud provider label Mar 12, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cjschaef
Once this PR has been reviewed and has the lgtm label, please assign jichenjc for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 12, 2024
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 12, 2024
Copy link

netlify bot commented Mar 12, 2024

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
🔨 Latest commit cd20ff1
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/65f37b768c606f000818512a
😎 Deploy Preview https://deploy-preview-1657--kubernetes-sigs-cluster-api-ibmcloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


// cisInstance defines the IBM Cloud CIS instance to create DNS Records for the cluster.
// +optional
CISInstance *CISInstance `json:"cisInstance,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually DNS is handled by the openshift itself for other providers like powervs, aws etc.. any more information of the need for adding DNS will be helpful for further discussions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will remove this then, with that expectation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed references.


// dnsServicesInstance defines the IBM Cloud DNS Services instance to create DNS Records for the cluster.
// +optional
DNSServicesInstance *DNSServicesInstance `json:"dnsServicesInstance,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually DNS is handled by the openshift itself for other providers like powervs, aws etc.. any more information of the need for adding DNS will be helpful for further discussions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will remove this then, with that expectation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed references.

@mkumatag
Copy link
Member

/cc @Karthik-K-N

Copy link
Contributor

@Karthik-K-N Karthik-K-N left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added Initial review comments.

It would be great if you can add more documentation on api types, like usage and its dependency on setting of other variables, default values or system/controller set constants.

# Dynamically create infrastructure required for VPC cluster

## Motivation
Currently, inorder to create a VPC cluster using cluster api we need to create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently capi does create various resources automatically, like vpc, subnet, loadbalancer so on, May be we can rephrase the sentence or mention the resources which we need to create manually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the present CAPIBM flow for VPC creates everything on its own.

Note - can you please elaborate here which prerequisites you are referring too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can attempt to make things a bit clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, hopefully that makes things a bit easier to follow and explains what we are trying to do, expanding the current VPC support. options.


// controlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
// +optional
ControlPlaneLoadBalancer []*VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filed is already exist in current spec, so it will be a breaking change to make it slice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, missed that change before making the change to deprecated fields. Will attempt to redesign.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, added new field, restored and marked this one as deprecated.

ID string `json:id"`

// type defines the type of IBM Cloud resource.
Type VPCResourceType `json:type"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is resource type necessary here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice to have, as the ResourceReference (PowerVS was using) I was modeling after has a limited amount of data (Id only, so I was hoping to have a little more data included in such a resource.

Copy link
Contributor Author

@cjschaef cjschaef Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like my attempt to use something like this was included recently into types.go
3add9b2#diff-c82f4c3e71cee496ae15d0bb197a279d5911a9b5b86282fa3b6f4900673078e2R120-R141

To some extent anyway, I would like to expand that list to include the additional ones listed below.

CRN *string `json"crn,omitempty"`

// id defines the ID of the IBM Cloud resource.
ID string `json:id"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is both crn and id required, doen't crn contains id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRN is another nice to have, as it includes the account Id, region, etc.

I can try to determine whether including the Id at all is useful (Id was the default required field), to potentially drop it in this definition. I just don't have enough information ATM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped ID

//
// When enabled, the IAM instance profiles specified are not used.
// +optional
PresignedURLDuration *metav1.Duration `json:"presignedURLDuration,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had hard time creating a url with presignedduration, may be an experiment to verify it works and on cofirmation of it we can add this field.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we tried the TOKEN based authorisation and it works fine, may be you can consider using that to keep it simple with the IAM token instead of access key/secret key for this presignedURL stuff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 we already have pushed code using IAM token same can be adopted here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was simply suggesting moving the existing CosInstance struct out of ibmpowervscluster_types.go into a "shared" location, so VPC does not redefine the resource and so VPC is not referencing a CosInstance in PowerVS managed files.

If you wish to drop or make this field deprecated, I can do that. If you wish to have a new unique resource for COS, I can implement that in a shared location (that you can choose to migrate to, if you desire).

such as the following:
```go
// PortRange represents a range of ports, minimum to maximum.
type PortRange struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont have much idea about the security group section, may be will try to understand better before taking a look,

ResourceGroup string `json:"resourceGroup"`

// The Name of VPC.
// Deprecated: use NetworkSpec instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason for moving VPC inside NetworkSpec ?
cc @Karthik-K-N

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VPC is considered a part of the Network definition, which in VPC's case, can be defined in a unique ResourceGroup, along with the VPC's Subnets, SecurityGroups, etc. So those related resources seemed to fit better within a common type.

Using a NetworkSpec seems to follow other platform's design, rather than a 'flat' VPCCluster struct.

VPC string `json:"vpc,omitempty"`

// The Name of availability zone.
// Deprecated: use NetworkSpec instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any field indicating zone data in NetworkSpec, how is that being handled once we deprecate this.
cc @Karthik-K-N

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zones will be defined within sub-resources. VPC isn't restricted to a single zone, it can deploy (or use) Subnets, VSI's, etc. across multiple zones, of which I expect those resources to specify their Zone.

ControlPlaneLoadBalancerState *VPCLoadBalancerState `json:"controlPlaneLoadBalancerState,omitempty"`

// COSInstance is the reference to the IBM Cloud COS Instance used for the cluster.
COSInstance *VPCResourceReference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing marker details

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Add a new proposal with details and images for creating and deleting
VPC resources for the IBMVPCCluster definition.
@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 15, 2024
```


#### Share existing common resource definitions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Karthik-K-N this might break few things in PowerVS right, if we take them out of APIs.

IMO, we should focus on only VPC flow and related resources as part of this proposal. Anything related to PowerVS we can deal with later as a separate activity once we are done with VPC flow.

@mkumatag
Copy link
Member

@cjschaef as discussed in our last sync up - please start working on the controller part, we can keep this item and not blocking you to implement the controller and merge

@mkumatag
Copy link
Member

/easycla
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 18, 2024
@mkumatag mkumatag added this to the Next milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants