Skip to content

Commit

Permalink
feat(config)!: controlPlane and worker is now type of NodeConfigs
Browse files Browse the repository at this point in the history
This will allow all `NodeConfigs` fields to be applicable on node group
(`controlPlane` or `worker` depending on node type) or per node level.

The config will be "merged" with everything defined on per node level
take precedence, except for `patches` and `extraManifests` to keep the
behavior before this commit. Patches and extaManifests defined on both
node and node group level will be appended instead.

There are 2 new node options to change the behavior of `patches` and
`extraManifests` when defined at both the node and node group level.
Which are: `overridePatches` and `overrideExtraManifests`. By setting
them to `true` will make the `patches` and `extraManifests` defined in
node level to override the ones defined in node group level.

The config validation is now done after the "merging" is done for each
node. So, i.e when you define `schematic` incorrectly in `controlPlane`
struct, you might see the validation says you have incorrect
`nodes[0].schematic` instead assuming `nodes[0]` is a controlPlane node.

BREAKING CHANGE: This commit also remove all the deprecated fields which
are:
* `talosImageURL`
* all `inlinePatch`
* all `configPatches`
* `nodes[].extensions`
  • Loading branch information
budimanjojo committed Jan 21, 2024
1 parent 92ead38 commit 517640a
Show file tree
Hide file tree
Showing 16 changed files with 352 additions and 684 deletions.
39 changes: 39 additions & 0 deletions docs/docs/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,45 @@ Here's a more detailed example [talconfig.yaml](https://github.com/budimanjojo/t

To see all the available options of the configuration file, head over to [Configuration Reference](reference/configuration.md).

## DRY (Don't Repeat Yourself) in `talconfig.yaml`

A lot of times, you have similar configurations for all your nodes.
Instead of writing them multiple times for each node, you can make use of `controlPlane` and `worker` fields as "global configurations" for all your node group.

```{.yaml hl_lines="12-22"}
---
clusterName: my-cluster
nodes:
- hostname: cp1
controlPlane: true
ipAddress: 192.168.200.11
installDisk: /dev/sda
- hostname: cp2
controlPlane: true
ipAddress: 192.168.200.12
installDisk: /dev/sda
controlPlane:
schematic:
customization:
extraKernelArgs:
- net.ifnames=0
patches:
- |-
- op: add
path: /machine/kubelet/extraArgs
value:
rotate-server-certificates: "true"
```

The `schematic` and `patches` defined in `controlPlane` will be applied to both `cp1` and `cp2` because they're both in the group of `controlPlane` nodes.

!!! note

[NodeConfigs](./reference/configuration.md#nodeconfigs) you define in `controlPlane` or `worker` will be overwritten if you define them per node in `nodes[]` section.
But, for `patches` and `extraManifests` they are appended instead because it makes more sense.

You **can** modify the default behavior by adding `overridePatches: true` and `overrideExtraManifests: true` inside `nodes[]` for node you don't want the default behavior.

## Adding Talos extensions and kernel arguments

Talos v1.5 introduced a new unified way to generate boot assets for installer container image that you can build yourself using their `imager` container or use [image-factory](https://factory.talos.dev/) to dynamically build it for you.
Expand Down
Loading

0 comments on commit 517640a

Please sign in to comment.