|
| 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 | + // when the field is omitted, A DHCP service will be created in the service instance and its private network will be used. |
| 36 | + Network IBMPowerVSResourceReference `json:"network"` |
| 37 | + |
| 38 | + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. |
| 39 | + // +optional |
| 40 | + ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` |
| 41 | + |
| 42 | + // serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. |
| 43 | + // Power VS service is a container for all Power VS instances at a specific geographic region. |
| 44 | + // serviceInstance can be created via IBM Cloud catalog or CLI. |
| 45 | + // supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli. |
| 46 | + // More detail about Power VS service instance. |
| 47 | + // https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server |
| 48 | + // when omitted system will dynamically create the service instance |
| 49 | + // +optional |
| 50 | + ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance,omitempty"` |
| 51 | + |
| 52 | + // zone is the name of Power VS zone where the cluster will be created |
| 53 | + // possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server. |
| 54 | + // when value for serviceInstance is omitted its required to set the value for zone. |
| 55 | + // +optional |
| 56 | + Zone string `json:"zone,omitempty"` |
| 57 | + |
| 58 | + // resourceGroup name under which the resources will be created. |
| 59 | + // when omitted Default resource group will be used. |
| 60 | + // +optional |
| 61 | + ResourceGroup string `json:"resourceGroup,omitempty"` |
| 62 | + |
| 63 | + // vpc contains information about IBM Cloud VPC resources |
| 64 | + // +optional |
| 65 | + VPC VPCResourceReference `json:"vpc,omitempty"` |
| 66 | + |
| 67 | + // transitGateway contains information about IBM Cloud TransitGateway. |
| 68 | + // +optional |
| 69 | + TransitGateway TransitGateway `json:"transitGateway,omitempty"` |
| 70 | + |
| 71 | + // controlPlaneLoadBalancer is optional configuration for customizing control plane behavior. |
| 72 | + // Its name reference to IBM Cloud VPC LoadBalancer service. |
| 73 | + // +optional |
| 74 | + ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` |
| 75 | +} |
| 76 | + |
| 77 | +// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster. |
| 78 | +type IBMPowerVSClusterStatus struct { |
| 79 | + // ready is true when the provider resource is ready. |
| 80 | + Ready bool `json:"ready"` |
| 81 | + |
| 82 | + // serviceInstanceID is the reference to the Power VS service on which the server instance(VM) will be created. |
| 83 | + ServiceInstanceID *string `json:"serviceInstanceID,omitempty"` |
| 84 | + |
| 85 | + // networkID is the reference to the Power VS network to use for this cluster. |
| 86 | + NetworkID *string `json:"networkID,omitempty"` |
| 87 | + |
| 88 | + // dhcpServerID is the reference to the Power VS DHCP server. |
| 89 | + DHCPServerID *string `json:"dhcpServerID,omitempty"` |
| 90 | + |
| 91 | + // vpcID is reference to IBM Cloud VPC resources. |
| 92 | + VPCID *string `json:"vpcID,omitempty"` |
| 93 | + |
| 94 | + // vpcSubnetID is reference to IBM Cloud VPC subnet. |
| 95 | + VPCSubnetID *string `json:"vpcSubnetID,omitempty"` |
| 96 | + |
| 97 | + // transitGatewayID is reference to IBM Cloud TransitGateway. |
| 98 | + TransitGatewayID *string `json:"transitGatewayID,omitempty"` |
| 99 | + |
| 100 | + // ControlPlaneLoadBalancer reference to IBM Cloud VPC Loadbalancer. |
| 101 | + ControlPlaneLoadBalancer *VPCLoadBalancerStatus `json:"controlPlaneLoadBalancer,omitempty"` |
| 102 | + |
| 103 | + // Conditions defines current service state of the IBMPowerVSCluster. |
| 104 | + Conditions capiv1beta1.Conditions `json:"conditions,omitempty"` |
| 105 | +} |
| 106 | + |
| 107 | +// TransitGateway holds the TransitGateway information. |
| 108 | +type TransitGateway struct { |
| 109 | + Name *string `json:"name,omitempty"` |
| 110 | + ID *string `json:"id,omitempty"` |
| 111 | +} |
| 112 | + |
| 113 | +// VPCResourceReference is a reference to a specific VPC resource by ID or Name |
| 114 | +// Only one of ID or Name may be specified. Specifying more than one will result in |
| 115 | +// a validation error. |
| 116 | +type VPCResourceReference struct { |
| 117 | + // ID of resource |
| 118 | + // +kubebuilder:validation:MinLength=1 |
| 119 | + // +optional |
| 120 | + ID *string `json:"id,omitempty"` |
| 121 | + |
| 122 | + // Name of resource |
| 123 | + // +kubebuilder:validation:MinLength=1 |
| 124 | + // +optional |
| 125 | + Name *string `json:"name,omitempty"` |
| 126 | + |
| 127 | + // IBM Cloud VPC zone |
| 128 | + Zone *string `json:"zone,omitempty"` |
| 129 | +} |
| 130 | +``` |
| 131 | +### Following resources will be created |
| 132 | +1. Power VS workspace |
| 133 | +2. Power VS Network [DHCP service] |
| 134 | +3. VPC |
| 135 | +4. VPC Subnet |
| 136 | +5. Transit gateway |
| 137 | +6. VPC Loadbalancer |
| 138 | + |
| 139 | +### Cluster creation workflow |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | +### Cluster Deletion workflow |
| 144 | + |
0 commit comments