talosctl gen config but not all of them.
Configuration patching allows modifying machine configuration to fit it for the cluster or a specific machine.
Configuration patching can be used also to mutate existing machine configuration on running Talos nodes.
See reproducible machine configuration for more details.
Configuration Patches
Talos Linux supports patching machine configuration using strategic merge patches. Strategic merge patches look like incomplete machine configuration files:--- separator).
When applied to the machine configuration, the patch gets merged with the respective section of the machine configuration.
In general, machine configuration contents are merged with the contents of the strategic merge patch, with strategic merge patch
values overriding machine configuration values.
There are some special rules:
- If the field value is a list, the patch value is appended to the list, with the following exceptions:
- values of the fields
cluster.network.podSubnetsandcluster.network.serviceSubnetsare overwritten on merge network.interfacessection is merged with the value in the machine config if there is a match oninterface:ordeviceSelector:keysnetwork.interfaces.vlanssection is merged with the value in the machine config if there is a match on thevlanId:keycluster.apiServer.auditPolicyvalue is replaced on mergeExtensionServiceConfig.configFilessection is merged matching onmountPath(replacingcontentif matches)
- values of the fields
- for each document in the patch, the document is merged with the respective document in the machine configuration (matching by
kind,apiVersionandnamefor named documents) - if the patch document doesn’t exist in the machine configuration, it is appended to the machine configuration
$patch: delete syntax similar to the
Kubernetes
strategic merge patch.
For example, with configuration:
v1alpha1 configuration!) using this syntax:
SideroLinkConfig and ExtensionServiceConfig with name foo from the configuration.
Examples
Machine Network
Base machine configuration:192.168.10.50 to the eth0 interface and add another interface eth1 with DHCP enabled.
Cluster Network
Base machine configuration:Kubelet
Base machine configuration:kubelet node IP to come from the subnet 192.168.10.0/24:
Admission Control: Pod Security Policy
Base machine configuration:rook-ceph.
Patch:
Configuration Patching with talosctl CLI
Several talosctl commands accept config patches as command-line flags.
Config patches might be passed either as an inline value or as a reference to a file with @file.patch or file.patch syntax:
talosctl gen config:
talosctl machineconfig patch
talosctl patch: