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

Add proposal for Power VS infra creation #1488

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

Karthik-K-N
Copy link
Contributor

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

  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 area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 9, 2023
Copy link

netlify bot commented Nov 9, 2023

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

Name Link
🔨 Latest commit b10cd0e
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/65c08006b6df7700084eef6a
😎 Deploy Preview https://deploy-preview-1488--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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 9, 2023
@mkumatag
Copy link
Member

mkumatag commented Nov 9, 2023

@dharaneeshvrd please go through the flow diagram been published and see how we handle the hypershift scenario in this design

@Karthik-K-N
Copy link
Contributor Author

@dharaneeshvrd please go through the flow diagram been published and see how we handle the hypershift scenario in this design

I think it should not affect the hypershift use case as I believe hypershift sets externally managed annotation which avoids ibmpowervscluster resource reconcilation. For info: #899

@dharaneeshvrd
Copy link
Contributor

The main difference I am seeing from hypershift flow is that, load balancer will not get created as part of infra creation.
IMO no need to keep load balancer creation in infra as it's not required before nodes are created.

Other than that I have few comments that we need to keep in mind:

  1. I can see PowerVS region is not in spec which means we need to rely on some map to fetch the respective region to create powervs go client, in hypershift case we are getting region from user and in doc we have given the link to the page where region, zone and vpc region mapping is explained with the expectation of user reads that and provides the proper input. Which is going to avoid any confusion in future if the mapping we are using is not up to date or has some changed info.
  2. While handling user provided resources, its better to keep it that option for developer only, one sample scenario of handling user provided resource when user passes a transit gateway and vpc where the transit gateway already connected to other vpc instance or other powervs instance then it cannot be used. So the user must understand the use of this and provide the suitable resource to this option.
  3. Also need to be mindful while cleaning up the cluster created with user provided resources that its skipped for deletion and if its attached to transit gateway then only detach it.

Will keep posting if something comes to my mind.

@Karthik-K-N
Copy link
Contributor Author

The main difference I am seeing from hypershift flow is that, load balancer will not get created as part of infra creation. IMO no need to keep load balancer creation in infra as it's not required before nodes are created.

Other than that I have few comments that we need to keep in mind:

1. I can see PowerVS region is not in spec which means we need to rely on some map to fetch the respective region to create powervs go client, in hypershift case we are getting region from user and in doc we have given the link to the page where region, zone and vpc region mapping is explained with the expectation of user reads that and provides the proper input. Which is going to avoid any confusion in future if the mapping we are using is not up to date or has some changed info.

2. While handling user provided resources, its better to keep it that option for developer only, one sample scenario of handling user provided resource when user passes a transit gateway and vpc where the transit gateway already connected  to other vpc instance or other powervs instance then it cannot be used. So the user must understand the use of this and provide the suitable resource to this option.

3. Also need to be mindful while cleaning up the cluster created with user provided resources that its skipped for deletion and if its attached to transit gateway then only detach it.

Will keep posting if something comes to my mind.

  1. I saw that region is being deprecated in options and thought it can be avoided and use only zone, Do you have any other reference where region is mandatory to use.
  2. For user providing resources we can make a clear documentation of what can be used and what are the scenarios supported.
  3. Regarding Loadbalancer creation, I think as per capi contracts its mandatory to set controlplane endpoints , if we intend to use LB we need to provision and update the fields.


### Cluster creation workflow

![img_4.png](../images/powervs-workflow.png)
Copy link
Member

Choose a reason for hiding this comment

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

Lets use tools like https://excalidraw.com which allows to save the spec file as well so that someone also can easily modify the content later

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 17, 2023
@Karthik-K-N Karthik-K-N force-pushed the infra-proposal branch 2 times, most recently from 0d638a9 to e28884d Compare December 1, 2023 04:15
@mkumatag
Copy link
Member

@Karthik-K-N lets merge this everything fixed, @Prajyot-Parab please review.

@Karthik-K-N
Copy link
Contributor Author

@Karthik-K-N lets merge this everything fixed, @Prajyot-Parab please review.

sure, let me update the final api specs


