15 Commits

Author SHA1 Message Date
Andrey Smirnov
032c99a030
refactor: remove pkg/resources dependencies on k8s and base62
This continues the process of removing extra dependencies before moving
`pkg/resources` into machinery.

See also: #4420 #4469

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-15 17:41:11 +03:00
Andrey Smirnov
8329d21114
chore: split polymorphic RootSecret resource into specific types
Fixes #4418

Only one resource (one of the very first ones) was polymorphic: its
actual spec type depends on its ID. This was a bad idea, and it doesn't
work with protobuf specs (as type <> protobuf relationship can't be
established).

Refactor this by splitting into three separate resource types:
`OSRoot` (OS-level root secrets), `EtcdRoot` (for etcd),
`KubernetesRoot` (for Kubernetes).

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-27 19:56:04 +03:00
Artem Chernyshev
64cb873ec4
feat: override static pods default args by extra Args
Use `argsbuilder` same way as it's used in services.
Rewrite `kubeProxy` generation code to override default args.

As a consequence of this change now flags do not have determined order
as they all come from a single merged map.

Introduced merge policy in the `ArgsBuilder` to deny overrides for some
arguments and do additive merge of others.

Fixes: https://github.com/talos-systems/talos/issues/4238
Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2021-09-29 11:50:40 +03:00
Andrey Smirnov
14c69df506
fix: correctly parse multiple pod/service CIDRs
This changes machinery API for the configuration to make it more
obvious that the returned value is a list of CIDRs and adjusts usage
accordingly.

For the K8s Address Filter controller, fix the actual bug by parsing
CIDRs as a list of values.

Fixes #4192

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-08 15:13:28 +03:00
Andrey Smirnov
f25f10e73e feat: add an option to disable PSP
This feature comes as PSP is deprecated and going to be removed in 1.25.
In preparation for that, add an option to disable PSP which was always
enabled in Talos by default.

To keep backwards compatibility, PSP is still enabled by default.

See also #3971

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
Co-authored-by: Adam Szucs-Matyas <szucsitg@gmail.com>
2021-08-06 06:45:33 -07:00
Andrey Smirnov
3aae94e530 feat: provide Kubernetes nodename as a COSI resource
This changes the way Kubernetes nodename is computed: it is set by the
controller based on the hostname and machine configuration, and pulled
from the resource when needed.

Kubelet client now also uses nodename to fix the certifcate mismatch
issue on AWS.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-18 19:58:19 +03: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
Artem Chernyshev
a4d67a0182 feat: add the ability to disable CoreDNS
Fixes: https://github.com/talos-systems/talos/issues/3556

Introduce `coredns.disabled` flag to the machine config that allows
turning off coredns deployment during cluster bootstrap.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-05-28 10:33:14 -07:00
Artem Chernyshev
1db301edf6 feat: switch controller-runtime to zap.Logger
Enable logging using default development config with some fine tuning.
Additionally, now `info` and below logs go to kmsg.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-05-25 02:15:31 -07:00
Andrey Smirnov
d24df8f844 chore: re-import talos-systems/os-runtime as cosi-project/runtime
No changes, just import path change (as project got moved).

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-04-12 07:44:24 -07:00
Artem Chernyshev
22f375300c chore: update golanci-lint to 1.38.0
Fix all discovered issues.
Detected couple bugs, fixed them as well.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-03-12 06:50:02 -08:00
Alexey Palazhchenko
df52c13581 chore: fix //nolint directives
That's the recommended syntax:
https://golangci-lint.run/usage/false-positives/

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-03-05 05:58:33 -08:00
Andrey Smirnov
8789849c70 feat: add support for extra volume mounts for control plane pods
This allows to mount extra volumes into Talos-managed control plane
static pods. With additional options like extra files, any additional
content/configuration can be mounted.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-02-20 08:50:09 -08:00
Andrey Smirnov
7a6e0cd3e5 fix: correctly escape extra args in kube-proxy manifest
JSON is a subset of YAML, so we can use JSON to escape whole YAML value
to handle any kind of symbols.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-02-19 10:56:47 -08:00
Andrey Smirnov
2b76c4890f feat: add an option to disable kube-proxy manifest
This options drops kube-proxy manifest from the list of bootstrap
manifests. It might be used with CNIs which don't need `kube-proxy`.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-02-19 07:26:34 -08:00