-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscheduledmachine.yaml
More file actions
471 lines (464 loc) · 19.4 KB
/
Copy pathscheduledmachine.yaml
File metadata and controls
471 lines (464 loc) · 19.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
Running `target/debug/crdgen`
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: scheduledmachines.5spot.finos.org
spec:
group: 5spot.finos.org
names:
categories: []
kind: ScheduledMachine
plural: scheduledmachines
shortNames:
- sm
singular: scheduledmachine
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .status.ready
name: Ready
type: boolean
- jsonPath: .status.inSchedule
name: InSchedule
type: boolean
- jsonPath: .spec.schedule.enabled
name: Enabled
type: boolean
- jsonPath: .spec.schedule.daysOfWeek
name: Schedule Days
type: string
- jsonPath: .spec.schedule.hoursOfDay
name: Schedule Hours
type: string
- jsonPath: .spec.killSwitch
name: KillSwitch
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ScheduledMachineSpec via `CustomResource`
properties:
spec:
properties:
bootstrapSpec:
description: |-
Inline bootstrap configuration spec (e.g., `K0sWorkerConfig`)
This resource will be created when the schedule is active
properties:
apiVersion:
description: API version of the resource (e.g., 'bootstrap.cluster.x-k8s.io/v1beta1')
type: string
kind:
description: Kind of the resource (e.g., 'K0sWorkerConfig', 'RemoteMachine')
type: string
spec:
description: Provider-specific configuration
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- apiVersion
- kind
- spec
type: object
clusterName:
description: |-
Name of the CAPI cluster this machine belongs to.
Bounded to 63 characters — the RFC-1123 DNS label limit and the
effective CAPI cluster-name cap, since the value flows downstream
into the `cluster.x-k8s.io/cluster-name` label and into generated
DNS labels. The schema also restricts the charset to ASCII
alphanumerics, `-`, `.`, and `_` to block log-injection via
embedded control characters and to bound Prometheus label
cardinality.
maxLength: 63
minLength: 1
pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
type: string
gracefulShutdownTimeout:
default: 5m
description: Timeout for graceful machine shutdown (e.g., "5m", "10s")
type: string
infrastructureSpec:
description: |-
Inline infrastructure configuration spec (e.g., `RemoteMachine`)
This resource will be created when the schedule is active
properties:
apiVersion:
description: API version of the resource (e.g., 'bootstrap.cluster.x-k8s.io/v1beta1')
type: string
kind:
description: Kind of the resource (e.g., 'K0sWorkerConfig', 'RemoteMachine')
type: string
spec:
description: Provider-specific configuration
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- apiVersion
- kind
- spec
type: object
killIfCommands:
description: |-
Optional list of process patterns that trigger an emergency node
reclaim. When non-empty, the 5-Spot controller installs the
`5spot-reclaim-agent` `DaemonSet` on every Node backing this
`ScheduledMachine`; the agent watches `/proc` for any process whose
basename or argv matches one of these patterns and, on first match,
annotates the Node to request immediate (non-graceful) removal from
the cluster. When absent or empty, no agent is installed and
behaviour is time-based scheduling only.
Patterns are evaluated against both `/proc/<pid>/comm` (exact
basename) and `/proc/<pid>/cmdline` (substring). See the
`5spot-emergency-reclaim-by-process-match.md` roadmap for full
semantics.
Bounded to 100 entries × 256 characters each. The caps guard the
per-node agent's CPU (every pattern is evaluated against every
`/proc/<pid>`) and cap the size of the per-node `ConfigMap`
projection — an unbounded list is both an operator foot-gun and a
denial-of-service vector when driven from a malicious CR.
items:
maxLength: 256
minLength: 1
type: string
maxItems: 100
type: array
killSwitch:
default: false
description: When true, immediately removes the machine from cluster
type: boolean
machineTemplate:
description: |-
Optional configuration for the created CAPI Machine
If not specified, creates a Machine with default labels/annotations
nullable: true
properties:
annotations:
additionalProperties:
type: string
default: {}
description: Annotations to apply to the created Machine
type: object
labels:
additionalProperties:
type: string
default: {}
description: Labels to apply to the created Machine
type: object
type: object
nodeDrainTimeout:
default: 5m
description: Timeout for draining the node before deletion (e.g., "5m", "10m")
type: string
nodeTaints:
description: |-
User-defined taints applied to the Kubernetes Node once it is Ready.
The controller owns and reconciles only the taints it applied (tracked
in `status.appliedNodeTaints` plus the `5spot.finos.org/applied-taints`
annotation on the Node). Admin-added taints on the same Node are left
untouched. A taint is identified by the tuple `(key, effect)`; `value`
is mutable. Keys prefixed with `5spot.finos.org/`, `kubernetes.io/`,
`node.kubernetes.io/`, or `node-role.kubernetes.io/` are rejected.
items:
description: |-
A taint the controller applies to the Kubernetes Node once it is Ready.
Mirrors the shape of core/v1 `Taint`. Identity is the tuple `(key, effect)`;
`value` is mutable. See `ScheduledMachineSpec.node_taints` for ownership
semantics.
properties:
effect:
description: Taint effect — one of `NoSchedule`, `PreferNoSchedule`, `NoExecute`.
enum:
- NoSchedule
- PreferNoSchedule
- NoExecute
type: string
key:
description: |-
Taint key. Must be a qualified name (`[prefix/]name`), 1–63 chars on the
name portion and matching `[a-z0-9A-Z]([-a-zA-Z0-9.]*[a-zA-Z0-9])?`.
Reserved prefixes (`5spot.finos.org/`, `kubernetes.io/`,
`node.kubernetes.io/`, `node-role.kubernetes.io/`) are rejected.
type: string
value:
description: |-
Optional taint value (max 63 chars). Matches the same qualified-name
pattern as `key`'s name portion when set.
nullable: true
type: string
required:
- effect
- key
type: object
type: array
priority:
default: 50
description: Priority for machine scheduling (higher values = higher priority)
format: uint8
maximum: 255.0
minimum: 0.0
type: integer
schedule:
description: Machine scheduling configuration
properties:
daysOfWeek:
default: []
description: |-
Days of the week when machine should be active
Supports: individual days (mon), ranges (mon-fri), combinations (mon-wed,fri-sun)
items:
type: string
type: array
enabled:
default: true
description: Whether the schedule is enabled
type: boolean
hoursOfDay:
default: []
description: |-
Hours when machine should be active (0-23)
Supports: individual hours (9), ranges (9-17), combinations (0-9,18-23)
items:
type: string
type: array
timezone:
default: UTC
description: |-
Timezone for the schedule (e.g., "UTC", "America/New\_York")
Maximum length of 64 characters.
maxLength: 64
pattern: ^[A-Za-z][A-Za-z0-9_+\-/]*$
type: string
type: object
required:
- bootstrapSpec
- clusterName
- infrastructureSpec
- schedule
type: object
status:
nullable: true
properties:
appliedNodeTaints:
description: |-
Taints the controller has applied to the Node, in the order they were
applied. Maintained as the controller's record of truth so subsequent
reconciles only mutate taints we own — admin-added taints on the same
Node whose `(key, effect)` collides with an entry here are surfaced as
a `TaintOwnershipConflict` condition rather than overwritten.
items:
description: |-
A taint the controller applies to the Kubernetes Node once it is Ready.
Mirrors the shape of core/v1 `Taint`. Identity is the tuple `(key, effect)`;
`value` is mutable. See `ScheduledMachineSpec.node_taints` for ownership
semantics.
properties:
effect:
description: Taint effect — one of `NoSchedule`, `PreferNoSchedule`, `NoExecute`.
enum:
- NoSchedule
- PreferNoSchedule
- NoExecute
type: string
key:
description: |-
Taint key. Must be a qualified name (`[prefix/]name`), 1–63 chars on the
name portion and matching `[a-z0-9A-Z]([-a-zA-Z0-9.]*[a-zA-Z0-9])?`.
Reserved prefixes (`5spot.finos.org/`, `kubernetes.io/`,
`node.kubernetes.io/`, `node-role.kubernetes.io/`) are rejected.
type: string
value:
description: |-
Optional taint value (max 63 chars). Matches the same qualified-name
pattern as `key`'s name portion when set.
nullable: true
type: string
required:
- effect
- key
type: object
type: array
bootstrapRef:
description: Reference to the created bootstrap resource
nullable: true
properties:
apiVersion:
description: API version of the referenced object
type: string
kind:
description: Kind of the referenced object
type: string
name:
description: Name of the referenced object
type: string
namespace:
description: Namespace of the referenced object
nullable: true
type: string
required:
- apiVersion
- kind
- name
type: object
conditions:
default: []
description: Standard Kubernetes conditions
items:
properties:
lastTransitionTime:
description: Last transition time (RFC3339 format)
type: string
message:
description: Human-readable message
type: string
reason:
description: One-word reason in CamelCase
type: string
status:
description: 'Status: "True", "False", or "Unknown"'
enum:
- 'True'
- 'False'
- Unknown
type: string
type:
description: Type of condition (e.g., "Ready", "`MachineReady`", "`ReferencesValid`")
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
inSchedule:
default: false
description: Whether machine is currently in scheduled window
type: boolean
infrastructureRef:
description: Reference to the created infrastructure resource
nullable: true
properties:
apiVersion:
description: API version of the referenced object
type: string
kind:
description: Kind of the referenced object
type: string
name:
description: Name of the referenced object
type: string
namespace:
description: Namespace of the referenced object
nullable: true
type: string
required:
- apiVersion
- kind
- name
type: object
lastScheduledTime:
description: Last time a machine was created (RFC3339 format)
nullable: true
type: string
machineRef:
description: Reference to the created CAPI Machine
nullable: true
properties:
apiVersion:
description: API version of the referenced object
type: string
kind:
description: Kind of the referenced object
type: string
name:
description: Name of the referenced object
type: string
namespace:
description: Namespace of the referenced object
nullable: true
type: string
required:
- apiVersion
- kind
- name
type: object
message:
description: Human-readable status message
nullable: true
type: string
nextActivation:
description: Next scheduled activation time (RFC3339 format)
nullable: true
type: string
nextCleanup:
description: Time when machine will be cleaned up (RFC3339 format)
nullable: true
type: string
nodeRef:
description: |-
Reference to the Kubernetes Node (once provisioned), mirroring the
shape of CAPI's `Machine.status.nodeRef`.
nullable: true
properties:
apiVersion:
description: API version of the Node resource (typically `"v1"`)
type: string
kind:
description: Kind of the referenced object (typically `"Node"`)
type: string
name:
description: Name of the Node
type: string
uid:
description: UID of the Node, protecting against name reuse
nullable: true
type: string
required:
- apiVersion
- kind
- name
type: object
observedGeneration:
description: Observed generation for change detection
format: int64
nullable: true
type: integer
phase:
description: |-
Current phase of the machine lifecycle
Values: Pending, Active, `ShuttingDown`, Inactive, Disabled, Terminated, Error
nullable: true
type: string
providerID:
description: |-
Provider-assigned machine identifier, copied from the CAPI
`Machine.spec.providerID`. Stable for the life of the machine and
unique across the cluster.
nullable: true
type: string
ready:
default: false
description: |-
True only when the machine has reached the `Active` phase. Surfaced as
the `Ready` printer column for fast operator triage; any other phase
(Pending, ShuttingDown, Inactive, Disabled, Terminated, Error) is
reported as `False`.
type: boolean
type: object
required:
- spec
title: ScheduledMachine
type: object
served: true
storage: true
subresources:
status: {}