|
| 1 | +# Dynamically create infrastructure required for Power VS cluster |
| 2 | + |
| 3 | +## Motivation |
| 4 | +Currently, inorder to create Power VS cluster using cluster api we need to create few resources in hand which includes |
| 5 | +1. Creating a Power VS workspace |
| 6 | +2. Creating a Power VS Network |
| 7 | +3. Creating a port on network |
| 8 | + |
| 9 | +as this involves some prerequisite work which is limiting true capabilities of cluster api. |
| 10 | +Along the similar line today the cluster is accessible to end user via external ip and which is loadbalanced on controlplanes using kube-vip. |
| 11 | + |
| 12 | +## Goal |
| 13 | +1. Dynamically creating required cloud resources as a part of cluster creation. |
| 14 | +2. Allowing users to access the cluster via loadbalacer. |
| 15 | + |
| 16 | +## Proposal |
| 17 | + |
| 18 | +### Cluster API Power VS cluster components |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +Power VS workpsace is connected to IBM Cloud VPC with the help of IBM Cloud TransitGateway. |
| 23 | + |
| 24 | +### Proposed API changes |
| 25 | + |
| 26 | +```shell |
| 27 | +// IBMPowerVSClusterSpec defines the desired state of IBMPowerVSCluster. |
| 28 | +type IBMPowerVSClusterSpec struct { |
| 29 | + // ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed. |
| 30 | + // +kubebuilder:validation:MinLength=1 |
| 31 | + // Deprecated: use ServiceInstance instead |
| 32 | + ServiceInstanceID string `json:"serviceInstanceID"` |
| 33 | + |
| 34 | + // Network is the reference to the Network to use for this cluster. |
| 35 | + Network IBMPowerVSResourceReference `json:"network"` |
| 36 | + |
| 37 | + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. |
| 38 | + // +optional |
| 39 | + ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` |
| 40 | + |
| 41 | + // serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. |
| 42 | + // Power VS service is a container for all Power VS instances at a specific geographic region. |
| 43 | + // serviceInstance can be created via IBM Cloud catalog or CLI. |
| 44 | + // supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli. |
| 45 | + // More detail about Power VS service instance. |
| 46 | + // https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server |
| 47 | + // when omitted system will dynamically create the service instance |
| 48 | + // +optional |
| 49 | + ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance"` |
| 50 | + |
| 51 | + // zone is the name of Power VS zone where the cluster will be created |
| 52 | + Zone string `json:"zone"` |
| 53 | + |
| 54 | + // resourceGroup name under which the resources will be created. |
| 55 | + ResourceGroup string `json:"resourceGroup"` |
| 56 | + |
| 57 | + // vpc contains information about IBM Cloud VPC resources |
| 58 | + // +optional |
| 59 | + VPC VPCResource `json:"vpc"` |
| 60 | + |
| 61 | + // transitGateway contains information about IBM Cloud TransitGateway. |
| 62 | + // +optional |
| 63 | + TransitGateway TransitGateway `json:"transitGateway"` |
| 64 | + |
| 65 | + // controlPlaneLoadBalancer is optional configuration for customizing control plane behavior. |
| 66 | + // +optional |
| 67 | + ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` |
| 68 | +} |
| 69 | + |
| 70 | + |
| 71 | +// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster. |
| 72 | +type IBMPowerVSClusterStatus struct { |
| 73 | + // ready is true when the provider resource is ready. |
| 74 | + Ready bool `json:"ready"` |
| 75 | + |
| 76 | + // serviceInstanceID is the reference to the Power VS service on which the server instance(VM) will be created. |
| 77 | + ServiceInstanceID *string `json:"serviceInstanceID,omitempty"` |
| 78 | + |
| 79 | + // networkID is the reference to the Power VS network to use for this cluster. |
| 80 | + NetworkID *string `json:"networkID,omitempty"` |
| 81 | + |
| 82 | + // vpcID is reference to IBM Cloud VPC resources. |
| 83 | + VpcID *string `json:"vpcID,omitempty"` |
| 84 | + |
| 85 | + // vpcSubnetID is reference to IBM Cloud VPC subnet. |
| 86 | + VPCSubnetID *string `json:"vpcSubnetID,omitempty"` |
| 87 | + |
| 88 | + // transitGatewayID is reference to IBM Cloud TransitGateway. |
| 89 | + TransitGatewayID *string `json:"transitGatewayID,omitempty"` |
| 90 | + |
| 91 | + // ControlPlaneLoadBalancer reference to IBM Cloud VPC Loadbalancer. |
| 92 | + ControlPlaneLoadBalancer *VPCLoadBalancerStatus `json:"controlPlaneLoadBalancer,omitempty"` |
| 93 | + |
| 94 | + // Conditions defines current service state of the IBMPowerVSCluster. |
| 95 | + Conditions capiv1beta1.Conditions `json:"conditions,omitempty"` |
| 96 | +} |
| 97 | + |
| 98 | + |
| 99 | +// VPCResource holds the VPC information. |
| 100 | +type VPCResource struct { |
| 101 | + // Name of VPC |
| 102 | + // +optional |
| 103 | + Name string `json:"name"` |
| 104 | + |
| 105 | + // IBM Cloud VPC zone where the cluster's loadbalancers will be created |
| 106 | + Zone string `json:"vpcZone"` |
| 107 | +
|
| 108 | + // Subnet contains the details about subnet |
| 109 | + Subnet Subnet `json:"subnet"` |
| 110 | +} |
| 111 | +
|
| 112 | +type TransitGateway struct { |
| 113 | + Name *string `json:"name,omitempty"` |
| 114 | + ID *string `json:"id,omitempty"` |
| 115 | +} |
| 116 | +``` |
| 117 | +### Following resources will be created |
| 118 | +1. Power VS workspace |
| 119 | +2. Power VS Network [DHCP service] |
| 120 | +3. VPC : |
| 121 | +4. VPC Subnet |
| 122 | +5. Transit gateway |
| 123 | +6. Loadbalancer |
| 124 | +
|
| 125 | +### Cluster creation workflow |
| 126 | +
|
| 127 | + |
| 128 | +
|
0 commit comments