Server classes are a way to group distinct server resources.
selector keys allow the administrator to specify criteria upon which to group these servers.
If both of these keys are missing, the server class matches all servers that it is watching.
If both of these keys define requirements, these requirements are combined (logical
selector groups server resources by their labels.
The Kubernetes documentation has more information on how to use this field.
There are currently two keys:
Each of these keys accepts a list of entries.
The top level keys are a “logical
AND”, while the lists under each key are a “logical
Qualifiers that are not specified are not evaluated.
apiVersion: metal.sidero.dev/v1alpha1 kind: ServerClass metadata: name: serverclass-sample spec: selector: matchLabels: common-label: "true" matchExpressions: - key: zone operator: In values: - central - east - key: environment operator: NotIn values: - prod qualifiers: cpu: - manufacturer: "Intel(R) Corporation" version: "Intel(R) Atom(TM) CPU C3558 @ 2.20GHz" - manufacturer: Advanced Micro Devices, Inc. version: AMD Ryzen 7 2700X Eight-Core Processor systemInformation: - manufacturer: Dell Inc.
Servers would only be added to the above class if they:
- had EITHER CPU info
- AND the label key/value in
- AND match the
Additionally, Sidero automatically creates and maintains a server class called
"any" that includes all (accepted) servers.
Attempts to add qualifiers to it will be reverted.
Server configs of servers matching a server class can be updated by using the
configPatches section of the custom resource.
See patching for more information on how this works.
An example of settings the default install disk for all servers matching a server class:
apiVersion: metal.sidero.dev/v1alpha1 kind: ServerClass ... spec: configPatches: - op: replace path: /machine/install/disk value: /dev/sda
Servers from a
ServerClass can be set to use the specific
Environment by linking the
Environment from the
apiVersion: metal.sidero.dev/v1alpha1 kind: ServerClass ... spec: environmentRef: name: production-env
The method to exit iPXE network boot to force boot from disk can be configured for all
Server resources belonging to the
apiVersion: metal.sidero.dev/v1alpha1 kind: ServerClass ... spec: bootFromDiskMethod: ipxe-sanboot
Valid values are:
If not set, the default boot from disk method is used (