258 Commits

Author SHA1 Message Date
Andrey Smirnov
60448b516e
feat: add support for instance tags on AWS
We can add on other platforms as well as we go.

See https://github.com/siderolabs/omni/issues/1059

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-04-08 12:57:56 +04:00
Noel Georgi
c4136c27da
fix: uki boot detection
Fix UKI boot detection

Also fix bug introduced by #10640 which imported the unix package making
talosctl non-unix builds broken.

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-04-08 09:02:02 +05:30
Noel Georgi
1996610375
feat: expose if system is booted with UKI
Expose if system is booted with a UKI in `securitystate` resource.

Fixes: #10620

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-04-04 16:14:11 +02:00
Andrey Smirnov
c83611ddd7
test: more extension modules
Update with the fix https://github.com/siderolabs/pkgs/pull/1200, load
explicitly `xdma` and `ena` drivers.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-04-03 17:54:28 +04:00
Andrey Smirnov
203e02df49
refactor: implement directory and overlay mounts
This complements the previous PRs to implement more volume features:
directory volumes control their permissions, SELinux labels, etc.

Overlay mounts support additional parent relationship.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-04-01 20:51:02 +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
d4aacb0d85
refactor: mount operation for STATE and user disks
Use new controller for user disk and STATE mounts, drop
old code in the sequencer.

Also support mounts with parent (when e.g. `/var/lib` is mounted on top
of `/var`).

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-03-20 20:46:57 +04:00
Andrey Smirnov
44f3c72489
fix: kata extension
Fixes #10575

See https://github.com/siderolabs/extensions/pull/651

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-03-20 19:58:44 +04:00
Andrey Smirnov
f9b14e7848
fix: reconnect on SideroLink tunnel on/off change
The issue is not so easy to fix, as GRPC tunnel on/off change requires
two different flow for the link (interface):

* no tunnel -> Talos link controller should create in-kernel `wireguard`
  link and no userspace components
