440 Commits

Author SHA1 Message Date
Andrey Smirnov
eaf6d47203
refactor: use random port listener in kernel log delivery tests
No functional changes, just better tests.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-29 22:54:02 +03:00
Andrey Smirnov
bf4c81e7da
feat: kernel log (kmsg) delivery controller
This controller is enabled when `talos.logging.kernel=` kernel arg is
passed. It will try to send logs to the endpoint as JSON-over-TCP (or
UDP-over-TCP, depends on the endpoint) as structured messages.

Example (from test implementation):

```
2021-11-26T19:53:21.912+0300	INFO	siderolink-agent/log_receiver.go:23	kernel log message	{"src_address": "fdae:41e4:649b:9303:680a:dfab:f7fa:ea00", "msg": {"clock":6252819,"facility":"user","msg":"[talos] task startAllServices (1/1): waiting for 6 services\n","priority":"warning","seq":711,"talos-level":"warn","talos-time":"2021-11-26T16:53:21.3258698Z"}}
```

Fixes #4455

See also https://github.com/talos-systems/siderolink/pull/4

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-29 17:32:35 +03:00
Andrey Smirnov
f3149780e6
feat: update Kubernetes to 1.23.0-rc.0
Still no proper tags for Kubernetes modules (known issue upstream).

Also bump dependencies.

Closes #4605 closes #4606

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-29 16:22:46 +03:00
Andrey Smirnov
9427e78dc6
fix: catch panics in network operator runs
Fixes #4567

This is not a complete fix, but rather a workaround: if the DHCP4 operator
panics, Talos shouldn't crash on `machined` unhandled panic.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-24 16:39:02 +03:00
Artem Chernyshev
d1f55f9012
fix: update blockdevice library to properly handle absent GPT
Next blockdevice library release reads MBR along with GPT and raises
an error if GPT is not set.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2021-11-24 00:33:00 +03:00
Andrey Smirnov
f7d1e77769
feat: provide SideroLink client implementation
Related to #4448

The only remaining part is filtering out SideroLink addresses when Talos
looks for a node address.

See also https://github.com/talos-systems/siderolink/pull/2

The way to test it out:

```
$ talosctl cluster create ... --extra-boot-kernel-args
siderolink.api=172.20.0.1:4000
```

(where 172.20.0.1 is the bridge IP)

Run `siderolink-agent` (test implementation):

```
$ sudo _out/siderolink-agent-linux-amd64
```

Now on the host, there should be a `siderolink` Wireguard userspace
tunnel:

```
$ sudo wg
interface: siderolink
  public key: 2aq/V91QyrHAoH24RK0bldukgo2rWk+wqE5Eg6TArCM=
  private key: (hidden)
  listening port: 51821

peer: Tyr6C/F3FFLWtnzqq7Dsm54B40bOPq6++PTiD/zqn2Y=
  endpoint: 172.20.0.1:47857
  allowed ips: fdae:41e4:649b:9303:b6db:d99c:215e:dfc4/128
  latest handshake: 2 minutes, 2 seconds ago
  transfer: 3.62 KiB received, 1012 B sent

...
```

Each Talos node will be registered as a peer, tunnel is established.

You can now ping Talos nodes from the host over the tunnel:

