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