@@ -297,3 +297,69 @@ type PowerModel struct {
297297 // Power = K0 + K1 * e ^(K2 * x) : where x is utilisation
298298 // Idle power of node will be K0 + K1
299299}
300+
301+ // MetadataSourceType defines where to look for metadata
302+ type MetadataSourceType string
303+
304+ const (
305+ // MetadataSourceLabel indicates metadata should be read from node labels
306+ MetadataSourceLabel MetadataSourceType = "Label"
307+ // MetadataSourceAnnotation indicates metadata should be read from node annotations
308+ MetadataSourceAnnotation MetadataSourceType = "Annotation"
309+ )
310+
311+ // MetadataValueType defines the type of metadata value
312+ type MetadataValueType string
313+
314+ const (
315+ // MetadataTypeNumber indicates the metadata value is a numeric value
316+ MetadataTypeNumber MetadataValueType = "Number"
317+ // MetadataTypeTimestamp indicates the metadata value is a timestamp
318+ MetadataTypeTimestamp MetadataValueType = "Timestamp"
319+ )
320+
321+ // MetadataScoringStrategy defines how to score nodes based on metadata values
322+ type MetadataScoringStrategy string
323+
324+ const (
325+ // ScoringStrategyHighest favors nodes with highest numeric values
326+ ScoringStrategyHighest MetadataScoringStrategy = "Highest"
327+ // ScoringStrategyLowest favors nodes with lowest numeric values
328+ ScoringStrategyLowest MetadataScoringStrategy = "Lowest"
329+ // ScoringStrategyNewest favors nodes with newest (most recent) timestamps
330+ ScoringStrategyNewest MetadataScoringStrategy = "Newest"
331+ // ScoringStrategyOldest favors nodes with oldest timestamps
332+ ScoringStrategyOldest MetadataScoringStrategy = "Oldest"
333+ )
334+
335+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
336+
337+ // NodeMetadataArgs holds arguments used to configure the NodeMetadata plugin.
338+ type NodeMetadataArgs struct {
339+ metav1.TypeMeta `json:",inline"`
340+
341+ // MetadataKey is the name of the label or annotation to use for scoring
342+ MetadataKey * string `json:"metadataKey,omitempty"`
343+
344+ // MetadataSource indicates whether to read from labels or annotations
345+ // Valid values: "Label", "Annotation"
346+ MetadataSource * MetadataSourceType `json:"metadataSource,omitempty"`
347+
348+ // MetadataType indicates the type of value in the metadata
349+ // Valid values: "Number", "Timestamp"
350+ MetadataType * MetadataValueType `json:"metadataType,omitempty"`
351+
352+ // ScoringStrategy defines how nodes should be scored
353+ // For Number type: "Highest" or "Lowest"
354+ // For Timestamp type: "Newest" or "Oldest"
355+ ScoringStrategy * MetadataScoringStrategy `json:"scoringStrategy,omitempty"`
356+
357+ // TimestampFormat is the Go time format string for parsing timestamps
358+ // Only used when MetadataType is "Timestamp"
359+ // Default: time.RFC3339 ("2006-01-02T15:04:05Z07:00")
360+ // Examples:
361+ // - RFC3339: "2006-01-02T15:04:05Z07:00"
362+ // - Unix timestamp: Use MetadataType "Number" instead
363+ // - Custom: "2006-01-02 15:04:05"
364+ TimestampFormat * string `json:"timestampFormat,omitempty"`
365+ }
0 commit comments