* tunnel on -> Talos link controller should never create the link, and
  only adjust WG settings via UAPI, while the actual link is created by
  the userspace implementation (it's a `tun` device)

Transition between those two links is impossible for the link controller
to distinguish, as it doesn't know that it has to drop old link and skip
creating new one based on the information available.

So, instead, use different names for the link in two states:
`siderolink` for the kernel flow, and `siderolinktun` for the userspace
flow. This fixes the issue of proper link cleanup/re-creation.

Add integration tests.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-03-13 15:08:09 +04:00
Noel Georgi
29f7b3bf37
test(ci): use k8s websocket executor for tests
Use k8s websocket executor over SPDY.

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-03-12 18:54:48 +05:30
Andrey Smirnov
a3f88d2ef5
fix: block NodePort services with ingress firewall
The previous fix #10354 was not full/complete.

The problem lies in the fact that `kube-proxy` creates a rule like:

```
chain nat-prerouting {
	type nat hook prerouting priority dstnat; policy accept;
	jump services
}
```

This chain has a prerouting hook, which gets executed before Talos's
input hook, and rewrites (does DNAT) for NodePort services before Talos
has a chance to block the packet, but rewritten packet hits the input
chain with DNAT address, or might be forwarded to another host and never
hit the firewall again.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-02-28 19:56:52 +04:00
Andrey Smirnov
47f377b21f
feat: implement the last ethtool feature - channels
Fixes #9173

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-02-11 15:34:57 +04:00
Andrey Smirnov
0419f5d8ba
feat: implement features in ethtool-like support
Support showing current feature state, and changing features on the fly.

The output and interface should be similar to `ethtool`.

We don't support legacy feature names.

```
node: 172.20.0.5
metadata:
    namespace: network
    type: EthernetStatuses.net.talos.dev
    id: enp0s2
    version: 2
    owner: network.EthernetStatusController
    phase: running
    created: 2025-02-10T11:40:32Z
    updated: 2025-02-10T11:40:32Z
spec:
    linkState: true
    port: Other
    duplex: Unknown
    rings:
        rx-max: 256
        tx-max: 256
        rx: 256
        tx: 256
        tx-push: false
        rx-push: false
    features:
        tx-scatter-gather: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        highdma: on [fixed]
        tx-scatter-gather-fraglist: off [fixed]
        tx-vlan-hw-insert: off [fixed]
        rx-vlan-hw-parse: off [fixed]
        rx-vlan-filter: on [fixed]
        vlan-challenged: off [fixed]
        tx-generic-segmentation: on
        rx-gro: on
        rx-lro: off [fixed]
        tx-tcp-segmentation: on
        tx-gso-robust: on [fixed]
        tx-tcp-ecn-segmentation: on
        tx-tcp-mangleid-segmentation: off
        tx-tcp6-segmentation: on
        tx-fcoe-segmentation: off [fixed]
        tx-gre-segmentation: off [fixed]
        tx-gre-csum-segmentation: off [fixed]
        tx-ipxip4-segmentation: off [fixed]
        tx-ipxip6-segmentation: off [fixed]
        tx-udp_tnl-segmentation: off [fixed]
        tx-udp_tnl-csum-segmentation: off [fixed]
        tx-gso-partial: off [fixed]
        tx-tunnel-remcsum-segmentation: off [fixed]
        tx-sctp-segmentation: off [fixed]
        tx-esp-segmentation: off [fixed]
        tx-udp-segmentation: off
        tx-gso-list: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
        rx-ntuple-filter: off [fixed]
        rx-hashing: off [fixed]
        rx-checksum: on [fixed]
        tx-nocache-copy: off
        loopback: off [fixed]
        rx-fcs: off [fixed]
        rx-all: off [fixed]
        tx-vlan-stag-hw-insert: off [fixed]
        rx-vlan-stag-hw-parse: off [fixed]
        rx-vlan-stag-filter: off [fixed]
        l2-fwd-offload: off [fixed]
        hw-tc-offload: off [fixed]
        esp-hw-offload: off [fixed]
        esp-tx-csum-hw-offload: off [fixed]
        rx-udp_tunnel-port-offload: off [fixed]
        tls-hw-tx-offload: off [fixed]
        tls-hw-rx-offload: off [fixed]
        rx-gro-hw: on
        tls-hw-record: off [fixed]
        rx-gro-list: off
        macsec-hw-offload: off [fixed]
        rx-udp-gro-forwarding: off
        hsr-tag-ins-offload: off [fixed]
        hsr-tag-rm-offload: off [fixed]
        hsr-fwd-offload: off [fixed]
        hsr-dup-offload: off [fixed]
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-02-10 16:05:49 +04:00
Andrey Smirnov
716f700da7
feat: provide initial support for ethtool configuration
See https://github.com/siderolabs/ethtool - our fork.

This PR covers only configuring rings, follow-up PRs will address other
pieces: channels and features.

Example:

```
node: 172.20.0.5
metadata:
    namespace: network
    type: EthernetStatuses.net.talos.dev
    id: enp0s2
    version: 4
    owner: network.EthernetStatusController
    phase: running
    created: 2025-02-04T16:03:14Z
    updated: 2025-02-04T16:04:12Z
spec:
    linkState: true
    port: Other
    duplex: Unknown
    rings:
        rx-max: 256
        tx-max: 256
        rx: 128
        tx: 128
        tx-push: false
        rx-push: false
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-02-05 21:28:42 +04:00
Andrey Smirnov
93b4a3740b
test: bump timeout on rotate CA test
When using VIP, recovery of Kubernetes controlplane takes more time
(plus given the fact that the test rotates PKI twice).

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2025-01-28 18:42:06 +04: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
bde516fde6
chore(ci): rework iscsi-tools extensions test
Rework `iscsi-tools` extensions tested based on https://github.com/siderolabs/extensions/pull/577

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-01-20 23:27:10 +05:30
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
Noel Georgi
83d84a8318
chore(ci): better zfs checks
Part of: https://github.com/siderolabs/extensions/issues/572

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-01-02 21:12:31 +05:30
Andrey Smirnov
27233cf0fc
test: use node informer instead of raw watch
This should improve watch reliability, as it was failing on channel
being closed.

Fixes #10039

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-12-25 18:52:07 +04:00
Noel Georgi
a5660ed778
feat: pcirebind controller
Add a controller to support rebinding drivers for PCI devices.

Fixes: https://github.com/siderolabs/extensions/pull/488

Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-12-20 17:35:37 +05:30
Andrey Smirnov
7d39b9ec2b
feat: remove cgroupsv1 in non-container mode
Following up on deprecation in Talos 1.9, remove it completely for Talos
1.10.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-12-18 18:48:11 +04:00
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
e33d2f581f
feat: support overriding base OCI spec for CRI
Fixes #9827

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-29 16:22:25 +04:00
Andrey Smirnov
fc3b31575c
fix: multiple issues with opening encrypted volumes
Fixes #9820

This only affects volumes with multiple key slots configured.

Make sync issues non-fatal, so that if some keys fail to sync, proceed
with normal boot, but record an error in the `VolumeStatus` resource.

When opening, correctly try all key slots.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-28 21:34:41 +04:00
Andrey Smirnov
ef69c9d39b
feat: update Linux to 6.12.1
No other changes, just update default bundled module list.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-27 23:08:14 +04:00
Dmitry Sharshakov
a13f82c594
feat: udev: label device nodes
Use udev rules to assign basic device file labels based on their subsystem

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-11-22 12:42:22 +01:00
Dmitry Sharshakov
e899fb37fd
feat: label created files in /etc
Implement SELinux labeling support in EtcFileController, label both squashfs and runtime-created files in /etc and /system/etc.

Add corresponding test cases.

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-11-22 09:16:13 +01:00
Noel Georgi
77cf84fb57
feat: support generating iso with imagecache
Support generating iso with imagecache.

Part-of: #9616

Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-11-21 20:40:05 +05:30
Dmitry Sharshakov
1a8cc5f8b2
feat: add SELinux labels to volumes
Label mounted filesystems like ephemeral, overlay mounts, as well as data directories (going to become volumes later).

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-11-21 14:23:43 +01:00
Andrey Smirnov
cc768037f8
feat: implement block device wipe
Fixes #9731

The wipe doesn't require a reboot, but it requires the blockdevice not
to be used as a volume.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-20 15:46:37 +04:00
Dmitriy Matrenichev
e26d0043e0
chore: code cleanup
More usage of slices package, less usage of package sort.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2024-11-14 12:25:56 +03: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
9916e2cd8a
chore: update pkgs/tools/extras for Go 1.23.3
Bump some dependencies as well.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-12 16:38:32 +04:00
Andrey Smirnov
9a02ecc49f
feat: rewrite install disk selector to use CEL expressions
Rewrite matcher to take out old go-blockdevice library out of the way,
implementing translation from go-blockdevice format to CEL.

Implement facilities to build CEL expressions programmatically.

Now we can add a machine config disk match expression (CEL) easily.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-11 17:23:15 +04:00
Noel Georgi
fb72e4b7b7
fix(ci): skip test if UserNamespacesSupport feature gate is not set
We should not just rely on the sysctl, also confirm that `UserNamespacesSupport=true`
feature gate is set for apiserver, so that the tests gets skipped if only sysctl is set.

Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-11-08 16:16:11 +05:30
Nico Berlee
11380f933d
feat: display current CPU frequency on dashboard
Dashboard now shows the active frequency of each CPU core when cpufreq
is available on non-virtualized systems, enhancing real-time accuracy.

Solves the issue of displaying 0MHz on certain SBCs due to
/proc/cpuinfo limitations.

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-11-08 12:05:48 +04:00
Dmitry Sharshakov
a867f85e4c
feat: label system socket and runtime files
Set SELinux labels so that services could gain access permissions.

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-11-06 07:29:35 +01:00
Dmitry Sharshakov
960a040491
feat: start enabling SELinux
Part of: #9127

Label executables and processes, build, load and manage SELinux policy, enable audit support.

Labeling filesystems, devices and runtime files will be done in further changes, see the full PR.

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-11-04 16:56:53 +01:00
Noel Georgi
9abf16108e
feat: add auditd service
Adds a auditd service that gathers all audit logs from kernel.

Signed-off-by: Noel Georgi <git@frezbo.dev>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Signed-off-by: Noel Georgi <git@frezbo.dev>
2024-11-02 22:25:04 +05:30
Andrey Smirnov
c755b6d7e4
fix: update the CRI sandbox image reference
Fix the test, and update the reference.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-10-28 14:52:19 +04:00
Andrey Smirnov
534b0ce183
feat: update runc to 1.2.0 final
Via pks.

See https://github.com/opencontainers/runc/releases/tag/v1.2.0

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-10-22 16:47:24 +04:00
Dmitry Sharshakov
29780d35a0
test: add an integration test for verifying process parameters
Validate capabilities are dropped and cgroup, UID, environment and OOM adjustments are set

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-10-18 16:59:41 +02: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
Dmitry Sharshakov
b67bc73fd3
fix: fix mdadm system extension
Update pkgs to include a fixed version of systemd-udevd which searches for udev rules under /usr/etc/udev/rules.d as used by our system extensions.

Re-enable the affected test

Fixes #9423

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-10-04 19:51:25 +02: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
Dmitry Sharshakov
74c12c20e0
feat: replace eudev with systemd-udevd
Eudev has seen less development effort recently with Gentoo and others moving towards using systemd-udevd which can now be built independently

Update pkgs, include more libraries, change udevd executable name

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
2024-10-02 19:08:40 +02: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