siderolabs / sidero

Sidero Metal is a bare metal provisioning system with support for Kubernetes Cluster API.
https://www.sidero.dev
Mozilla Public License 2.0
404 stars 62 forks source link

`BootArguments` resource #836

Open smira opened 2 years ago

smira commented 2 years ago

BootArguments describes boot environment based on MAC address and architectures.

BootArguments

metadata:
  name: dell-console
spec:
   kernelArguments:
      - console=ttyS1

BootArgumentsQualifiers

spec:
   bootstrapArgumentRefs:
      - name: dell-console
   qualifiers: # OR on top level, AND on qualifiers
       - arch: amd64
         hardwareAddress: 03:04:0x:*
         subnet: 192.168.0.0/24
         hostname: foo*
         domain: *.bar.baz
   weight: 340 # optional, if needed to resolve conflicts

These should be applied to the agent environment as well.

On PXE booting a node, Sidero finds all BootArguments which matches the node, sorts them by (weight, name) and merges them all together. The base arguments are coming from the default agent boot args (if it's an agent boot) or from the Environment (if booting Server).

smira commented 2 years ago

Kernel arguments should be overridable on the Server and ServerClass levels.

ex:

kind: Server # ServerClass
spec:
   bootArgumentsRefs: # if specified, `BootArguments` are not looked up at all, and this is the explicit list
      - name: myfunnyconsole

List of bootArgumentsRefs is combined from ServerClass, then Server, if not empty, BootArguments are not looked up.

smira commented 2 years ago

See #837 on preserving boot arguments on Talos boot from disk.

smira commented 2 years ago

Having default arguments and qualifiers for the most common cases: