8 Commits

Author SHA1 Message Date
Andrey Smirnov
37ea2c9ca2
feat: support for route source addresses in the configuration
Fixes #3941

Also fixes route source address to be address, not a CIDR, as the Linux
kernel keeps it this way actually.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-16 16:58:58 +03:00
Andrey Smirnov
b358a189bc fix: correctly pick route scope for link-local destination
Route scope doesn't depend on destination IP type being link-local, e.g.
in Azure route to link local address is create with gateway, and that
should be global (universe) scope route.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-07-09 13:01:27 -07:00
Andrey Smirnov
b5244bf182 chore: bump go.mod dependencies, fix netaddr API changes
Bump dependencies, clean up go.mod files, update for netaddr changes
(all around `netaddr.IPPrefix` being a private struct now).

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-24 08:37:37 -07:00
Andrey Smirnov
f2ae9cd0c1 feat: replace networkd with new network implementation
This removes networkd, updates network ready condition, enables all the
controllers which were previously disabled.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-15 17:37:28 -07:00
Andrey Smirnov
8b8de11d9f feat: implement new controllers for hostname, resolvers and time servers
This is next part of networkd rewrite.

This implements three new resource types coupled with controllers which
process the default configuration, merges and applying changes.

TimeSync was set up to watch the time servers resource. This is a no-op
for now, but once DHCP is implemented, this would enable time server
configuration coming from DHCP.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-05 12:41:14 -07:00
Andrey Smirnov
6e77536392 refactor: rename *.Status() to *.TypedSpec() in the resources
It was a bad choice to name the method which returns resource spec
typecasted to the proper Go type as `Status()`, as certainly `Status`
has a different meaning for resources. So rename the method accordingly
to be `TypedSpec()`.

No functional or user-visbile changes, just renames.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-01 12:30:13 -07:00
Andrey Smirnov
5811f4dda1 feat: implement link (interface) controllers
The structure of the controllers is really similar to addresses and
routes:

* `LinkSpec` resource describes desired link state
* `LinkConfig` controller generates `LinkSpecs` based on machine
configuration and kernel cmdline
* `LinkMerge` controller merges multiple configuration sources into a
single `LinkSpec` paying attention to the config layer priority
* `LinkSpec` controller applies the specs to the kernel state

Controller `LinkStatus` (which was implemented before) watches the
kernel state and publishes current link status.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-01 09:36:25 -07:00
Andrey Smirnov
0acb04ad7a feat: implement route network controllers
Route handling is very similar to addresses:

* `RouteStatus` describes kernel routing table state,
`RouteStatusController` reflects kernel state into resources
* `RouteSpec` defines routes to be configured
* `RouteConfigController` creates `RouteSpec`s based on cmdline and
machine configuration
* `RouteMergeController` merges different configuration layers into the
final representation
* `RouteSpecController` applies the specs to the kernel routing table

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-05-25 11:09:21 -07:00