495 Commits

Author SHA1 Message Date
Andrey Smirnov
ef36849899
feat: add routes, routing rules and nftables rules for KubeSpan
This concludes basic KubeSpan implementation.

Most of the code is from #3577 with some fixes and refactoring.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Signed-off-by: Seán C McCord <ulexus@gmail.com>
Co-authored-by: Seán C McCord <ulexus@gmail.com>
2021-09-16 20:01:39 +03:00
Serge Logvinov
19a8ae97c6
feat: add vultr.com cloud support
* cloud-init for vultr.com
* ipv4/v6 support
* set static IPs for private interface

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-14 22:58:30 +03:00
Andrey Smirnov
ee2dce6c1a
chore: bump dependencies
PRs:

* #4215
* #4216
* #4217
* #4218
* #4219
* #4220
* #4221

+ go-mod-outdated

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-13 16:39:17 +03:00
Serge Logvinov
3b5f4038de
feat: add scaleway.com cloud support
* cloud-init for scaleway
* set ipv6 to the interface

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-09 23:01:50 +03:00
Andrey Smirnov
69897dbba4
feat: drop some capabilities to be never available
This PR makes sure that some capabilities (SYS_BOOT and SYS_MODULES) and
never be gained by any process running on Talos except for `machined`
itself.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-08 14:46:36 +03:00
Andrey Smirnov
3c3c281bff
chore: bump dependencies via dependabot
PRs:

* #4170
* #4171
* #4172
* #4173

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-30 21:41:46 +03:00
Andrey Smirnov
caee24bf61
feat: implement KubeSpan identity controller
Fixes #4138

When KubeSpan is enabled, Talos automatically generates or loads
KubeSpan identity which consists of Wireguard key pair. ULA address is
calculated based on ClusterID and first NIC MAC address.

Some code was borrowed from #3577.

Example:

```
$ talosctl -n 172.20.0.2 get ksi
NODE         NAMESPACE   TYPE               ID      VERSION   ADDRESS                                       PUBLICKEY
172.20.0.2   kubespan    KubeSpanIdentity   local   1         fd71:6e1d:86be:6302:e871:1bff:feb2:ccee/128   Oak2fBEWngBhwslBxDVgnRNHXs88OAp4kjroSX0uqUE=
```

Additional changes:

* `--with-kubespan` flag for `talosctl cluster create` for quick testing
* validate that cluster discovery (and KubeSpan) requires ClusterID and
ClusterSecret.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Signed-off-by: Seán C McCord <ulexus@gmail.com>
Co-authored-by: Seán C McCord <ulexus@gmail.com>
2021-08-27 18:49:15 +03:00
Olli Janatuinen
ba169c6f91
feat: provide talosctl.exe for Windows
amd64 version only

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2021-08-26 17:06:50 +03:00
Andrey Smirnov
7f22879af0
feat: provide random node identity
Fixes #4137

Node identity is established when `STATE` partition is mounted, and
cached there. Node identity will be used for the cluster discovery
process to identify each node of the cluster.

Random 32 bytes encoded via base62 are used as node identity.

`base62` uses only URL-safe characters which might save us some trouble
later.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-26 16:16:47 +03:00
Alexey Palazhchenko
032e7c6b86
chore: import yaml.v3 consistently
Do not use yaml.v2.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-08-26 11:36:50 +00:00
Andrey Smirnov
57a77696ef
feat: update Kubernetes to 1.22.1
See https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#changelog-since-v1220

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-08-23 09:58:02 +00:00
Alexey Palazhchenko
244b08cc19
chore: bump dependencies
Also downgrade some indirect dependencies that don't have a good reason to be updated.

Closes #4111.
Closes #4112.
Closes #4116.
Closes #4117.
Closes #4121.
Closes #4122.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-08-23 08:49:38 +00:00
Andrey Smirnov
c601dc73f6
chore: update versions to final release tags
No real functional changes, just updating to the final versions before
Talos 0.12 release.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-17 18:06:07 +03:00
Andrey Smirnov
0ef8f83acf
chore: bump dependencies via dependabot
PRs #4079 #4080 #4081 #4082 #4083 #4084 #4085

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-16 16:33:52 +03:00
Andrey Smirnov
b1c66fbad1
feat: implement Equinix Metal support for virtual (shared) IP
Talos supports automatic virtual IP for the control plane with pure
layer 2 connectivity. Equinix Metal API supports assigning shared IPs to
the nodes, this PR combines existing virtual IP functionality with calls
to EM API to move the IP address on EM side to the leader node.

The only thing which should be supplied in the machine configuration is
the Equinix Metal API token, every other setting is automatically
discovered automatically by Talos.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-12 17:26:59 +03:00
Andrey Smirnov
7ca5749ad4 chore: bump dependencies via dependabot
PRs #4033 #4034 #4035 #4036 #4037 #4038 #4039 #4040

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-08-09 08:32:02 -07:00
Andrew Rynhard
1a2e78a24e fix: update go-blockdevice
Brings in the latest version of go-blockdevice to fix and issues with
the PMBR.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2021-08-08 09:09:03 -07:00
Alexey Palazhchenko
09d70b7eaf feat: update Kubernetes to v1.22.0
Closes #3967.
Closes #3997.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-08-06 09:06:32 -07:00
Andrey Smirnov
69ead37353 fix: preserve PMBR bootable flag correctly
See https://github.com/talos-systems/go-blockdevice/pull/41

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-08-04 22:58:15 -07:00
Andrey Smirnov
dee6305170 fix: align partitions with minimal I/O size
Also print discovered blockdevice properties before partitioning the
device.

See https://github.com/talos-systems/go-blockdevice/pull/40

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-08-04 11:51:00 -07:00
Serge Logvinov
b9d04928d9 feat: move system processes to cgroups
* use cgroup v2
* cgroups: /init, /system, /system/runtime
* kubelet cgroup metrics

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
2021-08-04 09:00:38 -07:00
Andrey Smirnov
79b8fa64b9 feat: update containerd to 1.5.5
* https://github.com/containerd/containerd/releases/tag/v1.5.5

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-08-03 10:26:21 -07:00
Andrey Smirnov
539f42090e chore: bump dependencies via dependabot
Fixes #3993

Fixes #3994

Fixes #3995

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-08-03 10:25:17 -07:00
Artem Chernyshev
5f027615ff feat: expose more encryption options to the machine config
Fixes: https://github.com/talos-systems/talos/issues/3606

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-07-27 11:19:26 -07:00
Alexey Palazhchenko
585152a0be chore: bump dependencies
Closes #3983.
Closes #3984.
Closes #3985.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-07-26 04:37:25 -07:00
Artem Chernyshev
55e17ccdd1 chore: bump dependencies
Fixes: https://github.com/talos-systems/talos/pull/3954 https://github.com/talos-systems/talos/pull/3955 https://github.com/talos-systems/talos/pull/3956 https://github.com/talos-systems/talos/pull/3957 https://github.com/talos-systems/talos/pull/3958 https://github.com/talos-systems/talos/pull/3959 https://github.com/talos-systems/talos/pull/3960 https://github.com/talos-systems/talos/pull/3961 https://github.com/talos-systems/talos/pull/3962 https://github.com/talos-systems/talos/pull/3963 https://github.com/talos-systems/talos/pull/3964

And update kubelet to 1.21.3.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-07-19 06:06:01 -07:00
dependabot[bot]
604434c43e chore: bump github.com/prometheus/procfs from 0.6.0 to 0.7.0
Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/prometheus/procfs/releases)
- [Commits](https://github.com/prometheus/procfs/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/procfs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 04:33:39 -07:00
Andrey Smirnov
d930a26502 chore: implement DeepCopy for machine configuration
Resources code extensively uses DeepCopy to prevent in-memory copy of
the resource to be mutated outside of the resource model.

Previous implementation relied on YAML serialization to copy the
machine configuration which was slow, potentially might lead to panics
and it generates pressure on garbage collection.

This implementation uses k8s code generator to generate DeepCopy methods
with some manual helpers when code generator can't handle it.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-07-08 07:21:24 -07:00
Andrey Smirnov
6b661114d0 fix: make COSI runtime history depth smaller
This reduces Talos memory usage.

See https://github.com/cosi-project/runtime/pull/51

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-07-07 10:32:54 -07:00
Alexey Palazhchenko
71c6f7004e chore: bump go.mod dependencies
Closes #3879, #3880, #3881, #3882, #3883, #3884, #3885, #3886.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-07-05 06:59:14 -07:00
Alexey Palazhchenko
f228af4061 chore: bump go.mod dependencies
Closes #3848, #3849, #3850, #3851.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-06-28 02:25:43 -07:00
Andrey Smirnov
829e54f1a4 fix: limit apid access to COSI runtime resources
This makes sure that apid can't access any resources than the one it
actually needs. This improves the security in case of a container
breach.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-24 14:10: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
3a34f1a51d chore: bump Talos Go modules to release versions
No actual changes, just tag updates.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-24 07:45:41 -07:00
Andrey Smirnov
d3f4e6006f fix: replace tabs with spaces in console output
See https://github.com/talos-systems/go-kmsg/pull/2

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-23 16:12:47 -07:00
Artem Chernyshev
1990ad2525 feat: add created and updated timestamps to the resource metadata
This will allow to keep track of when the resource was created and
updated.
Update is tied to the version bump.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-06-23 13:56:49 -07:00
Serge Logvinov
b52b206665 feat: split etcd certificates to peer/client
Changes:
* Etcd peer port key usage: ServerAuth,ClientAuth
* Etcd client port key usage: ServerAuth,ClientAuth
* Talos etcd client key usage: ClientAuth
* KubeAPI etcd client key usage: ClientAuth
* List of etcd allowed ciphers

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-23 13:26:48 -07:00
Andrey Smirnov
d8c2bca1b5 feat: reimplement apid certificate generation on top of COSI
This PR can be split into two parts:

* controllers
* apid binding into COSI world

Controllers
-----------

* `k8s.EndpointController` provides control plane endpoints on worker
nodes (it isn't required for now on control plane nodes)
* `secrets.RootController` now provides OS top-level secrets (CA cert)
and secret configuration
* `secrets.APIController` generates API secrets (certificates) in a bit
different way for workers and control plane nodes: controlplane nodes
generate directly, while workers reach out to `trustd` on control plane
nodes via `k8s.Endpoint` resource

apid Binding
------------

Resource `secrets.API` provides binding to protobuf by converting
itself back and forth to protobuf spec.

apid no longer receives machine configuration, instead it receives
gRPC-backed socket to access Resource API. apid watches `secrets.API`
resource, fetches certs and CA from it and uses that in its TLS
configuration.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-23 13:07:00 -07:00
Alexey Palazhchenko
b6e02311a3 feat: use COSI RD's sensitivity for RBAC
Refs #3421.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-06-21 14:05:06 -07:00
Alexey Palazhchenko
42c16f67f4 chore: bump dependencies
Update k8s to 1.21.2.

See #3787 #3788 #3789 #3790 #3791 #3792 #3793 #3794 #3795 #3796 #3798.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-06-21 07:05:41 -07:00
Andrey Smirnov
60f78419e4 chore: bump etcd client libraries to final 3.5.0 release
There should be no actual changes to the client library, just tag
updates.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-21 05:59:39 -07:00
Alexey Palazhchenko
f63ab9dd9b feat: implement talosctl config new command
Refs #3421.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-06-17 09:06:43 -07:00
Andrey Smirnov
1a1378be16 fix: update retry package with a fix for errors.Is
See https://github.com/talos-systems/go-retry/pull/9

This fixes dropping into maintenance mode on Equinix Metal.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-16 11:44:05 -07:00
Andrey Smirnov
654dcad475 chore: bump dependencies via dependabot
See #3751 #3752 #3753 #3754 #3755 #3756 #3756 #3757

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-16 07:28:17 -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
6a35c8f110 feat: implement virtual IP (shared IP) network operator
Code mostly copy-pasted from the networkd implementation, but adapted to
the resource model:

* watch for etcd state to start/stop activities
* watch for kube-api-server static pod state to give up VIP when
api-server goes down

Gratuitous ARP code re-implemented to drop dependency on kube-vip (once
the old networkd code is removed).

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-11 05:49:22 -07:00
Alexey Palazhchenko
5ad314fe7e feat: implement basic RBAC interceptors
It is not enforced yet.

Refs #3421.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
2021-06-07 09:28:22 -07:00
Andrey Smirnov
8b0763f6a2 chore: bump dependencies via dependabot
PRs #3720 #3721 #3722 #3723 #3724 #3725 #3726
    #3727 #3728 #3729

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-07 06:28:51 -07:00
Artem Chernyshev
14e696d068 feat: update COSI runtime and add support for tail in the Talos gRPC
Updated protobufs to expose tail length option.

Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
2021-06-03 11:46:39 -07:00
Andrey Smirnov
33db8857aa fix: use COSI runtime DestroyReady input type
See https://github.com/cosi-project/runtime/pull/35

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-06-01 12:30:52 -07:00