diff --git a/README.md b/README.md index 9fbd137..78e5bb7 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,16 @@ sudo mv ./talos-bootstrap /usr/local/bin/talos-bootstrap - Create a directory for holding your cluster configuration. - Run `talos-bootstrap` command for every node in your cluster. +# Customizations + +You can specify your customizations in one of the following files: + +- `patch.yaml` - common settings used for all nodes. +- `patch-controlplane.yaml` - settings used for controlplane nodes only +- `patch-worker.yaml` - settings used for worker nodes only + +Read the [Configuration Patches](https://www.talos.dev/latest/talos-guides/configuration/patching/) documentation for more details. + # Copyright Andrei Kvapil diff --git a/talos-bootsrtap b/talos-bootsrtap index b2794ad..c1c2c2b 100755 --- a/talos-bootsrtap +++ b/talos-bootsrtap @@ -194,7 +194,18 @@ node="$address" if [ ! -f secrets.yaml ]; then talosctl gen secrets >/dev/null 2>&1 fi - talosctl gen config "$cluster_name" --with-secrets=secrets.yaml "$k8s_endpoint" --config-patch="$machine_config" --force >/dev/null 2>&1 + patches="" + if [ -f patch.yaml ]; then + patches="$patches --config-patch=@patch.yaml" + fi + if [ -f patch-controlplane.yaml ]; then + patches="$patches --config-patch-control-plane=@patch-controlplane.yaml" + fi + if [ -f patch-worker.yaml ]; then + patches="$patches --config-patch-worker=@patch-worker.yaml" + fi + talosctl gen config "$cluster_name" --with-secrets=secrets.yaml "$k8s_endpoint" $patches --config-patch="$machine_config" --force >/dev/null 2>&1 + printf "%s\nXXX\n%s\n%s\nXXX\n" "1" "Applying configuration..." talosctl --talosconfig=talosconfig apply -e "$bootstrap_ip" -n "$bootstrap_ip" -f controlplane.yaml -i >/dev/null 2>&1