Skip to content

Commit

Permalink
Add proposal for Power VS infra creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-K-N committed Nov 14, 2023
1 parent 7f4aef3 commit 9d5df15
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
Binary file added docs/images/powervs-cluster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/powervs-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
118 changes: 118 additions & 0 deletions docs/proposal/20231109-powervs-infra-creation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# 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
1. Creating a Power VS workspace
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.
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.
2. Allowing users to access the cluster via loadbalacer.

## Proposal

### Cluster API Power VS cluster components

![img_2.png](../images/powervs-cluster.png)

Power VS workpsace is connected to IBM Cloud VPC with the help of IBM Cloud TransitGateway.

### Proposed API changes

```shell
// IBMPowerVSClusterSpec defines the desired state of IBMPowerVSCluster.
type IBMPowerVSClusterSpec struct {
// ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed.
// +kubebuilder:validation:MinLength=1
// Deprecated: use ServiceInstance instead
ServiceInstanceID string `json:"serviceInstanceID"`

// Network is the reference to the Network to use for this cluster.
// Whenf the field is omitted, A DHCP service will be created in the service instance and its private network will be used.
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.
// serviceInstance can be created via IBM Cloud catalog or CLI.
// supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli.
// More detail about Power VS service instance.
// https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server
// when omitted system will dynamically create the service instance
// +optional
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance"`

// zone is 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 IBMVPCResourceReference `json:"vpc,omitempty"`

// transitGateway contains information about IBM Cloud TransitGateway.
// +optional
TransitGateway IBMTransitGatewayResource `json:"transitGateway,omitempty"`

// controlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
// +optional
ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"`
}

// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster.
type IBMPowerVSClusterStatus struct {
// ready is true when the provider resource is ready.
Ready bool `json:"ready"`

// serviceInstanceID is the reference to the Power VS service on which the server instance(VM) will be created.
ServiceInstanceID *string `json:"serviceInstanceID,omitempty"`

// networkID is the reference to the Power VS network to use for this cluster.
NetworkID *string `json:"networkID,omitempty"`

// dhcpServerID is the reference to the Power VS DHCP server.
DHCPServerID *string `json:"dhcpServerID,omitempty"`

// vpcID is reference to IBM Cloud VPC resources.
VPCID *string `json:"vpcID,omitempty"`

// vpcSubnetID is reference to IBM Cloud VPC subnet.
VPCSubnetID *string `json:"vpcSubnetID,omitempty"`

// transitGatewayID is reference to IBM Cloud TransitGateway.
TransitGatewayID *string `json:"transitGatewayID,omitempty"`

// ControlPlaneLoadBalancer reference to IBM Cloud VPC Loadbalancer.
ControlPlaneLoadBalancer *VPCLoadBalancerStatus `json:"controlPlaneLoadBalancer,omitempty"`

// Conditions defines current service state of the IBMPowerVSCluster.
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
}

// IBMTransitGatewayResource holds the TransitGateway information.
type IBMTransitGatewayResource struct {
Name *string `json:"name,omitempty"`
ID *string `json:"id,omitempty"`
}
```
### Following resources will be created
1. Power VS workspace
2. Power VS Network [DHCP service]
3. VPC :
4. VPC Subnet
5. Transit gateway
6. Loadbalancer

### Cluster creation workflow

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

0 comments on commit 9d5df15

Please sign in to comment.