3932 Commits

Author SHA1 Message Date
AMet
c11e1dae70
docs: fix spelling and grammar errors
Fix spelling and grammar errors

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-23 14:51:45 +05:30
Dmitriy Matrenichev
30f7851d2a
chore: bump golangci-lint from 1.45.2 to 1.47.2
Minor linter upgrade.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2022-07-22 17:49:44 +03:00
Dmitriy Matrenichev
2cce9112d1
chore: bump goimports from 0.1.10 to 0.1.11
Minor linter upgrade.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2022-07-22 02:07:39 +03:00
Noel Georgi
18756c7ff6
fix: folder permissions of overlay mounted folders
Set the correct permissions for the overlay mounted folders. This issue
was identified from #5948

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-22 01:38:09 +05:30
Utku Ozdemir
47c35dc474
feat: set stable default hostname based on machine-id
Use machine-id as the source for the default hostname (e.g. `talos-2gd-76y`) instead of DHCP-assigned IP (e.g. `talos-172-20-0-2`). This way, DHCP IP changes won't impact the hostname. Defaults to true for Talos version >=1.2.

Closes siderolabs/talos#5896.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-21 19:37:28 +02:00
Noel Georgi
1ed3df295c
chore: support glibc apps extension spec
Update extension spec to support glibc standard path.

Ref: https://github.com/siderolabs/extensions/pull/49

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-21 22:09:56 +05:30
Andrey Smirnov
a2aea97263
fix: write etcd PKI files in a controller
Instead of writing PKI "once" around the startup time, keep writing PKI
files as the certificates get updated. `etcd` is able to reload
certificates, so we should keep updating them e.g. if the hostname/IPs
change over time.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-21 18:37:45 +04:00
Utku Ozdemir
bb4abc0961
fix: regenerate kubelet certs when hostname changes
Clear the kubelet certificates and kubeconfig when hostname changes so that on next start, kubelet goes through the bootstrap process and new certificates are generated and the node is joined to the cluster with the new name.

Fixes siderolabs/talos#5834.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-21 01:54:15 +02:00
Noel Georgi
d650afb6cd
chore: fix typo in powercycle
Fix typo in `powercycle`

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-20 21:33:17 +05:30
Andrey Smirnov
644e803adf
fix: use masks and different firewall mark for KubeSpan
Fixes #4836

