@@ -106,6 +106,10 @@ type ControlPlaneClass struct {
106
106
// +optional
107
107
MachineHealthCheck * MachineHealthCheckClass `json:"machineHealthCheck,omitempty"`
108
108
109
+ // NamingStrategy allows to change the naming pattern used when creating the control plane provider object.
110
+ // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`.
111
+ NamingStrategy * ControlPlaneClassNamingStrategy `json:"namingStrategy,omitempty"`
112
+
109
113
// NodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
110
114
// The default value is 0, meaning that the node can be drained without any time limitations.
111
115
// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
@@ -127,6 +131,15 @@ type ControlPlaneClass struct {
127
131
NodeDeletionTimeout * metav1.Duration `json:"nodeDeletionTimeout,omitempty"`
128
132
}
129
133
134
+ // ControlPlaneClassNamingStrategy defines a naming strategy for templated objects of a ControlPlaneClass.
135
+ type ControlPlaneClassNamingStrategy struct {
136
+ // Template defines the template to use for generating the name of the ControlPlane object.
137
+ // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`.
138
+ // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
139
+ // get concatenated with a random suffix of length 5.
140
+ Template * string `json:"template,omitempty"`
141
+ }
142
+
130
143
// WorkersClass is a collection of deployment classes.
131
144
type WorkersClass struct {
132
145
// MachineDeployments is a list of machine deployment classes that can be used to create
@@ -162,6 +175,10 @@ type MachineDeploymentClass struct {
162
175
// +optional
163
176
FailureDomain * string `json:"failureDomain,omitempty"`
164
177
178
+ // NamingStrategy allows to change the naming pattern used when creating the MachineDeployment.
179
+ // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machineDeployment.topologyName }}-{{ .random }}`.
180
+ NamingStrategy * MachineDeploymentClassNamingStrategy `json:"namingStrategy,omitempty"`
181
+
165
182
// NodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
166
183
// The default value is 0, meaning that the node can be drained without any time limitations.
167
184
// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
@@ -212,6 +229,15 @@ type MachineDeploymentClassTemplate struct {
212
229
Infrastructure LocalObjectTemplate `json:"infrastructure"`
213
230
}
214
231
232
+ // MachineDeploymentClassNamingStrategy defines a naming strategy for templated objects of a MachineDeploymentClass.
233
+ type MachineDeploymentClassNamingStrategy struct {
234
+ // Template defines the template to use for generating the name of the MachineDeployment object.
235
+ // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machineDeployment.topologyName }}-{{ .random }}`.
236
+ // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
237
+ // get concatenated with a random suffix of length 5.
238
+ Template * string `json:"template,omitempty"`
239
+ }
240
+
215
241
// MachineHealthCheckClass defines a MachineHealthCheck for a group of Machines.
216
242
type MachineHealthCheckClass struct {
217
243
// UnhealthyConditions contains a list of the conditions that determine
@@ -267,6 +293,10 @@ type MachinePoolClass struct {
267
293
// +optional
268
294
FailureDomains []string `json:"failureDomains,omitempty"`
269
295
296
+ // NamingStrategy allows to change the naming pattern used when creating the MachinePool.
297
+ // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machinePool.topologyName }}-{{ .random }}`.
298
+ NamingStrategy * MachinePoolClassNamingStrategy `json:"namingStrategy,omitempty"`
299
+
270
300
// NodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
271
301
// The default value is 0, meaning that the node can be drained without any time limitations.
272
302
// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
@@ -312,6 +342,15 @@ type MachinePoolClassTemplate struct {
312
342
Infrastructure LocalObjectTemplate `json:"infrastructure"`
313
343
}
314
344
345
+ // MachinePoolClassNamingStrategy defines a naming strategy for templated objects of a MachinePoolClass.
346
+ type MachinePoolClassNamingStrategy struct {
347
+ // Template defines the template to use for generating the name of the MachinePool object.
348
+ // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machinePool.topologyName }}-{{ .random }}`.
349
+ // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
350
+ // get concatenated with a random suffix of length 5.
351
+ Template * string `json:"template,omitempty"`
352
+ }
353
+
315
354
// IsZero returns true if none of the values of MachineHealthCheckClass are defined.
316
355
func (m MachineHealthCheckClass ) IsZero () bool {
317
356
return reflect .ValueOf (m ).IsZero ()
0 commit comments