@@ -37,9 +37,22 @@ type IBMPowerVSClusterSpec struct {
37
37
ServiceInstanceID string `json:"serviceInstanceID"`
38
38
39
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.
40
+ // when the field is omitted, A DHCP service will be created in the Power VS workspace and its private network will be used.
41
+ // the DHCP service created network will have the following name format
42
+ // 1. in the case of DHCPServer.Name is not set the name will be DHCPSERVER<CLUSTER_NAME>_Private.
43
+ // 2. if DHCPServer.Name is set the name will be DHCPSERVER<DHCPServer.Name>_Private.
44
+ // when Network.ID is set, its expected that there exist a network in PowerVS workspace with id or else system will give error.
45
+ // when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist network will be created by DHCP service.
46
+ // Network.RegEx is not yet supported and system will ignore the value.
41
47
Network IBMPowerVSResourceReference `json:"network"`
42
48
49
+ // dhcpServer is contains the configuration to be used while creating a new DHCP server in PowerVS workspace.
50
+ // when the field is omitted, CLUSTER_NAME will be used as DHCPServer.Name and DHCP server will be created.
51
+ // it will automatically create network with name DHCPSERVER<DHCPServer.Name>_Private in PowerVS workspace.
52
+ // the default name
53
+ // +optional
54
+ DHCPServer * DHCPServer `json:"dhcpServer,omitempty"`
55
+
43
56
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
44
57
// +optional
45
58
ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"`
@@ -50,46 +63,108 @@ type IBMPowerVSClusterSpec struct {
50
63
// supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli.
51
64
// More detail about Power VS service instance.
52
65
// https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server
53
- // when omitted system will dynamically create the service instance
66
+ // when omitted system will dynamically create the service instance with name CLUSTER_NAME-serviceInstance.
67
+ // when ServiceInstance.ID is set, its expected that there exist a service instance in PowerVS workspace with id or else system will give error.
68
+ // when ServiceInstance.Name is set, system will first check for service instance with Name in PowerVS workspace, if not exist system will create new instance.
69
+ // ServiceInstance.Regex is not yet supported not yet supported and system will ignore the value.
54
70
// +optional
55
71
ServiceInstance * IBMPowerVSResourceReference `json:"serviceInstance,omitempty"`
56
72
57
73
// zone is the name of Power VS zone where the cluster will be created
58
74
// possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
75
+ // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource,
76
+ // 1. it is expected to set the zone, not setting will result in webhook error.
77
+ // 2. the zone should have PER capabilities, or else system will give error.
59
78
// +optional
60
79
Zone * string `json:"zone,omitempty"`
61
80
62
81
// resourceGroup name under which the resources will be created.
63
- // when omitted default resource group of the account will be used.
82
+ // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource,
83
+ // 1. it is expected to set the ResourceGroup.Name, not setting will result in webhook error.
84
+ // ServiceInstance.ID and ServiceInstance.Regex is not yet supported and system will ignore the value.
64
85
// +optional
65
86
ResourceGroup * IBMPowerVSResourceReference `json:"resourceGroup,omitempty"`
66
87
67
88
// vpc contains information about IBM Cloud VPC resources.
89
+ // when omitted system will dynamically create the VPC with name CLUSTER_NAME-vpc.
90
+ // when VPC.ID is set, its expected that there exist a VPC with ID or else system will give error.
91
+ // when VPC.Name is set, system will first check for VPC with Name, if not exist system will create new VPC.
92
+ // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource,
93
+ // 1. it is expected to set the VPC.Region, not setting will result in webhook error.
68
94
// +optional
69
95
VPC * VPCResourceReference `json:"vpc,omitempty"`
70
96
71
97
// vpcSubnets contains information about IBM Cloud VPC Subnet resources.
98
+ // when omitted system will create the subnets in all the zone corresponding to VPC.Region, with name CLUSTER_NAME-vpcsubnet-ZONE_NAME.
99
+ // possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server.
100
+ // when VPCSubnets[].ID is set, its expected that there exist a subnet with ID or else system will give error.
101
+ // when VPCSubnets[].Zone is not set, a random zone is picked from available zones of VPC.Region.
102
+ // when VPCSubnets[].Name is not set, system will set name as CLUSTER_NAME-vpcsubnet-INDEX.
103
+ // if subnet with name VPCSubnets[].Name not found, system will create new subnet in VPCSubnets[].Zone.
72
104
// +optional
73
105
VPCSubnets []Subnet `json:"vpcSubnets,omitempty"`
74
106
75
107
// transitGateway contains information about IBM Cloud TransitGateway
76
108
// IBM Cloud TransitGateway helps in establishing network connectivity between IBM Cloud Power VS and VPC infrastructure
77
109
// more information about TransitGateway can be found here https://www.ibm.com/products/transit-gateway.
110
+ // when TransitGateway.ID is set, its expected that there exist a TransitGateway with ID or else system will give error.
111
+ // when TransitGateway.Name is set, system will first check for TransitGateway with Name, if not exist system will create new TransitGateway.
78
112
// +optional
79
113
TransitGateway * TransitGateway `json:"transitGateway,omitempty"`
80
114
81
- // loadBalancers is optional configuration for configuring loadbalancers to control plane or data plane nodes
115
+ // loadBalancers is optional configuration for configuring loadbalancers to control plane or data plane nodes.
116
+ // when omitted system will create a public loadbalancer with name CLUSTER_NAME-loadbalancer.
82
117
// when specified a vpc loadbalancer will be created and controlPlaneEndpoint will be set with associated hostname of loadbalancer.
83
- // when omitted user is expected to set controlPlaneEndpoint.
118
+ // ControlPlaneEndpoint will be set with associated hostname of public loadbalancer.
119
+ // when LoadBalancers[].ID is set, its expected that there exist a loadbalancer with ID or else system will give error.
120
+ // when LoadBalancers[].Name is set, system will first check for loadbalancer with Name, if not exist system will create new loadbalancer.
84
121
// +optional
85
122
LoadBalancers []VPCLoadBalancerSpec `json:"loadBalancers,omitempty"`
86
123
87
124
// cosInstance contains options to configure a supporting IBM Cloud COS bucket for this
88
125
// cluster - currently used for nodes requiring Ignition
89
126
// (https://coreos.github.io/ignition/) for bootstrapping (requires
90
127
// BootstrapFormatIgnition feature flag to be enabled).
128
+ // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource and Ignition is set, then
129
+ // 1. CosInstance.Name should be set not setting will result in webhook error.
130
+ // 2. CosInstance.BucketName should be set not setting will result in webhook error.
131
+ // 3. CosInstance.BucketRegion should be set not setting will result in webhook error.
91
132
// +optional
92
133
CosInstance * CosInstance `json:"cosInstance,omitempty"`
134
+
135
+ // Ignition defined options related to the bootstrapping systems where Ignition is used.
136
+ // +optional
137
+ Ignition * Ignition `json:"ignition,omitempty"`
138
+ }
139
+
140
+ // Ignition defines options related to the bootstrapping systems where Ignition is used.
141
+ type Ignition struct {
142
+ // Version defines which version of Ignition will be used to generate bootstrap data.
143
+ //
144
+ // +optional
145
+ // +kubebuilder:default="2.3"
146
+ // +kubebuilder:validation:Enum="2.3";"2.4";"3.0";"3.1";"3.2";"3.3";"3.4"
147
+ Version string `json:"version,omitempty"`
148
+ }
149
+
150
+ // DHCPServer contains the DHCP server configurations.
151
+ type DHCPServer struct {
152
+ // Optional cidr for DHCP private network
153
+ Cidr * string `json:"cidr,omitempty"`
154
+
155
+ // Optional DNS Server for DHCP service
156
+ // +kubebuilder:default="1.1.1.1"
157
+ DNSServer * string `json:"dnsServer,omitempty"`
158
+
159
+ // Optional name of DHCP Service. Only alphanumeric characters and dashes are allowed.
160
+ Name * string `json:"name,omitempty"`
161
+
162
+ // Optional id of the existing DHCPServer
163
+ ID * string `json:"id,omitempty"`
164
+
165
+ // Optional indicates if SNAT will be enabled for DHCP service
166
+ // +kubebuilder:default=true
167
+ Snat * bool `json:"snat,omitempty"`
93
168
}
94
169
95
170
// ResourceReference identifies a resource with id.
@@ -167,31 +242,38 @@ type IBMPowerVSClusterList struct {
167
242
168
243
// TransitGateway holds the TransitGateway information.
169
244
type TransitGateway struct {
245
+ // name of resource.
246
+ // +optional
170
247
Name * string `json:"name,omitempty"`
171
- ID * string `json:"id,omitempty"`
248
+ // id of resource.
249
+ // +optional
250
+ ID * string `json:"id,omitempty"`
172
251
}
173
252
174
253
// VPCResourceReference is a reference to a specific VPC resource by ID or Name
175
254
// Only one of ID or Name may be specified. Specifying more than one will result in
176
255
// a validation error.
177
256
type VPCResourceReference struct {
178
- // ID of resource
257
+ // id of resource.
179
258
// +kubebuilder:validation:MinLength=1
180
259
// +optional
181
260
ID * string `json:"id,omitempty"`
182
261
183
- // Name of resource
262
+ // name of resource.
184
263
// +kubebuilder:validation:MinLength=1
185
264
// +optional
186
265
Name * string `json:"name,omitempty"`
187
266
188
- // IBM Cloud VPC region
267
+ // region of IBM Cloud VPC.
268
+ // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource,
269
+ // it is expected to set the region, not setting will result in webhook error.
189
270
Region * string `json:"region,omitempty"`
190
271
}
191
272
192
273
// CosInstance represents IBM Cloud COS instance.
193
274
type CosInstance struct {
194
- // Name defines name of IBM cloud COS instance to be created.
275
+ // name defines name of IBM cloud COS instance to be created.
276
+ // when IBMPowerVSCluster.Ignition is set
195
277
// +kubebuilder:validation:MinLength:=3
196
278
// +kubebuilder:validation:MaxLength:=63
197
279
// +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$`
0 commit comments