Firewall mark is `uint32` attached to the packet in the Linux kernel
(it's not transmitted on the wire). This is a shared value for all
networking software, so multiple components might attempt to set and
match on the firewall mark.

Cilium and Calico CNIs are using firewall marks internally, but they
touch only some bits of the firewall mark.

The way KubeSpan was implemented before this PR, it was doing direct
match on the firewall mark, and setting the whole `uint32`, so it comes
into conflict with any other networking component using firewall marks.

The other problem was that firewall mark 0x51820 (0x51821) was too
"wide" touching random bits of the 32-bit value for no good reason.

So this change contains two fixes:

* make firewall mark exactly a single bit (we use bits `0x20` and `0x40`
  now)
* match and mark packets with the mask (don't touch bits outside of the
  mask when setting the mark and ignore bits outside of the mask when
  matching on the mark).

This was tested successfully with both Cilium CNI (default config +
`ipam.mode=kubernetes`) and Calico CNI (default config).

One thing to note is that for KubeSpan and Talos it's important to make
sure that `podSubnets` in the machine config match CNI setting for
`podCIDRs`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-20 16:05:56 +04:00
Andrey Smirnov
80444a43d9
fix: remove data race in pcap capture
Capture handle should be closed in the same goroutine with packet
reading.

Fix a spurious error which might appear in `talosctl pcap`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-20 01:10:59 +04:00
Spencer Smith
04a45dff28
docs: remove katacoda links
This PR removes katacoda links since katacoda is dead now :(

Signed-off-by: Spencer Smith <spencer.smith@talos-systems.com>
2022-07-19 12:25:15 -04:00
Andrey Smirnov
065b59276c
feat: implement packet capture API
This uses the `go-packet` library with native bindings for the packet
capture (without `libpcap`). This is not the most performant way, but it
allows us to avoid CGo.

There is a problem with converting network filter expressions (like
`tcp port 3222`) into BPF instructions, it's only available in C
libraries, but there's a workaround with `tcpdump`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-19 01:23:09 +04:00
Andrey Smirnov
7c006cabc7
feat: update Kubernetes to 1.24.3
See https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.24.md#changelog-since-v1242

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-18 22:10:34 +04:00
Andrey Smirnov
551290195c
chore: bump dependencies
dependabot + go-mod-outdated

Kubernetes 1.24.3 will go as a separate PR.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-18 21:22:01 +04:00
Andrey Smirnov
1677bcc4b2
fix: skip bond itself when matching interface (Equinix Metal)
This fixes a problem when platform network configuration might have
already been applied from the cached on disk representation, and in that
base e.g. `bond0` MAC is same as `eth0`, so Talos might mistakenly pick
up `bond0` as a slave to itself instead of `eth0`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-18 21:03:48 +04:00
Andrey Smirnov
f1c2b5c558
feat: implement strategic merge patching for API server admission config
The testcase explains it better, but tl;dr is that this allows to do
strategic merge patching e.g. for the Pod Security configuration.

Fixes #5895

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-18 20:15:26 +04:00
Nico Berlee
be98cb82b5
feat: follow KEP-2568 non-root enhancements
KEP-2568: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/kubeadm/2568-kubeadm-non-root-control-plane

Deviation:
 - example sets UID/GID in container context, its safer to do this in pod context

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-18 18:34:13 +04:00
Utku Ozdemir
87ea1d9611
fix: update kubelet kubeconfig when cluster control plane endpoint changes
Overwrite cluster's server URL in the kubeconfig file used by kubelet when the cluster control plane endpoint is changed in machineconfig, so that kubelet doesn't lose connectivity to kube-apiserver.

Closes siderolabs/talos#4470.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-16 14:19:25 +02:00
Utku Ozdemir
a75fe7600d
feat: gen secrets from kubernetes pki dir
This PR allows the ability to generate `secrets.yaml` (`talosctl gen secrets`) using a Kubernetes PKI directory path (e.g. `/etc/kubernetes/pki`) as input. Also introduces the flag `--kubernetes-bootstrap-token` to be able to set a static Kubernetes bootstrap token to the generated `secrets.yaml` file instead of a randomly-generated one. Closes siderolabs/talos#5894.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-16 13:06:32 +02:00
Utku Ozdemir
a1d7b535ad
docs: add kubeadm migration guide
Document how to migrate from kubeadm-based clusters to Talos.

Part of siderolabs/talos#5832

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-16 12:50:27 +02:00
zebernst
9e0c56581e
docs: guide for setting up synology-csi driver
Guide for synology-csi driver

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-15 23:54:34 +05:30
Andrey Smirnov
f0b8eea5e5
refactor: remove bootstrap sequence
Refactor things to remove the bootstrap sequence, this should help with
the task of sequencer concurrency changes and immediate API feedback.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-15 20:24:07 +04:00
Utku Ozdemir
89c7da8991
docs: add documentation for vagrant & libvirt
Documentation of running Talos on a Vagrant environment with libvirt provider.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-15 16:54:30 +02:00
Tim Jones
014b85fdcb
docs: improve talos kubernetes upgrade note
Improve working on Talos upgrade vs Kubernetes upgrades.

Signed-off-by: Tim Jones <tim.jones@siderolabs.com>
2022-07-15 16:08:18 +02:00
Spencer Smith
88bb017ed0
docs: remove old docs from site
This PR removes pre-v0.10 docs from the drop down. They will remain in
the content so folks can still read them if needed.

Signed-off-by: Spencer Smith <spencer.smith@talos-systems.com>
2022-07-14 20:52:35 -04:00
Larry Rosenman
c92c90655a
feat: build talosctl for FreeBSD
This PR adds support for building talosctl for FreeBSD on
amd64 and arm64 architectures.

It also pulls in the latest go-blockdevice library to ensure the FreeBSD
stubs are there for proper build.

Signed-off-by: Spencer Smith <spencer.smith@talos-systems.com>
2022-07-14 20:21:14 -04:00
Andrey Smirnov
616da30695
docs: update last release for 1.1
It is v1.1.1 now.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-13 18:23:04 +04:00
Philipp Sauter
091e6ef0eb
feat: resubstitute talos.config url variables on retry
The download of the talos configuration may fail because the substituted
information like the hostname may not be initialized yet. Therefore we
retry the download and resubstitute the variables each time.

Fixes #3272

Signed-off-by: Philipp Sauter <philipp.sauter@siderolabs.com>
2022-07-13 14:10:41 +02:00
Andrey Smirnov
ec74ab38aa
feat: update Go to 1.18.4, Linux to 5.15.54
See https://github.com/golang/go/issues?q=milestone%3AGo1.18.4+label%3ACherryPickApproved

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-13 12:28:17 +04:00
Andrey Smirnov
641f6a1e4e
feat: expose strategic merge config patches
The end result is that every Talos CLI accepts both JSON and strategic
patches to patch machine configuration.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-12 15:38:01 +04:00
Christoph Schmatzler
6e3d2d647d
docs: fix disk encryption params
adds `provider` key to encryption settings

Signed-off-by: Christoph Schmatzler <christoph@medium.place>
Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-12 15:11:33 +05:30
Alex Wied
c43d6a31d9
docs: fix typos
Fix typo in Equinix docs

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-11 23:07:09 +05:30
Andrey Smirnov
551887528c
chore: bump dependencies
go-mod-outdated + dependabot

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-11 17:55:20 +04:00
Andrey Smirnov
626ef05e60
fix: correct SANs for etcd certs
I would like to rewrite whole cert generation process, but for now a few
fixes:

* client cert doesn't need any SANs
* peer cert should contain only non-localhost SANs
* server cert same as before (localhost + addresses)

See https://etcd.io/docs/v3.5/op-guide/security/ for details.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-11 14:51:27 +04:00
Bermi Ferrer
83ce92c5ff
docs: fix theila docs
Fix command name in theila docs

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-11 15:32:46 +05:30
Andrey Smirnov
8a038d40ee
fix: stabilize etcd join and promote sequences
There were two issues with using discovery service for join and promote:

* on join, that resulted in joining too fast which triggers race bugs in
  etcd cert generation (to be fixed as separate PR)
* on promote, Talos has to connect to non-learner member of the cluster
  which is somehow "automatic" with Kuberentes discovery, as it only
  lists `kube-apiserver` running which is up only when etcd on the same
  node is healthy. etcd client doesn't allow to avoid learner members,
  as even getting a member list from a learner doesn't work (to be fixed
  as a separate PR)

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-08 21:28:13 +04:00
Andrey Smirnov
136122556c
fix: use correct etcd cert path
Remove code which is no longer needed.

Taken from #5806

Co-authored-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-08 15:43:50 +04:00
Noel Georgi
c170ec0b09
chore: bump kernel to 5.15.53
Bump kernel to [5.15.53](https://github.com/siderolabs/pkgs/pull/532)

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-08 16:45:46 +05:30
Utku Ozdemir
d924901b79
feat: add cli subcommand to generate secrets
Adds a new command `talosctl gen secrets` to generate a `secrets.yaml` file with Talos and Kubenetes secrets. This file can later be used like `talosctl gen config ... --with-secrets secrets` to generate a config with these pre-generated secrets. Closes siderolabs/talos#5861.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-06 20:00:35 +02:00
Dmitriy Matrenichev
34aabedd80
feat: more circular pkg from internal to pkg
This PR moves circular package from internal packages to the public pkg folder as the package is stable enough.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
2022-07-06 14:39:40 +03:00
Andrey Smirnov
4f044e4664
feat: implement strategic merge machine config patching
This format is much easier to understand when compared to JSON patches,
it allows for more patch validation, and it should provide better user
experience.

This just implements the config merge, but it doesn't yet hook it up to
any CLI utility, so no user-facing docs.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-05 17:37:24 +04:00
Dennis Marttinen
c2a5126088
fix: avoid double append of talos.platform kernel argument
The example configuration generated by talosctl contains

```yaml
extraKernelArgs:
  - talos.platform=metal
```

in the install section, which, if uncommented, causes the installer to append the
`talos.platform` option twice. Thus, if the platform is set/changed here, it will
not be respected. This change allows the existing value to be overridden.

Signed-off-by: Dennis Marttinen <twelho@welho.tech>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-05 16:18:38 +04:00
Andrey Smirnov
27dfe7c035
fix: perform accurate conflict resolution on overal (kubespan)
Instead of dropping whole peer try to find non-overlapping set of IPs to
route to.

Fixes #5828

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-05 00:13:53 +04:00
Noel Georgi
e437445b40
chore: bump kernel to 5.15.52
Bump kernel to [5.15.52](https://github.com/siderolabs/pkgs/pull/529)

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-04 23:54:31 +05:30
Eirik Askheim
d27a6a4ac0
feat: add vlan support to cmdline
this commits adds dracut style vlan support to allow
installing talos in networks where ports is not tagged
with a default vlan.

Signed-off-by: Eirik Askheim <eirik@x13.no>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-04 21:59:11 +04:00
Andrey Smirnov
fdca5d8a95
chore: bump dependencies
dependabot + go-mod-outdated

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-04 21:22:20 +04:00
Utku Ozdemir
ae3840dbc3
refactor: move kubeconfig package under public api
Move the kubeconfig package under pkg/ so that other projects can reuse parts of it.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2022-07-01 19:22:16 +02:00
Noel Georgi
184e113f35
chore: disable systeminfo controller in container
Disable systeminfo controller in container mode

Fixes: #5849

Signed-off-by: Noel Georgi <git@frezbo.dev>
2022-07-01 19:22:58 +05:30
Andrey Smirnov
86a0a7bdf7
refactor: use pointer types more in machine config structs
There should be no functional change with this PR.

The primary driver is supporting strategic merge configuration patches.
For such type of patches machine config should be loaded from incomplete
fragments, so it becomes critically important to distinguish between a
field having zero value vs. field being set in YAML.

E.g. with following struct:

```go
struct { AEnabled *bool `yaml:"a"` }
```

It's possible to distinguish between:

```yaml
a: false
```

and no metion of `a` in YAML.

Merging process trewats zero values as "not set" (skips them when
merging), so it's important to allow overriding value to explicit
`false`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-07-01 17:27:11 +04:00