// vpcSubnet contains information about IBM Cloud VPC Subnet resources
// +optional
VPCSubnet *Subnet `json:"vpcSubnet,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Update

Suggested change
VPCSubnet *Subnet `json:"vpcSubnet,omitempty"`
VPCSubnets []Subnet `json:"vpcSubnets,omitempty"`

// (https://coreos.github.io/ignition/) for bootstrapping (requires
// BootstrapFormatIgnition feature flag to be enabled).
// +optional
CosBucket *CosBucket `json:"cosBucket,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CosBucket *CosBucket `json:"cosBucket,omitempty"`
CosInstance *CosInstance `json:"cosInstance,omitempty"`

update the comments as well

Copy link
Contributor

Choose a reason for hiding this comment

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

vpcSubnet --> this should be list as per latest changes right? @Karthik-K-N

Zone *string `json:"zone,omitempty"`
}

type CosBucket struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Update as per latest API 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 will update this by eod

Copy link
Contributor Author

@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 updated the proposal with new api spec , Please take a look

@@ -0,0 +1,202 @@
# Dynamically create infrastructure required for Power VS cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Power VS --> PowerVS (Fix everywhere)


## Motivation
Currently, inorder to create Power VS cluster using cluster api we need to create few resources in hand which includes
1. Creating a Power VS workspace
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. Creating a Power VS workspace
1. Creating a PowerVS Workspace

Along the similar line today the cluster is accessible to end user via external ip and which is loadbalanced on controlplanes using kube-vip.

## Goal
1. Dynamically creating required cloud resources as a part of cluster creation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. Dynamically creating required cloud resources as a part of cluster creation.
1. Dynamically create the required cloud resources as part of the cluster creation process.


## Goal
1. Dynamically creating required cloud resources as a part of cluster creation.
2. Allowing users to access the cluster via loadbalacer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. Allowing users to access the cluster via loadbalacer.
2. Allow users to access the cluster via loadbalancer.


// zone is the name of Power VS zone where the cluster will be created
// possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
// when omitted syd04 will be set as default zone.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// when omitted syd04 will be set as default zone.
// when omitted dal10 will be set as default zone.

(change in actual API file as well)

6. [VPC Loadbalancer](https://www.ibm.com/products/load-balancer)

### Cluster creation workflow
User is expected to set the annotation ```powervs.cluster.x-k8s.io/create-infra:true``` to IBMPowerVSCluser object make use of this feature. If unset the cluster creation goes through existing way.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
User is expected to set the annotation ```powervs.cluster.x-k8s.io/create-infra:true``` to IBMPowerVSCluser object make use of this feature. If unset the cluster creation goes through existing way.
User is expected to set the annotation ```powervs.cluster.x-k8s.io/create-infra:true``` to IBMPowerVSCluser object to make use of this feature. If not set the cluster creation will proceed with existing way.

```

### Following resources will be created
1. [Power VS workspace](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. [Power VS workspace](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server)
1. [PowerVS Workspace](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server)

2. [Power VS Network](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-configuring-subnet) [DHCP service]
3. [VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-about-vpc)
4. [VPC Subnet](https://cloud.ibm.com/docs/vpc?topic=vpc-about-networking-for-vpc)
5. [Transit gateway](https://www.ibm.com/products/transit-gateway)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
5. [Transit gateway](https://www.ibm.com/products/transit-gateway)
5. [Transit Gateway](https://www.ibm.com/products/transit-gateway)

# Dynamically create infrastructure required for Power VS cluster

## Motivation
Currently, inorder to create Power VS cluster using cluster api we need to create few resources in hand which includes
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Currently, inorder to create Power VS cluster using cluster api we need to create few resources in hand which includes
Currently, inorder to create a PowerVS cluster using cluster api we need to create few resources as prerequisites which includes -

2. Creating a Power VS Network
3. Creating a port on network

as this involves some prerequisite work which is limiting true capabilities of cluster api.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
as this involves some prerequisite work which is limiting true capabilities of cluster api.
As this involves some prerequisite work which is limiting the true capabilities of cluster api.

Copy link
Contributor Author

@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.

@Prajyot-Parab Thanks for the suggestion, I have addressed all of them and they are ready for review again.

Copy link
Contributor

@Prajyot-Parab Prajyot-Parab left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 5, 2024
Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 6, 2024
@k8s-ci-robot k8s-ci-robot merged commit 362bc4f into kubernetes-sigs:main Feb 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants