Skip to content

Commit 9be2c6d

Browse files
committed
Remove per node-data from rule status
1 parent 6e6329d commit 9be2c6d

File tree

8 files changed

+29
-770
lines changed

8 files changed

+29
-770
lines changed

api/v1alpha1/nodereadinessrule_types.go

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -112,34 +112,6 @@ type NodeReadinessRuleStatus struct {
112112
// +kubebuilder:validation:Minimum=1
113113
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
114114

115-
// appliedNodes lists the names of Nodes where the taint has been successfully managed.
116-
// This provides a quick reference to the scope of impact for this rule.
117-
//
118-
// +optional
119-
// +listType=set
120-
// +kubebuilder:validation:MaxItems=5000
121-
// +kubebuilder:validation:items:MaxLength=253
122-
AppliedNodes []string `json:"appliedNodes,omitempty"`
123-
124-
// failedNodes lists the Nodes where the rule evaluation encountered an error.
125-
// This is used for troubleshooting configuration issues, such as invalid selectors during node lookup.
126-
//
127-
// +optional
128-
// +listType=map
129-
// +listMapKey=nodeName
130-
// +kubebuilder:validation:MaxItems=5000
131-
FailedNodes []NodeFailure `json:"failedNodes,omitempty"`
132-
133-
// nodeEvaluations provides detailed insight into the rule's assessment for individual Nodes.
134-
// This is primarily used for auditing and debugging why specific Nodes were or
135-
// were not targeted by the rule.
136-
//
137-
// +optional
138-
// +listType=map
139-
// +listMapKey=nodeName
140-
// +kubebuilder:validation:MaxItems=5000
141-
NodeEvaluations []NodeEvaluation `json:"nodeEvaluations,omitempty"`
142-
143115
// dryRunResults captures the outcome of the rule evaluation when DryRun is enabled.
144116
// This field provides visibility into the actions the controller would have taken,
145117
// allowing users to preview taint changes before they are committed.
@@ -148,93 +120,6 @@ type NodeReadinessRuleStatus struct {
148120
DryRunResults DryRunResults `json:"dryRunResults,omitempty,omitzero"`
149121
}
150122

151-
// NodeFailure provides diagnostic details for Nodes that could not be successfully evaluated by the rule.
152-
type NodeFailure struct {
153-
// nodeName is the name of the failed Node.
154-
//
155-
// Following kubebuilder validation is referred from
156-
// https://github.com/kubernetes/apimachinery/blob/84d740c9e27f3ccc94c8bc4d13f1b17f60f7080b/pkg/util/validation/validation.go#L198
157-
//
158-
// +required
159-
// +kubebuilder:validation:MinLength=1
160-
// +kubebuilder:validation:MaxLength=253
161-
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
162-
NodeName string `json:"nodeName,omitempty"`
163-
164-
// reason provides a brief explanation of the evaluation result.
165-
//
166-
// +optional
167-
// +kubebuilder:validation:MinLength=1
168-
// +kubebuilder:validation:MaxLength=256
169-
Reason string `json:"reason,omitempty"`
170-
171-
// message is a human-readable message indicating details about the evaluation.
172-
//
173-
// +optional
174-
// +kubebuilder:validation:MinLength=1
175-
// +kubebuilder:validation:MaxLength=10240
176-
Message string `json:"message,omitempty"`
177-
178-
// lastEvaluationTime is the timestamp of the last rule check failed for this Node.
179-
//
180-
// +required
181-
LastEvaluationTime metav1.Time `json:"lastEvaluationTime,omitempty,omitzero"`
182-
}
183-
184-
// NodeEvaluation provides a detailed audit of a single Node's compliance with the rule.
185-
type NodeEvaluation struct {
186-
// nodeName is the name of the evaluated Node.
187-
//
188-
// +required
189-
// +kubebuilder:validation:MinLength=1
190-
// +kubebuilder:validation:MaxLength=253
191-
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
192-
NodeName string `json:"nodeName,omitempty"`
193-
194-
// conditionResults provides a detailed breakdown of each condition evaluation
195-
// for this Node. This allows for granular auditing of which specific
196-
// criteria passed or failed during the rule assessment.
197-
//
198-
// +required
199-
// +listType=map
200-
// +listMapKey=type
201-
// +kubebuilder:validation:MaxItems=5000
202-
ConditionResults []ConditionEvaluationResult `json:"conditionResults,omitempty"`
203-
204-
// taintStatus represents the taint status on the Node, one of Present, Absent.
205-
//
206-
// +required
207-
TaintStatus TaintStatus `json:"taintStatus,omitempty"`
208-
209-
// lastEvaluationTime is the timestamp when the controller last assessed this Node.
210-
//
211-
// +required
212-
LastEvaluationTime metav1.Time `json:"lastEvaluationTime,omitempty,omitzero"`
213-
}
214-
215-
// ConditionEvaluationResult provides a detailed report of the comparison between
216-
// the Node's observed condition and the rule's requirement.
217-
type ConditionEvaluationResult struct {
218-
// type corresponds to the Node condition type being evaluated.
219-
//
220-
// +required
221-
// +kubebuilder:validation:MinLength=1
222-
// +kubebuilder:validation:MaxLength=316
223-
Type string `json:"type,omitempty"`
224-
225-
// currentStatus is the actual status value observed on the Node, one of True, False, Unknown.
226-
//
227-
// +required
228-
// +kubebuilder:validation:Enum=True;False;Unknown
229-
CurrentStatus corev1.ConditionStatus `json:"currentStatus,omitempty"`
230-
231-
// requiredStatus is the status value defined in the rule that must be matched, one of True, False, Unknown.
232-
//
233-
// +required
234-
// +kubebuilder:validation:Enum=True;False;Unknown
235-
RequiredStatus corev1.ConditionStatus `json:"requiredStatus,omitempty"`
236-
}
237-
238123
// DryRunResults provides a summary of the actions the controller would perform if DryRun mode is enabled.
239124
// +kubebuilder:validation:MinProperties=1
240125
type DryRunResults struct {

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/readiness.node.x-k8s.io_nodereadinessrules.yaml

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,6 @@ spec:
189189
description: status defines the observed state of NodeReadinessRule
190190
minProperties: 1
191191
properties:
192-
appliedNodes:
193-
description: |-
194-
appliedNodes lists the names of Nodes where the taint has been successfully managed.
195-
This provides a quick reference to the scope of impact for this rule.
196-
items:
197-
maxLength: 253
198-
type: string
199-
maxItems: 5000
200-
type: array
201-
x-kubernetes-list-type: set
202192
dryRunResults:
203193
description: |-
204194
dryRunResults captures the outcome of the rule evaluation when DryRun is enabled.
@@ -242,131 +232,6 @@ spec:
242232
required:
243233
- summary
244234
type: object
245-
failedNodes:
246-
description: |-
247-
failedNodes lists the Nodes where the rule evaluation encountered an error.
248-
This is used for troubleshooting configuration issues, such as invalid selectors during node lookup.
249-
items:
250-
description: NodeFailure provides diagnostic details for Nodes that
251-
could not be successfully evaluated by the rule.
252-
properties:
253-
lastEvaluationTime:
254-
description: lastEvaluationTime is the timestamp of the last
255-
rule check failed for this Node.
256-
format: date-time
257-
type: string
258-
message:
259-
description: message is a human-readable message indicating
260-
details about the evaluation.
261-
maxLength: 10240
262-
minLength: 1
263-
type: string
264-
nodeName:
265-
description: |-
266-
nodeName is the name of the failed Node.
267-
268-
Following kubebuilder validation is referred from
269-
https://github.com/kubernetes/apimachinery/blob/84d740c9e27f3ccc94c8bc4d13f1b17f60f7080b/pkg/util/validation/validation.go#L198
270-
maxLength: 253
271-
minLength: 1
272-
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
273-
type: string
274-
reason:
275-
description: reason provides a brief explanation of the evaluation
276-
result.
277-
maxLength: 256
278-
minLength: 1
279-
type: string
280-
required:
281-
- lastEvaluationTime
282-
- nodeName
283-
type: object
284-
maxItems: 5000
285-
type: array
286-
x-kubernetes-list-map-keys:
287-
- nodeName
288-
x-kubernetes-list-type: map
289-
nodeEvaluations:
290-
description: |-
291-
nodeEvaluations provides detailed insight into the rule's assessment for individual Nodes.
292-
This is primarily used for auditing and debugging why specific Nodes were or
293-
were not targeted by the rule.
294-
items:
295-
description: NodeEvaluation provides a detailed audit of a single
296-
Node's compliance with the rule.
297-
properties:
298-
conditionResults:
299-
description: |-
300-
conditionResults provides a detailed breakdown of each condition evaluation
301-
for this Node. This allows for granular auditing of which specific
302-
criteria passed or failed during the rule assessment.
303-
items:
304-
description: |-
305-
ConditionEvaluationResult provides a detailed report of the comparison between
306-
the Node's observed condition and the rule's requirement.
307-
properties:
308-
currentStatus:
309-
description: currentStatus is the actual status value
310-
observed on the Node, one of True, False, Unknown.
311-
enum:
312-
- "True"
313-
- "False"
314-
- Unknown
315-
type: string
316-
requiredStatus:
317-
description: requiredStatus is the status value defined
318-
in the rule that must be matched, one of True, False,
319-
Unknown.
320-
enum:
321-
- "True"
322-
- "False"
323-
- Unknown
324-
type: string
325-
type:
326-
description: type corresponds to the Node condition type
327-
being evaluated.
328-
maxLength: 316
329-
minLength: 1
330-
type: string
331-
required:
332-
- currentStatus
333-
- requiredStatus
334-
- type
335-
type: object
336-
maxItems: 5000
337-
type: array
338-
x-kubernetes-list-map-keys:
339-
- type
340-
x-kubernetes-list-type: map
341-
lastEvaluationTime:
342-
description: lastEvaluationTime is the timestamp when the controller
343-
last assessed this Node.
344-
format: date-time
345-
type: string
346-
nodeName:
347-
description: nodeName is the name of the evaluated Node.
348-
maxLength: 253
349-
minLength: 1
350-
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
351-
type: string
352-
taintStatus:
353-
description: taintStatus represents the taint status on the
354-
Node, one of Present, Absent.
355-
enum:
356-
- Present
357-
- Absent
358-
type: string
359-
required:
360-
- conditionResults
361-
- lastEvaluationTime
362-
- nodeName
363-
- taintStatus
364-
type: object
365-
maxItems: 5000
366-
type: array
367-
x-kubernetes-list-map-keys:
368-
- nodeName
369-
x-kubernetes-list-type: map
370235
observedGeneration:
371236
description: observedGeneration reflects the generation of the most
372237
recently observed NodeReadinessRule by the controller.

config/rbac/role.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ kind: ClusterRole
44
metadata:
55
name: manager-role
66
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- events
11+
verbs:
12+
- create
13+
- patch
714
- apiGroups:
815
- ""
916
resources:

0 commit comments

Comments
 (0)