Include percent-based maxSize, e.g. use 50% of available space.
Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com>
(cherry picked from commit 83f2bdb9ce6c9466716a6ac9c94dc2222e569ee8)
`client.ErrEventNotSupported` was a simple sentinel with no information.
Replaced it with `client.EventNotSupportedError`, a struct implementing
error with the offending TypeURL included.
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
In certain situations, Talos's shutdown/reboot sequence hangs while
waiting for services/mounts to be gracefully stopped (see:
https://github.com/siderolabs/talos/issues/11775).
This patch adds a forceful mode to the reboot sequence (`talosctl reboot
--mode force`) that bypasses graceful userspace teardown and hard
reboots the machine.
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
Fixes#10963
Also hides/deprecated `.machine.network.interfaces`, as every piece of
it is now available as proper multi-doc.
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Update COSI, and stop using a fork of `gopkg.in/yaml.v3`, now we use new
supported for of this library.
Drop `MarshalYAMLBytes` for the machine config, as we actually marshal
config as a string, and we don't need this at all.
Make `talosctl` stop doing hacks on machine config for newer Talos, keep
hacks for backwards compatibility.
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Prevents needing to use --cluster and stays consistent with omnictl.
fixes#12127
Signed-off-by: Justin Garrison <justin.garrison@siderolabs.com>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
The command `talosctl cluster create` injects some extra cmdline though SMBIOS OEM variable `io.systemd.stub.kernel-cmdline-extra` when systemd-boot is used (e.g., when UEFI is enabled).
Introduce a new flag to optionally disable this behavior. This allows getting more consistent behavior when testing with a mixed set of UKI and non-UKI machines.
Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
Return an error when attempting to destroy a cluster that was created
with a different provisioner.
This fixes a bug where the qemu cluster state is removed without any actual
cleanup being done when running `talosctl cluster destroy` (provisioner defaults to docker).
* move the the `vm.State` logic into -> `provision.State` as it's now reused by the docker provisioner as well.
* move "cluster create" command -> "cluster create dev"
* hide the "cluster create" command from docs
* fix omni api url validation
* fix machineconfig.yaml being unnecessarily written to disk on the qemu command
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
Add new `--airgapped` flag to talos cluster create (qemu)
to disable NAT in the VMs to effectively become airgapped.
Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com>
* add 'iso', 'pxe', 'disk-image', 'maintenance' and 'secureboot' presets
* swith the image-factory e2e test to use the create qemu command with presets
* add a '--omni-api-endpoint' to simplify connecting machines to omni
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
Use cmdline from the UKI in Talos 1.12+ by default for new installs.
This brings GRUB in line with systemd-boot vs. cmdline behavior.
Fixes#12019
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Most of the work is to add proper test environment for more cases.
Include a test for pulling an image
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Add new command that takes Talos version (semver) and generates a list
of images that are used in Image Factory for building talos.
Fixes#11927
Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com>
* Create the following packages under `/create`:
- `flags` containing the pflag.Value implementations
- `clusterops` containing the options for cluster creation
- `configmaker` containing the logic that aids in creation of talos and provision configuration for cluster creation
- internal `makers` and `siderolinkbuilder` packages that hide the internal logic that configmaker uses
* Remove code duplication of default values. Now all default values come from the clusterops Get functions.
* Add unit tests for flag implementations.
* Add tests that compare machine configs generated for cluster create to default configs.
These tests also functions as snapshot tests and will asure no undesired changes pass through in the future unnoticed.
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
* The flag unnecessarily complicated the logic of the dev create command
* The flag is no longer needed as machines can just me started in maintenance
mode and the config can be applied manually
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
See 4b840414be for more information.
Talos versions prior to 1.12 locked to PCR 7 state and PCR 11 for signed policies.
In-order for backwards compatibility newer installs will still default to PCR 7 state. Locking to PCR 7 can be disabled by passing an empty list.
Fixes: #10677
Signed-off-by: Noel Georgi <git@frezbo.dev>
* Split common code between `create docker` and `create qemu` commands into a helper
* Remove default value code duplication
* Enable kubeprism and cluster discovery to create qemu command
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
Add flags for memory and disk sizes where people can specify the capacity
freely in gb, mb tb etc. This change is backwards compatible and the values
without units used previously still work.
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
This command is the user-friendly qemu based cluster create command.
It has a new disks flag and uses the image factory for boot assets.
Also, unpersist the provisioner flag.
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
Make --with-uuid-hostnames flag functionality available to qemu provider on `talosctl cluster create`
Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
Fix issue introduced in #11532 (`main` only) with versionContract
parsing: wrong variable was returned (overwritten).
Also some small cleanups/nits (with Albert).
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Use key provider with fallback option for auth type SideroV1:
- Attempt to use $HOME/.talos/keys directory to read/remove existing PGP file if it exists or write new PGP file if directory is writable.
- Otherwise fallback to using $XDG_DATA_HOME/talos/keys directory.
- Add new talosctl flag --siderov1-key-dir (also configurable via SIDEROV1_KEYS_DIR env var) to allow customizing the directory to use for PGP keys
Update documentation to remove reference for $XDG_CONFIG_HOME for storing talosctl configuration, as it's not used anymore.
Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
Add a user facing cluster create docker command with the following changes:
* renamed flags for simplicity and uniformity
* removed the bulk of the unnecessary flags
Other changes:
* split internal logic such that it's separate from the qemu cluster create logic
* refactor internal code aiming for simplicity
Ä change drives flag behavior in anticipation of the user facing create-qemu command
* extract code into separate functions
* add some unit tests
* remove the docker support from the cluster create command (docker is only supported via the user-facing create-docker command)
Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
Move stuff into `tools/go.mod`.
Also fix linting issues on the way (updating golangci-lint).
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Deprecate/hide old v1alpha1 disk encryption config, and move to
unified approach via `VolumeConfig` resource.
Allow only encryption configuration for `STATE` (for now).
Fixes#10749
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>