Commit Graph

13 Commits

Author SHA1 Message Date
Artem Chernyshev
03604222ea
feat: support passing extra data through the siderolink join token
This extra data is used in the infra provider to add the annotation to the
`siderolink.Link` as early as possible.
Then the `Machine` controller is changed to skip the `Links` that have
annotation `omni.sidero.dev/infra-provider` and do not have the label
`omni.sidero.dev/machine-request`.
This change makes not consistent `Links` to be ignored by the system,
until the are fully populated.

Also changed the infra provider interface to take siderolink connection
params as string instead of the resource.

Fixes: https://github.com/siderolabs/omni/issues/603

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2024-09-05 14:57:51 +03:00
Dmitriy Matrenichev
e2f5795789
chore: allow multiple IP's for siderolink-wireguard-advertised-addr flag
The code is already there: Talos will simply fail to connect and will try again by rotating the IP.
We simply add support for specifying multiple IP's in the `siderolink-wireguard-advertised-addr` flag separated by a comma.

Fixes #495

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2024-08-28 20:41:29 +03:00
Dmitriy Matrenichev
5d48547c7f
chore: use range-over-func iterators for resource iteration
Bump to Go 1.23 and use new iterator mechanism. Also fix new linter issues.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2024-08-22 01:20:55 +03:00
Artem Chernyshev
5d953e407b
fix: do not re-create peer on the remote addr change
And exclude port from the saved address.

Additionally fix Talos backends cache to not to
react on the `MachineType` `Create` and `Update` events.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2024-07-04 12:53:52 +03:00
Artem Chernyshev
cd8bac4117
feat: read real IP from the provision API gRPC requests
And store them in the `link` resources.
This might be help to determine the real IP of the node which is coming
to Omni in case if `MachineStatus` is not populated.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2024-06-26 16:13:48 +03:00
Utku Ozdemir
6dcfd4c979
feat: handle all goroutine panics gracefully
Convert goroutine panics to errors or error logs.

Disallow usage of `golang.org/x/sync/errgroup` package in the backend by `depguard` linter. This linter configuration depends on: https://github.com/siderolabs/kres/pull/417

Rekres the project to include the feature (also bump Go to 1.22.4), but revert `PROTOBUF_GO_VERSION` and `GRPC_GATEWAY_VERSION` manually to not break the frontend.

Disallowing the named `go` statement was not possible at the moment using existing linters, raised an issue in `forbidigo` for it: https://github.com/ashanbrown/forbidigo/issues/47

Closes siderolabs/omni#373.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2024-06-20 21:28:12 +02:00
Artem Chernyshev
a67d1fb30b
fix: always generate siderolink connection config for all machines
Even if they already have the kernel arguments.
It will generate the config only for Talos >= 1.5.0.

Added migration to avoid triggering config updates for all machines, as
they don't have this partial config right now.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2024-05-29 18:55:57 +03:00
Petr Krutov
f38b7e54a6
feat: enable ALPN for machine API
Enabled ALPN negotiation for machine API endpoint

Signed-off-by: Petr Krutov <kjubybot@proton.me>
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2024-05-28 15:57:10 +04:00
Simon-Boyer
16108a9f22
feat: allow setting some url params for api endpoint
This lets the operator define url params for the api endpoint. For example https://<endpoint>/?grpc_tunnel=true. Instead of only appending the jointoken, we are parsing the url and adding it using Query.Set.

Signed-off-by: Simon-Boyer <si.boyer@hotmail.ca>
Co-authored-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2024-05-08 23:27:53 +03:00
Utku Ozdemir
95197e2b07
feat: improve reliability of machine status snapshots
Use the Talos resource API as well as the siderolink event sink to determine the status of a machine.

Follow the agreed decision tree of:
- if the update came over the same channel as before, use it
- if the update came over a different channel than before, and the timestamp is newer than the previous update, use it
- otherwise, drop it

Closes siderolabs/omni#41.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2024-04-30 17:32:20 +02:00
Artem Chernyshev
7f58ea4713
fix: allow adding machines to Omni at higher speed
Introduce a buffer for `PeerEvents` channel, to not block adding new
machines when SideroLink is processing new peers.

Fixes: https://github.com/siderolabs/omni/issues/120

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2024-04-25 17:30:12 +03:00
Dmitriy Matrenichev
d3e3eef0fa
chore: support WG over GRPC in Omni
This PR adds the support for WG over GRPC. New field `VirtualAddrport`
in `SiderolinkSpec` should allow for both
setting the virtual addr and loading it after the Omni restart.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2024-04-10 18:50:49 +03:00
Andrey Smirnov
dfcbaae7d0
chore: initial commit
Omni is source-available under BUSL.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Co-Authored-By: Artem Chernyshev <artem.chernyshev@talos-systems.com>
Co-Authored-By: Utku Ozdemir <utku.ozdemir@siderolabs.com>
Co-Authored-By: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
Co-Authored-By: Philipp Sauter <philipp.sauter@siderolabs.com>
Co-Authored-By: Noel Georgi <git@frezbo.dev>
Co-Authored-By: evgeniybryzh <evgeniybryzh@gmail.com>
Co-Authored-By: Tim Jones <tim.jones@siderolabs.com>
Co-Authored-By: Andrew Rynhard <andrew@rynhard.io>
Co-Authored-By: Spencer Smith <spencer.smith@talos-systems.com>
Co-Authored-By: Christian Rolland <christian.rolland@siderolabs.com>
Co-Authored-By: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Co-Authored-By: Steve Francis <67986293+steverfrancis@users.noreply.github.com>
Co-Authored-By: Volodymyr Mazurets <volodymyrmazureets@gmail.com>
2024-02-29 17:19:57 +04:00