@@ -32,26 +32,104 @@ const (
32
32
33
33
// IBMPowerVSClusterSpec defines the desired state of IBMPowerVSCluster.
34
34
type IBMPowerVSClusterSpec struct {
35
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
36
- // Important: Run "make" to regenerate code after modifying this file
37
-
38
35
// ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed.
39
- // +kubebuilder:validation:MinLength=1
36
+ // Deprecated: use ServiceInstance instead
40
37
ServiceInstanceID string `json:"serviceInstanceID"`
41
38
42
39
// Network is the reference to the Network to use for this cluster.
40
+ // when the field is omitted, A DHCP service will be created in the service instance and its private network will be used.
43
41
Network IBMPowerVSResourceReference `json:"network"`
44
42
45
43
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
46
44
// +optional
47
45
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,omitempty"`
56
+
57
+ // zone is the name of Power VS zone where the cluster will be created
58
+ // possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
59
+ // when value for serviceInstance is omitted its required to set the value for zone.
60
+ // +optional
61
+ Zone * string `json:"zone,omitempty"`
62
+
63
+ // resourceGroup name under which the resources will be created.
64
+ // when omitted Default resource group will be used.
65
+ // +optional
66
+ ResourceGroup * string `json:"resourceGroup,omitempty"`
67
+
68
+ // vpc contains information about IBM Cloud VPC resources
69
+ // +optional
70
+ VPC * VPCResourceReference `json:"vpc,omitempty"`
71
+
72
+ // vpcSubnets contains information about IBM Cloud VPC Subnet resources
73
+ // +optional
74
+ VPCSubnets []Subnet `json:"vpcSubnets,omitempty"`
75
+
76
+ // transitGateway contains information about IBM Cloud TransitGateway.
77
+ // +optional
78
+ TransitGateway * TransitGateway `json:"transitGateway,omitempty"`
79
+
80
+ // loadBalancers is optional configuration for configuring loadbalancers to control plane or data plane nodes.
81
+ // +optional
82
+ LoadBalancers []VPCLoadBalancerSpec `json:"loadBalancers,omitempty"`
83
+
84
+ // cosInstance contains options to configure a supporting IBM Cloud COS bucket for this
85
+ // cluster - currently used for nodes requiring Ignition
86
+ // (https://coreos.github.io/ignition/) for bootstrapping (requires
87
+ // BootstrapFormatIgnition feature flag to be enabled).
88
+ // +optional
89
+ CosInstance * CosInstance `json:"cosInstance,omitempty"`
90
+ }
91
+
92
+ // ResourceReference identifies a resource with id.
93
+ type ResourceReference struct {
94
+ // id represents the id of the resource.
95
+ ID * string `json:"id,omitempty"`
96
+ // +kubebuilder:default=false
97
+ // controllerCreated indicates whether the resource is created by the controller.
98
+ ControllerCreated * bool `json:"controllerCreated,omitempty"`
48
99
}
49
100
50
101
// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster.
51
102
type IBMPowerVSClusterStatus struct {
52
- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
53
- // Important: Run "make" to regenerate code after modifying this file
103
+ // ready is true when the provider resource is ready.
104
+ // +kubebuilder:default=false
54
105
Ready bool `json:"ready"`
106
+
107
+ // serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created.
108
+ ServiceInstance * ResourceReference `json:"serviceInstance,omitempty"`
109
+
110
+ // networkID is the reference to the Power VS network to use for this cluster.
111
+ Network * ResourceReference `json:"network,omitempty"`
112
+
113
+ // dhcpServer is the reference to the Power VS DHCP server.
114
+ DHCPServer * ResourceReference `json:"dhcpServer,omitempty"`
115
+
116
+ // vpc is reference to IBM Cloud VPC resources.
117
+ VPC * ResourceReference `json:"vpc,omitempty"`
118
+
119
+ // vpcSubnet is reference to IBM Cloud VPC subnet.
120
+ VPCSubnet map [string ]ResourceReference `json:"vpcSubnet,omitempty"`
121
+
122
+ // transitGateway is reference to IBM Cloud TransitGateway.
123
+ TransitGateway * ResourceReference `json:"transitGateway,omitempty"`
124
+
125
+ // cosBucket is reference to IBM Cloud COS Bucket resource.
126
+ COSBucket * ResourceReference `json:"cosBucket,omitempty"`
127
+
128
+ // loadBalancers reference to IBM Cloud VPC Loadbalancer.
129
+ LoadBalancers map [string ]VPCLoadBalancerStatus `json:"loadBalancers,omitempty"`
130
+
131
+ // Conditions defines current service state of the IBMPowerVSCluster.
132
+ Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
55
133
}
56
134
57
135
// +kubebuilder:object:root=true
@@ -81,6 +159,67 @@ type IBMPowerVSClusterList struct {
81
159
Items []IBMPowerVSCluster `json:"items"`
82
160
}
83
161
162
+ // TransitGateway holds the TransitGateway information.
163
+ type TransitGateway struct {
164
+ Name * string `json:"name,omitempty"`
165
+ ID * string `json:"id,omitempty"`
166
+ }
167
+
168
+ // VPCResourceReference is a reference to a specific VPC resource by ID or Name
169
+ // Only one of ID or Name may be specified. Specifying more than one will result in
170
+ // a validation error.
171
+ type VPCResourceReference struct {
172
+ // ID of resource
173
+ // +kubebuilder:validation:MinLength=1
174
+ // +optional
175
+ ID * string `json:"id,omitempty"`
176
+
177
+ // Name of resource
178
+ // +kubebuilder:validation:MinLength=1
179
+ // +optional
180
+ Name * string `json:"name,omitempty"`
181
+
182
+ // IBM Cloud VPC zone
183
+ Zone * string `json:"zone,omitempty"`
184
+
185
+ // IBM Cloud VPC region
186
+ Region * string `json:"region,omitempty"`
187
+ }
188
+
189
+ // CosInstance represents IBM Cloud COS instance.
190
+ type CosInstance struct {
191
+ // PresignedURLDuration defines the duration for which presigned URLs are valid.
192
+ //
193
+ // This is used to generate presigned URLs for S3 Bucket objects, which are used by
194
+ // control-plane and worker nodes to fetch bootstrap data.
195
+ //
196
+ // When enabled, the IAM instance profiles specified are not used.
197
+ // +optional
198
+ PresignedURLDuration * metav1.Duration `json:"presignedURLDuration,omitempty"`
199
+
200
+ // Name defines name of IBM cloud COS instance to be created.
201
+ // +kubebuilder:validation:MinLength:=3
202
+ // +kubebuilder:validation:MaxLength:=63
203
+ // +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$`
204
+ Name string `json:"name,omitempty"`
205
+
206
+ // bucketName is IBM cloud COS bucket name
207
+ BucketName string `json:"bucketName,omitempty"`
208
+
209
+ // bucketRegion is IBM cloud COS bucket region
210
+ BucketRegion string `json:"bucketRegion,omitempty"`
211
+ }
212
+
213
+ // GetConditions returns the observations of the operational state of the IBMPowerVSCluster resource.
214
+ func (r * IBMPowerVSCluster ) GetConditions () capiv1beta1.Conditions {
215
+ return r .Status .Conditions
216
+ }
217
+
218
+ // SetConditions sets the underlying service state of the IBMPowerVSCluster to the predescribed clusterv1.Conditions.
219
+ func (r * IBMPowerVSCluster ) SetConditions (conditions capiv1beta1.Conditions ) {
220
+ r .Status .Conditions = conditions
221
+ }
222
+
84
223
func init () {
85
224
SchemeBuilder .Register (& IBMPowerVSCluster {}, & IBMPowerVSClusterList {})
86
225
}
0 commit comments