```
$ ping fdae:41e4:649b:9303:b6db:d99c:215e:dfc4
PING fdae:41e4:649b:9303:b6db:d99c:215e:dfc4(fdae:41e4:649b:9303:b6db:d99c:215e:dfc4) 56 data bytes
64 bytes from fdae:41e4:649b:9303:b6db:d99c:215e:dfc4: icmp_seq=1 ttl=64 time=0.352 ms
64 bytes from fdae:41e4:649b:9303:b6db:d99c:215e:dfc4: icmp_seq=2 ttl=64 time=0.437 ms
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-22 16:44:35 +03:00
Andrey Smirnov
a76f6d69db
feat: allow kubelet to be restarted and provide negative nodeIP subnets
Fixes #4407 fixes #4489

This PR started by enabling simple restart of the `kubelet` service via
services API, but it turned out there's a problem:

When kubelet restarts, CNI is already up, so there's an interface on the
host with CNI node IP, the code which picks kubelet node IP finds it and
tries to add it to the list of kubelet node IPs which completely breaks
kubelet.

Solution was easy: allow node IPs to be filtered out - e.g. we never
want kubelet node IP to be from the pod CIDR.

But this filtering feature is also useful in other cases, so I added
that as well.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-15 15:43:34 +03:00
Alexey Palazhchenko
189221d589
chore: update dependencies
Closes #4538.
Closes #4539.
Closes #4540.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-15 12:10:03 +00:00
Alexey Palazhchenko
8e8687d759
fix: use temporary sonobuoy version
`replace` should be removed when v0.55.1+ is released.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-12 11:34:09 +00:00
Alexey Palazhchenko
d6147eb17d
chore: update sonobuoy
See https://github.com/vmware-tanzu/sonobuoy/issues/1520.

Closes #4516.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-11 14:53:54 +00:00
Alexey Palazhchenko
82a1ad1681
chore: bump dependencies
Closes #4492.
Closes #4497.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-10 15:02:40 +00:00
Alexey Palazhchenko
785161d19f
feat: update k8s to 1.23.0-alpha.4
See https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md#v1230-alpha4

Closes #4495.
Closes #4498.
Closes #4499.
Closes #4500.
Closes #4501.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-08 19:37:25 +00:00
Alexey Palazhchenko
6e16fd2fee
chore: update tools, pkgs, and extras
To use Go 1.17.3.

Closes #4493.
Closes #4496.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-08 16:00:00 +00:00
Artem Chernyshev
261c497c71
feat: implement talosctl support command
Fixes: https://github.com/talos-systems/talos/issues/4406

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2021-11-08 16:20:50 +03:00
Alexey Palazhchenko
3e7d4df990
chore: bump dependencies
Closes #4473.
Closes #4474.
Closes #4475.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-11-01 13:20:09 +00:00
Alexey Palazhchenko
72f62ac27b
chore: bump Go and Docker dependencies
`go mod tidy -compat=1.17`.

Closes #4426.
Closes #4427.
Closes #4428.
Closes #4429.
Closes #4430.
Closes #4431.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-10-25 08:55:57 +00:00
Andrey Smirnov
ae5af9d3fa
feat: update Kubernetes to 1.23.0-alpha.3
See https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md#v1230-alpha3

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-22 14:59:41 +03:00
Alexey Palazhchenko
431e4fb4b6
chore: bump Go and Docker dependencies
Closes #4387.
Closes #4388.
Closes #4389.
Closes #4390.
Closes #4391.
Closes #4392.
Closes #4393.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
2021-10-18 13:43:36 +00:00
Andrey Smirnov
89f3b9f8d4
feat: update etcd to 3.5.1
See https://github.com/etcd-io/etcd/releases/tag/v3.5.1

This version has a fix for member info getting out of sync:
https://github.com/etcd-io/etcd/issues/13119

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-18 15:34:00 +03:00
Andrey Smirnov
d7a3b7b5b7
chore: use discovery-client and discovery-api modules
This stops using `discovery-service` module which contained both client
and server code. The tests were reworked to use the public discovery
service endpoint.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-14 17:02:11 +03:00
Andrey Smirnov
e44b11c595
feat: update containerd to 1.5.7, bump Go dependencies
containerd: https://github.com/containerd/containerd/releases/tag/v1.5.7

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-12 20:59:13 +03:00
Andrey Smirnov
31b6e39e58
fix: delete expired affiliates from the discovery service
See https://github.com/talos-systems/discovery-service/pull/20

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-12 14:48:57 +03:00
Andrey Smirnov
997873b6d3
fix: use ECDSA-SHA512 when generating certs for Talos < 0.13
Due to the way our crypto library is implemented, it can't generate a
key from CA with ECDSA-SHA256 on older versions of Talos.

Talos >= 0.13: ECDSA-SHA256 with P-256
Talos < 0.13: ECDSA-SHA512 with P-256

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-11 15:19:19 +03:00
Andrey Smirnov
657f7a56b1
fix: use ECDSA-SHA256 signature algorithm for Kubernetes certs
Previously Talos used ECDSA-SHA512 with P-256 EC key, which is not
widely supported combination. Use ECDSA-SHA256 instead.

There's no security benefit to use ECDSA-SHA512 with P-256 key, and this
combination is officially supported by TLS 1.3 standard.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-08 16:59:43 +03:00
Andrey Smirnov
5f277713f0
chore: prepare for 0.13-beta release
Update component versions, Go module versions.

Add platform tiers to the support matrix.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-10-01 17:15:31 +03:00
Andrey Smirnov
9a51aa8358
feat: add an option to skip downed peers in KubeSpan
Fixes #4248

This resolves the balance between security and connectivity.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-29 23:06:14 +03:00
Andrey Smirnov
30ae714243
feat: implement integration with Discovery Service
This provides integration layer with discovery service to provide
cluster discovery (and transitively KubeSpan peer discovery).

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-28 20:24:08 +03:00
Serge Logvinov
ba27bc366f
feat: implement Hetzner Cloud support for virtual (shared) IP
Talos supports automatic virtual IP for the control plane with pure
layer 2 connectivity. Hetzner Cloud API supports assigning Floating IPs
to the nodes, this PR combines existing virtual IP functionality with calls
to HCloud API to move the IP address on HCloud side to the leader node.

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

Talos supports two types of floating IPs:
* external Floating IP for external network
* server alias IP for local networks

The controlplane can have only one alias on the local network interface.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-27 23:45:46 +03:00
Andrey Smirnov
0e18e2800f
chore: bump dependencies
Some via dependabot, some via go-mod-outdated.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-27 16:35:50 +03:00
Artem Chernyshev
cddcb9622b
fix: find devices without partition table
This should fix lookup of CD-ROM devices.
Update `go-blockdevice` library to the version with the fix.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2021-09-27 14:49:41 +03:00
Artem Chernyshev
519999b846
fix: use readonly mode when probing devices with All lookup
Update `go-blockdevice` library.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2021-09-23 14:47:52 +03:00
Artem Chernyshev
452893c260
fix: make probe open blockdevice in readonly mode
Update `go-blockdevice` library.

Readwrite mode doesn't work when there are readonly devices like `iso`.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
2021-09-22 18:48:03 +03:00
Andrey Smirnov
9d803d75bf
chore: bump dependencies and drop firecracker support
Note: Talos can be still run under `Firecracker`, support for
Firecracker was only removed for `talosctl cluster create`.

Reason:

* code is untested/unmaintained, and probably doesn't work correctly
* firecracker Go SDK pulls lots of dependencies and it blocks CNI Go
module update

Bonus: `talosctl-linux-amd64` shrinks by 2 MiB.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-20 17:13:34 +03:00
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
a059454045
chore: build using Go 1.17
`initramfs` size for amd64 shrinks by 1.3 MiB.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-09-13 22:33:47 +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
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