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: VPCCluster definition extension #1683

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

Conversation

cjschaef
Copy link
Contributor

Extend the VPCCluster definition to include additional VPC resources and expand configuration options.

What this PR does / why we need it: Expands the supported resource creation/management for VPC clusters

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:

/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:

Users will want to migrate to use the new definitions and configuration to take advantage of the extended support for VPCCluster infrastructure.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 25, 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 25, 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 prajyot-parab 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 the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 25, 2024
Copy link

netlify bot commented Mar 25, 2024

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

Name Link
🔨 Latest commit 33d3af9
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/660485895c7efc000826ef94
😎 Deploy Preview https://deploy-preview-1683--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.

ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"`

// cosInstance is the IBM COS instance to use for cluster resources.
COSInstance *COSInstance `json:"cosInstance,omitempty"`
Copy link
Contributor Author

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, from types.go.

Copy link
Contributor Author

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.

Comment on lines +136 to +153
// 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"`
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove these dummy types if the other PR's adding them are merged before.
#1670
#1669

@cjschaef cjschaef marked this pull request as ready for review March 25, 2024 20:23
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2024
@Prajyot-Parab
Copy link
Contributor

/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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 26, 2024
@Prajyot-Parab
Copy link
Contributor

Prajyot-Parab commented Mar 26, 2024

/hold
let the other PRs be merged first, to avoid any confusion

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 26, 2024
@mkumatag
Copy link
Member

/cc @Karthik-K-N

// VPCResourceStatus identifies a resource by crn and type and whether it was created by the controller.
type VPCResourceStatus struct {
// controllerCreated indicates whether the resource is created by the CAPI controller.
ControllerCreated bool `json:"controllerCreated,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Since most of VPC resources can be tagged, better to make use of tags instead of ControllerCreated. tags will be very easy comapared to managing state of this variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I may need to think on this one more. I could move to rely on tags, but I know in the past we could not, or simply did not, in terms of performing resource management, perhaps a limitation with VPC resources at the time, or the technology/component used to create such resources.
Perhaps CAPI relies on tags information, if possible, and outside layers and logic transform that information as necessary. I may not know more on how to handle this until I start getting deeper into interdependencies, expectancies, etc.

Do you have a suggestion for this, or simply added a Tags []string ...? I didn't see a PowerVS equivalent, and I think the Status results will be necessary for post-Infrastructure-provisioning processing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or are you expecting that CAPI (or other components/automation) would look for specific Tags on resources (say a VSI with CAPI-created tag or something like that)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dropped the bool for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies some how I missed it. Yes what I am thinking is once the capi creates the resource in cloud say VPC, lets tag that resource with tag like CAPI-created or something, so it would help us in deciding on deleting that resource.

In PowerVS we cannot make use of tags as few services doesnot support tagging like DHCP, Network so on


// type defines the type of IBM Cloud resource.
// +required
Type ResourceType `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.

I think its usage will be like

VPC *VPCResourceStatus `json:"vpc,omitempty"
```

so do you think we need to again set VPC.Type =vpc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I think that would be the simple case, I am concerned about more complex cases.

I will drop the type for now then, and attempt to add it back in if/when I need to when I start making changes to reconcile logic changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dropped the Type for now.

Extend the VPCCluster definition to include additional
VPC resources and expand configuration options.
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants