Commit Graph

25 Commits

Author SHA1 Message Date
Andrey Smirnov
cb7ca17bba
feat: implement ExistingVolumeConfig
Fixes #11153

The idea is to allow to mount existing partitions on a Talos machine so
that they are available for workloads.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-07-22 14:32:31 +04:00
Andrey Smirnov
da5a4449f1
feat: implement raw volume support
Fixes #10931

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-07-14 13:46:50 +04:00
Andrey Smirnov
6415055847
feat: support project quota support for user volumes
Just exposting existing value via the config.

Fixes #11090

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-07-09 19:35:10 +04:00
Andrey Smirnov
c880835c80
feat: implement zswap support
Zswap allows to compress pages in memory before they hit the actual swap
device.

Both swap and zswap (or either one of these) can be enabled.

Fixes #10675

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-06-30 20:17:27 +04:00
Andrey Smirnov
d32ccfa598
feat: implement swap support
Fixes #10674

Provide a way to see current swap status, configure additional swap
devices (block) and de-configure them on the fly.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-06-11 14:25:38 +04:00
Andrey Smirnov
664fa36973
feat: implement user volumes
User volumes are identified by a short name which serves both
as a `/var/mnt` mount point and a partition label.

User volumes can be added and removed on the fly, and they are
automatically propagated into the `kubelet` mount namespace.

Also deprecate `.machine.disks`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-04-11 20:27:39 +04:00
Dmitrii Sharshakov
087a85f409
feat: support running with SELinux enforcing
Add more rules alongside supporting code.

Signed-off-by: Dmitrii Sharshakov <dmitry.sharshakov@siderolabs.com>
2025-03-22 14:39:48 +01:00
Andrey Smirnov
75673b6a38
feat: provide stable symlinks in disk resources
This allows to grab various `/dev/disk` symlinks,
including in maintenance mode when `talosctl ls` is not allowed.

Samle output:

```yaml
node: 172.20.0.5
metadata:
    namespace: runtime
    type: Disks.block.talos.dev
    id: nvme0n2
    version: 2
    owner: block.DisksController
    phase: running
    created: 2025-01-23T12:57:08Z
    updated: 2025-01-23T12:57:09Z
spec:
    dev_path: /dev/nvme0n2
    size: 5368709120
    pretty_size: 5.4 GB
    io_size: 512
    sector_size: 512
    readonly: false
    cdrom: false
    model: QEMU NVMe Ctrl
    serial: deadbeef
    wwid: nvme.1b36-6465616462656566-51454d55204e564d65204374726c-00000002
    bus_path: /pci0000:00/0000:00:08.0/nvme
    sub_system: /sys/class/block
    transport: nvme
    symlinks:
        - /dev/disk/by-diskseq/11
        - /dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_deadbeef_2
        - /dev/disk/by-id/nvme-nvme.1b36-6465616462656566-51454d55204e564d65204374726c-00000002
        - /dev/disk/by-path/pci-0000:00:08.0-nvme-2
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-01-24 18:46:56 +04:00
Noel Georgi
01c86832cb
chore(ci): add test for OpenEBS MayaStor
Add a test in CI for OpenEBS MayaStor.

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-01-16 09:47:17 +05:30
Andrey Smirnov
9470e842fc
test: cleanup failed Kubernetes pods
See #9870

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-12-16 16:48:30 +04:00
Andrey Smirnov
43fe3807a8
feat: implement tracking of blockdevice secondaries
This is going to be used to detect disks that are safe to wipe.

For blockdevices, track secondaries as direct references, e.g. encrypted
`STATE` partition might have secondary `vda5`.

For disks, re-map secondaries to be whole devices names, e.g. `vda`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-13 22:43:27 +04:00
Andrey Smirnov
e0434d77d7
feat: update dependencies
Bring in new tools, pkgs, update Go dependencies and others.

In preparation for Talos 1.9.0-alpha.0.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-10-17 22:12:50 +04:00
Andrey Smirnov
182325cb07
test: skip lvm test if not enough user disks available
E.g. in trusted-boot pipeline, we don't have extra disks.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-10-08 20:42:24 +04:00
Andrey Smirnov
0a2b4556c5
fix: volume encryption with failing keyslots
Fix the flow when a failing key slot leads to repeated attempts to open
the volume, while it's already open, but the failure was to sync other
keys.

Refactor the code to get rid of variable assignment in the outer block
from closures.

Fixes #9415

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-10-07 21:59:42 +04:00
Andrey Smirnov
74861573a7
fix: multiple fixes for LVM activation
Two fixes were in pkgs/lvm2:

* https://github.com/siderolabs/pkgs/pull/1041
* https://github.com/siderolabs/pkgs/pull/1042

Other fixes in this PR:

* adjust the controller a bit for some interactions
* make Rook test use more complicated, encrypted setup which uses LVM
* adjust LVM test to handle a case when there's more than one worker

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-10-03 11:33:22 +04:00
Noel Georgi
dec653bfe1
chore: better lvm2 tests
Use LVM2 tests that relies on module loading by lvm.

Fixes: #9300

Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-10-01 16:08:44 +04:00
Noel Georgi
9fa08e8437
chore: refactor tests
Refactor tests to avoid code duplication.

Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-09-20 16:22:01 +05:30
Noel Georgi
d8ab4981b6
feat: support lvm auto activation
Support lvm auto-activation as per
https://man7.org/linux/man-pages/man7/lvmautoactivation.7.html.

This changes from how Talos previously used to unconditionally tried to
activate all volume groups to based on udev events.

Fixes: #9300

Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-09-20 14:42:56 +05:30
Andrey Smirnov
3038ccfa88
feat: add configuration for EPHEMERAL volume
Fixes #9261

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-09-06 14:11:35 +04:00
Andrey Smirnov
d1a0c1f983
test: fix the integration test for no META name
When META has never been written (e.g. booted from a disk image), it
won't be detected as `talosmeta`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-06-11 15:17:52 +04:00
Andrey Smirnov
7cbdce73f7
fix: detect CD devices, fix user disks wipe test
Detect CD devices, and set size to 0 for CD without media.

In user disk wipe tests, skip device mapper devices and CD-ROM.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-06-10 18:00:06 +04:00
Andrey Smirnov
f07b79f4a8
feat: provide disk detection based on new blockdevices
Uses go-siderolabs/go-blockdevice/v2 for all the hard parts,
provides new resource `Disk` which describes all disks in the system.

Additional resource `SystemDisk` always point to the system disk (based
on the location of `META` partition).

The `Disks` API (and `talosctl disks`) provides a view now into the
`talosctl get disks` to keep backwards compatibility.

QEMU provisioner can now create extra disks of various types: IDE, AHCI,
SCSI, NVME, this allows to test detection properly.

The new resource will be the foundation for volume provisioning (to pick
up the disk to provision the volume on).

Example:

```
talosctl -n 172.20.0.5 get disks
NODE         NAMESPACE   TYPE   ID        VERSION   SIZE          READ ONLY   TRANSPORT   ROTATIONAL   WWID                                                               MODEL            SERIAL
172.20.0.5   runtime     Disk   loop0     1         65568768      true
172.20.0.5   runtime     Disk   nvme0n1   1         10485760000   false       nvme                     nvme.1b36-6465616462656566-51454d55204e564d65204374726c-00000001   QEMU NVMe Ctrl   deadbeef
172.20.0.5   runtime     Disk   sda       1         10485760000   false       virtio      true                                                                            QEMU HARDDISK
172.20.0.5   runtime     Disk   sdb       1         10485760000   false       sata        true         t10.ATA     QEMU HARDDISK                           QM00013        QEMU HARDDISK
172.20.0.5   runtime     Disk   sdc       1         10485760000   false       sata        true         t10.ATA     QEMU HARDDISK                           QM00001        QEMU HARDDISK
172.20.0.5   runtime     Disk   vda       1         12884901888   false       virtio      true
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-06-07 20:18:32 +04:00
Andrey Smirnov
7c9a14383e
fix: volume discovery improvements
Use shared locks, discover more partitions, some other small changes.

Re-enable the flaky test.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-06-06 19:45:40 +04:00
Andrey Smirnov
ead37abf09
test: disable volume tests
They're flaky, disable until the root cause is known.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-03-19 16:40:42 +04:00
Andrey Smirnov
15beb14780
feat: implement blockdevice watch controller
This controller combines kobject events, and scan of `/sys/block` to
build a consistent list of available block devices, updating resources
as the blockdevice changes.

Based on these resources the next step can run probe on the blockdevices
as they change to present a consistent view of filesystems/partitions.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-03-18 18:28:40 +04:00