Skip to content

Commit 86dd496

Browse files
committed
feat: support kubeadm nodeRegistration options per nodepool and control plane
1 parent 473d124 commit 86dd496

17 files changed

+628
-3
lines changed

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,20 @@ spec:
377377
default: m5.xlarge
378378
type: string
379379
type: object
380+
nodeRegistration:
381+
description: NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
382+
properties:
383+
ignorePreflightErrors:
384+
description: |-
385+
IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
386+
when the current node is registered.
387+
items:
388+
maxLength: 512
389+
minLength: 1
390+
type: string
391+
maxItems: 50
392+
type: array
393+
type: object
380394
taints:
381395
description: Taints specifies the taints the Node API object should be registered with.
382396
items:

api/v1alpha1/crds/caren.nutanix.com_awsworkernodeconfigs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@ spec:
9090
description: The AWS instance type to use for the cluster Machines.
9191
type: string
9292
type: object
93+
nodeRegistration:
94+
description: NodeRegistration holds fields that relate to registering
95+
the new control-plane node to the cluster.
96+
properties:
97+
ignorePreflightErrors:
98+
description: |-
99+
IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
100+
when the current node is registered.
101+
items:
102+
maxLength: 512
103+
minLength: 1
104+
type: string
105+
maxItems: 50
106+
type: array
107+
type: object
93108
taints:
94109
description: Taints specifies the taints the Node API object should
95110
be registered with.

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,20 @@ spec:
306306
pattern: ^((?:[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*|\[(?:[a-fA-F0-9:]+)\])(:[0-9]+)?/)?[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*(/[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*)*(:[\w][\w.-]{0,127})?(@[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][0-9A-Fa-f]{32,})?$
307307
type: string
308308
type: object
309+
nodeRegistration:
310+
description: NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
311+
properties:
312+
ignorePreflightErrors:
313+
description: |-
314+
IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
315+
when the current node is registered.
316+
items:
317+
maxLength: 512
318+
minLength: 1
319+
type: string
320+
maxItems: 50
321+
type: array
322+
type: object
309323
taints:
310324
description: Taints specifies the taints the Node API object should be registered with.
311325
items:

api/v1alpha1/crds/caren.nutanix.com_dockerworkernodeconfigs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ spec:
6565
pattern: ^((?:[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*|\[(?:[a-fA-F0-9:]+)\])(:[0-9]+)?/)?[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*(/[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*)*(:[\w][\w.-]{0,127})?(@[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][0-9A-Fa-f]{32,})?$
6666
type: string
6767
type: object
68+
nodeRegistration:
69+
description: NodeRegistration holds fields that relate to registering
70+
the new control-plane node to the cluster.
71+
properties:
72+
ignorePreflightErrors:
73+
description: |-
74+
IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
75+
when the current node is registered.
76+
items:
77+
maxLength: 512
78+
minLength: 1
79+
type: string
80+
maxItems: 50
81+
type: array
82+
type: object
6883
taints:
6984
description: Taints specifies the taints the Node API object should
7085
be registered with.

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,20 @@ spec:
299299
required:
300300
- daysBeforeExpiry
301301
type: object
302+
nodeRegistration:
303+
description: NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
304+
properties:
305+
ignorePreflightErrors:
306+
description: |-
307+
IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
308+
when the current node is registered.
309+
items:
310+
maxLength: 512
311+
minLength: 1
312+
type: string
313+
maxItems: 50
314+
type: array
315+
type: object
302316
nutanix:
303317
properties:
304318
machineDetails:

api/v1alpha1/crds/caren.nutanix.com_nutanixworkernodeconfigs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ spec:
4141
spec:
4242
description: NutanixWorkerNodeConfigSpec defines the desired state of NutanixNodeSpec.
4343
properties:
44+
nodeRegistration:
45+
description: NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
46+
properties:
47+
ignorePreflightErrors:
48+
description: |-
49+
IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
50+
when the current node is registered.
51+
items:
52+
maxLength: 512
53+
minLength: 1
54+
type: string
55+
maxItems: 50
56+
type: array
57+
type: object
4458
nutanix:
4559
properties:
4660
machineDetails:

api/v1alpha1/nodeconfig_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ type GenericNodeSpec struct {
106106
// Taints specifies the taints the Node API object should be registered with.
107107
// +kubebuilder:validation:Optional
108108
Taints []Taint `json:"taints,omitempty"`
109+
110+
// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
111+
// +kubebuilder:validation:Optional
112+
NodeRegistration *NodeRegistrationOptions `json:"nodeRegistration,omitempty"`
109113
}
110114

111115
// The node this Taint is attached to has the "effect" on
@@ -146,6 +150,18 @@ const (
146150
TaintEffectNoExecute TaintEffect = "NoExecute"
147151
)
148152

153+
// NodeRegistrationOptions holds fields that relate to registering a new control-plane or node to the cluster,
154+
// either via "kubeadm init" or "kubeadm join".
155+
type NodeRegistrationOptions struct {
156+
// IgnorePreflightErrors specifies a slice of pre-flight errors to be ignored by kubeadm
157+
// when the current node is registered.
158+
// +kubebuilder:validation:Optional
159+
// +kubebuilder:validation:MaxItems=50
160+
// +kubebuilder:validation:items:MinLength=1
161+
// +kubebuilder:validation:items:MaxLength=512
162+
IgnorePreflightErrors []string `json:"ignorePreflightErrors,omitempty"`
163+
}
164+
149165
//nolint:gochecknoinits // Idiomatic to use init functions to register APIs with scheme.
150166
func init() {
151167
SchemeBuilder.Register(

api/v1alpha1/zz_generated.deepcopy.go

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

dk-agf-demo.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
clusters:
3+
- cluster:
4+
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM2akNDQWRLZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJMU1EUXdNakl5TlRZME4xb1hEVE0xTURNek1USXpNREUwTjFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBT0lMCmxEOU9JNDBRZGdseWhnNklmZVB2NStIWWhONWE4YTRtaEV3b1g4NlVVUllETHJnUzltRS9MZWRoYVBWN1U5bzgKdHEzNXVsKzBmTk5ONCtTVnBTcVBsQXJLT1lTYW10cTRVbDJhblpnajRqTi9uVmRlRU93QkFHeW4vdzMrU1ZtaApWRWZCekhIRVhGUXppZG41THc5TkY1aHhoU1MvMERZNzJhZnlYYjlTWEZqYjBzZ3RLT0dxMVBFdE9hTUorZTNvCmFFajBFOGFJOWZ2d21pc2tGUnIraW1rS0RyVTVpRkJZcGtDcjY2OWw5cnEyM3FwUXpQK0M0K2lVTEhicnJhNzcKWE15TW9yUG8vdW1pRDZVb2huVTVFcERUK2FjdkM2ZElwYXBXVE1LdTZMYmJmSUtTVDJDMU5abVRTTXZPNTZETgo1VUZZUm5hSFMwNW9BRm56TnNNQ0F3RUFBYU5GTUVNd0RnWURWUjBQQVFIL0JBUURBZ0trTUJJR0ExVWRFd0VCCi93UUlNQVlCQWY4Q0FRQXdIUVlEVlIwT0JCWUVGT0ZnbXJvaDhRcVlSVDZReDdDRFFneFVvU2NaTUEwR0NTcUcKU0liM0RRRUJDd1VBQTRJQkFRQ0QxWTJlNFY4TUFYWkhSQ3I0SjZlRTY4TVlBVzh5OUFsVTJDSEZkTkpocEpVUApFMDdTVTRaVGt2YVNCVjgraVJ3QWlRL3BaR1pYWTdUK3FtbHMyWktTK3dGYjMvR0poNXJWM0JOVENkMkl6Szc0CmJLTUJSRTF4Q0xkN2VoQ0ZnNS9vMmU3R2JURUtjMDJncE5TOGNPN3Vua1k0TmxmQ1ZBQy9CTmRDS1VkeVpNR04KOFVDc0pxQmdBam1nRmdRdlBma1huUzQ4ZWhrN0xIREF4ZWVtZjUzK1p5UUFKNWU3N2YrTjNzRjRuc0ZEY3g2SwpBd0s3VFNLYXFYUzI4S3RaQWkzdmNUbEwzOUdsMzRRSFBiLzBxTTJtMWp0T0R6enBtZVJuL2lMRUc5VzZNZWFFCklzZ3NoUWozZFJiZHc5MUxUNSttSFFhVVBLb2MwUzF3ZG9FeFJkVDQKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
5+
server: https://10.22.203.1:6443
6+
name: dk-agf-demo
7+
contexts:
8+
- context:
9+
cluster: dk-agf-demo
10+
user: dk-agf-demo-admin
11+
name: dk-agf-demo-admin@dk-agf-demo
12+
current-context: dk-agf-demo-admin@dk-agf-demo
13+
kind: Config
14+
preferences: {}
15+
users:
16+
- name: dk-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ybUthSTh6dndLOTY0eSt6S3F1YkROSnhPYjlNV2syWkFZUzY1OXAvSnF6cU95VVNjaCt6dTNKdkhXCktHYUNpMy8rQWdVMU5uKzgwYVRjWWhFQ2dZQm16UW81ODMxL2ZCdFdWazRKM01qaXA5ZmNCTUVCRVZvajNxOWkKai9XMUhxUlB0VUVpa0ZlZmJWbXRncTkrcmVqUkozK2tjeU9oeFgwbWdMd3o4TnlpaFlNUGtVMmlrUnFKQ2gxbAptTVNJSW5HV3BMT3Vlb2s1NEhtMkNiK2tjUWI2NmVGY0hEQi9MZldhOUF2SUp1ZEw0WTQzVVJXeEVCSEY1dzlUCjZaMjBxUUtCZ1FDRHRBcWx4RG9vbHdmQUxKN0ZXMElkdHlBSnYxUzZsQlYyaFZOWjZIa1A3dXZkYUl1VlJwYmgKRHJGWFhjTmU0cEI0NWpSQ0NVTGNNTm84cGQ2Y2RGejRjOTZ5c2FlbGt1WWNhR0ROSXVrQ3YwbElPZ2VvbnBFdQpxQzh2WkwxRUhiQVM2NVNDN09Yd3dDMHUzTXJFbmFjM282d0c2TTZsNXQvd0IxS0pzLzJFM1E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
20+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
+++
2+
title = "Node registration configuration"
3+
+++
4+
5+
Below is a list of node registration configuration options that can be set for `kubeadm init` and `kubeadm join`.
6+
7+
This customization will be available when the
8+
[provider-specific cluster configuration patch]({{< ref "..">}}) is included in the `ClusterClass`.
9+
10+
## Example
11+
12+
### ignorePreflightErrors
13+
14+
#### Control plane
15+
16+
To configure `ignorePreflightErrors` for the control plane nodes, specify the following configuration:
17+
18+
```yaml
19+
apiVersion: cluster.x-k8s.io/v1beta1
20+
kind: Cluster
21+
metadata:
22+
name: <NAME>
23+
spec:
24+
topology:
25+
variables:
26+
- name: clusterConfig
27+
value:
28+
controlPlane:
29+
nodeRegistration:
30+
ignorePreflightErrors:
31+
- SystemVerification
32+
```
33+
34+
Applying this configuration will result in the following value being set:
35+
36+
- `KubeadmControlPlaneTemplate`:
37+
38+
- ```yaml
39+
spec:
40+
kubeadmConfigSpec:
41+
initConfiguration:
42+
nodeRegistration:
43+
nodeRegistration:
44+
ignorePreflightErrors:
45+
- SystemVerification
46+
joinConfiguration:
47+
nodeRegistration:
48+
ignorePreflightErrors:
49+
- SystemVerification
50+
```
51+
52+
#### Worker node
53+
54+
Taints for individual nodepools can be configured similarly:
55+
56+
```yaml
57+
apiVersion: cluster.x-k8s.io/v1beta1
58+
kind: Cluster
59+
metadata:
60+
name: <NAME>
61+
spec:
62+
topology:
63+
workers:
64+
machineDeployments:
65+
- class: default-worker
66+
name: md-0
67+
variables:
68+
overrides:
69+
- name: workerConfig
70+
value:
71+
nodeRegistration:
72+
ignorePreflightErrors:
73+
- SystemVerification
74+
```
75+
76+
Applying this configuration will result in the following value being set:
77+
78+
- `KubeadmConfigTemplate`:
79+
80+
- ```yaml
81+
spec:
82+
joinConfiguration:
83+
nodeRegistration:
84+
ignorePreflightErrors:
85+
- SystemVerification
86+
```

0 commit comments

Comments
 (0)