Skip to content

Commit 43ebc19

Browse files
committed
API changes to support infra creation
1 parent 7f4aef3 commit 43ebc19

6 files changed

+533
-27
lines changed

api/v1beta1/zz_generated.conversion.go

Lines changed: 54 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta2/ibmpowervscluster_types.go

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ const (
3232

3333
// IBMPowerVSClusterSpec defines the desired state of IBMPowerVSCluster.
3434
type IBMPowerVSClusterSpec struct {
35-
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
36-
// Important: Run "make" to regenerate code after modifying this file
37-
3835
// ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed.
3936
// +kubebuilder:validation:MinLength=1
37+
// Deprecated: use ServiceInstance.ID instead
4038
ServiceInstanceID string `json:"serviceInstanceID"`
4139

4240
// Network is the reference to the Network to use for this cluster.
@@ -45,13 +43,53 @@ type IBMPowerVSClusterSpec struct {
4543
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
4644
// +optional
4745
ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"`
46+
47+
// serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created.
48+
// Power VS service is a container for all Power VS instances at a specific geographic region.
49+
// serviceInstance can be created via IBM Cloud catalog or CLI.
50+
// supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli.
51+
// More detail about Power VS service instance.
52+
// https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server
53+
// when omitted system will dynamically create the service instance
54+
// +optional
55+
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance"`
56+
57+
// The Name of Power VS zone where the cluster will be created
58+
Zone string `json:"zone"`
59+
60+
// ResourceGroup name under which the resources will be created.
61+
ResourceGroup string `json:"resourceGroup"`
62+
63+
// VPC contains information about IBM Cloud VPC resources
64+
// +optional
65+
VPC VPCResource `json:"vpc"`
66+
67+
// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
68+
// +optional
69+
ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"`
4870
}
4971

5072
// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster.
5173
type IBMPowerVSClusterStatus struct {
52-
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
53-
// Important: Run "make" to regenerate code after modifying this file
74+
// Ready is true when the provider resource is ready.
5475
Ready bool `json:"ready"`
76+
77+
// serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created.
78+
ServiceInstance IBMPowerVSResourceReference `json:"serviceInstance,omitempty"`
79+
80+
// Network is the reference to the Network to use for this cluster.
81+
Network IBMPowerVSResourceReference `json:"network,omitempty"`
82+
83+
// VPC holds the status of VPC resources
84+
VPC VPCResource `json:"vpc,omitempty"`
85+
86+
// Conditions defines current service state of the IBMPowerVSCluster.
87+
// +optional
88+
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
89+
90+
// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
91+
// +optional
92+
ControlPlaneLoadBalancer *VPCLoadBalancerStatus `json:"controlPlaneLoadBalancer,omitempty"`
5593
}
5694

5795
// +kubebuilder:object:root=true
@@ -81,6 +119,27 @@ type IBMPowerVSClusterList struct {
81119
Items []IBMPowerVSCluster `json:"items"`
82120
}
83121

122+
// VPCResource holds the VPC information.
123+
type VPCResource struct {
124+
// Name of VPC
125+
// +optional
126+
Name string `json:"name"`
127+
128+
// IBM Cloud VPC zone where the cluster's loadbalancers will be created
129+
Zone string `json:"vpcZone"`
130+
131+
// Subnet contains the details about subnet
132+
Subnet Subnet `json:"subnet"`
133+
134+
// TransitGateway holds the resource details of TransitGateway
135+
TransitGateway TransitGateway `json:"transitGateway"`
136+
}
137+
138+
type TransitGateway struct {
139+
Name *string `json:"name"`
140+
ID *string `json:"id,omitempty"`
141+
}
142+
84143
func init() {
85144
SchemeBuilder.Register(&IBMPowerVSCluster{}, &IBMPowerVSClusterList{})
86145
}

api/v1beta2/ibmvpccluster_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ type VPCLoadBalancerSpec struct {
6565
Name string `json:"name,omitempty"`
6666
}
6767

68+
// VPCLoadBalancerStatus defines the status VPC load balancer.
69+
type VPCLoadBalancerStatus struct {
70+
// Name of the VPC load balancer.
71+
// +optional
72+
Name string `json:"name,omitempty"`
73+
// ID of VPC load balancer.
74+
// +optional
75+
ID string `json:"id,omitempty"`
76+
// State is the status of the load balancer.
77+
State VPCLoadBalancerState `json:"state,omitempty"`
78+
}
79+
6880
// IBMVPCClusterStatus defines the observed state of IBMVPCCluster.
6981
type IBMVPCClusterStatus struct {
7082
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 80 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)