Skip to content

Commit

Permalink
add oportunity to specify patches
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps committed Dec 17, 2023
1 parent 8593783 commit 06292c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kvapss@gmail.com>
Expand Down
13 changes: 12 additions & 1 deletion talos-bootsrtap
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 06292c7

Please sign in to comment.