Commit Graph

1174 Commits

Author SHA1 Message Date
Manuel Buil
2fc9a40f65 Merge pull request #8420 from manuelbuil/flannelErrors126
[Release 1.26] Add context to flannel errors
2023-09-25 16:33:11 +02:00
Manuel Buil
6c4c157352 Add context to flannel errors
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-09-25 08:28:22 +02:00
Manuel Buil
23c9208c84 Fix error reporting
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-09-22 19:04:56 +02:00
Johnatas
4e217286a7 Update to v1.26.9 and go to v1.20.8 (#8357)
* Update to v1.26.9

Signed-off-by: Johnatas <johnatasr@hotmail.com>

* Bump containerd and stargz versions

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Print message on upgrade fail

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Send Bad Gateway instead of Service Unavailable when tunnel dial fails

Works around new handling for Service Unavailable by apiserver aggregation added in kubernetes/kubernetes#119870

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Add 60 seconds to server upgrade wait to account for delays in apiserver readiness

Also change cleanup helper to ensure upgrade test doesn't pollute the
images for the rest of the tests.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

---------

Signed-off-by: Johnatas <johnatasr@hotmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2023-09-19 15:17:55 -03:00
Brad Davidson
631bb3f0fe Add RWMutex to address controller
Fixes race condition when address map is updated by multiple goroutines

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0d23cfe038)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-08-30 01:34:47 -07:00
Brad Davidson
685aadb8ed Add new CLI flag to enable TLS SAN CN filtering
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-08-29 08:35:09 -07:00
Brad Davidson
0038369c7b Bump dynamiclistener for init deadlock fix
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 66bae3e326)
2023-08-16 13:53:12 -07:00
Vitor
15e0eac168 Fixed the etcd retention to delete orphaned snapshots based on the date
Signed-off-by: Vitor <vitor.savian@suse.com>
2023-08-14 21:17:08 -03:00
Vitor Savian
bd98112cbd Fix for cluster-reset backup from s3 when etcd snapshots are disabled (#8155)
* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <vitor.savian@suse.com>
2023-08-10 16:34:08 -03:00
Ian Cardoso
52e2c08acc fix for etcd-snapshot delete with --etcd-s3 flag (#8110)
k3s etcd-snapshot save --etcd-s3 ... is creating a local snapshot and uploading it to s3 while k3s etcd-snapshot delete --etcd-s3 ... was deleting the snapshot only on s3 buckets, this commit change the behavior of delete to do it locally and on s3

Signed-off-by: Ian Cardoso <osodracnai@gmail.com>
(cherry picked from commit e551308db8)
2023-08-04 19:16:27 -07:00
Brad Davidson
e12600ea27 Add FilterCN function to prevent SAN Stuffing
Wire up a node watch to collect addresses of server nodes, to prevent adding unauthorized SANs to the dynamiclistener cert.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit aa76942d0f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-08-04 16:09:40 -07:00
Brad Davidson
9378c81f05 Make apiserver egress args conditional on egress-selector-mode
Only configure enable-aggregator-routing and egress-selector-config-file
if required by egress-selector-mode.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f21ae1d949)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-08-04 16:09:40 -07:00
Simon Kirsten
dc12bf1a1f Add support for {{ template "base" . }} in etc/containerd/config.toml.tmpl (#7991)
Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc247a0)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-08-04 16:09:40 -07:00
Derek Nola
60bd5c5b3f [Release-1.26] August Test Backports (#8126)
* Unit test for MustFindString (#8013)
* Consolidate CopyFile functions (#8079)
* Remove unnecessary E2E envs
* Cleanup unnecessary "sudo" in commands
* Add additonal s3 coverage clause

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-08-04 11:39:01 -07:00
Vitor
2b42d881ed Fixed the etcd retention to delete orphaned snapshots
Signed-off-by: Vitor <vitor.savian@suse.com>
2023-08-04 10:31:46 -03:00
Manuel Buil
a1ff4612e8 Fix tailscale bug with ip modes
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-08-02 11:43:08 +02:00
Derek Nola
f46b378422 Adjust default kubeconfig file permissions (#7983)
* Adjust default kubeconfig permissions

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-07-15 10:51:05 -07:00
Derek Nola
6c6745b15e Generation of certificates and keys for etcd gated if etcd is disabled. (#7944)
Problem:
When support for etcd was added in 3957142, generation of certificates and keys for etcd was not gated behind use of managed etcd.
Keys are generated and distributed across servers even if managed etcd is not enabled.

Solution:
Allow generation of certificates and keys only if managed etc is enabled. Check config.DisableETCD flag.

Signed-off-by: Bartossh <lenartconsulting@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Bartosz Lenart <lenart.consulting@gmail.com>
2023-07-11 14:43:25 -07:00
Vitor Savian
e200425876 Adding cli to custom klipper helm image (#7682)
Adding cli to custom klipper helm image

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
(cherry picked from commit 0809187cff)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-07-07 16:28:01 -07:00
Brad Davidson
49b549e270 Fall back to basic/bearer auth when node identity auth is rejected
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7f50b40cfe)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-07-07 13:18:45 -07:00
LeiLei
a704a12e23 Add --data-dir to the k3s certificate rotate-ca cli (#7791)
Need to add a cli flag for this. Also, should probably have config file loading support for the certificate commands.

Signed-off-by: leilei.zhai <leilei.zhai@qingteng.cn>
(cherry picked from commit 72d50b1f7c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-07-07 13:18:45 -07:00
Derek Nola
87cb16e618 Fix rootless node password (#7901)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-07-07 13:13:00 -07:00
Denys Smirnov
729ce73fca Support setting control server URL for Tailscale.
This change enables the use of Headscale - open source implementation of the Tailscale control server.

Signed-off-by: Denys Smirnov <dennwc@pm.me>
2023-07-07 12:30:43 +02:00
Manuel Buil
3ee5c0c39d Check if we are on ipv4, ipv6 or dualStack when doing tailscale
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-07-06 11:12:30 +02:00
Derek Nola
6afe691c62 Allow k3s to customize apiServerPort on helm-controller (#7874)
Signed-off-by: Daishan Peng <daishan@acorn.io>
Co-authored-by: Daishan Peng <daishan@acorn.io>
2023-07-05 14:50:06 -07:00
Manuel Buil
e62e7bce77 Merge pull request #7859 from manuelbuil/fixSpell126
[Release 1.26] Fix code spell check
2023-07-05 10:37:42 +02:00
Manuel Buil
d4b1768457 Fix code spell check
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-07-04 15:53:03 +02:00
Manuel Buil
5eef543d65 Remove file_windows.go
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-07-04 12:46:27 +02:00
Manuel Buil
f3b08c3863 [Release 1.26] Fix logging and cleanup in Tailscale (#7782) 2023-06-14 13:23:30 -07:00
Brad Davidson
86ce8e3586 Enable containerd aufs/devmapper/zfs snapshotter plugins
These were unintentionally dropped when moving containerd back into the main multicall binary

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e5e1a674ce)
2023-06-12 10:53:09 -07:00
Brad Davidson
3592729e03 Improve error response logging
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5170bc5a04)
2023-06-12 10:53:09 -07:00
Brad Davidson
725aaa94e7 Soft-fail on node password verification if the secret cannot be created
Allows nodes to join the cluster during a webhook outage. This also
enhances auditability by creating Kubernetes events for the deferred
verification.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 45d8c1a1a2)
2023-06-12 10:53:09 -07:00
Yuxing Deng
a11bd346db Make LB image configurable when compiling k3s
It is no way we can configure the lb image because it is a const value.
It would be better that we make it variable value and we can override
the value like the `helm-controller` job image when compiling k3s/rke2

Signed-off-by: Yuxing Deng <jxfa0043379@hotmail.com>
(cherry picked from commit b64a226ebd)
2023-06-12 10:53:09 -07:00
Brad Davidson
1853afe124 Create new kubeconfig for supervisor use
Only actual admin actions should use the admin kubeconfig; everything done by the supervisor/deploy/helm controllers will now use a distinct account for audit purposes.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 64a5f58f1e)
2023-06-12 10:53:09 -07:00
Brad Davidson
46631ef963 Use distinct clients for supervisor, deploy, and helm controllers
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8748813a61)
2023-06-12 10:53:09 -07:00
Brad Davidson
926d8d9122 Bump metrics-server to v0.6.3 and update tls-cipher-suites
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e9958cf070)
2023-06-12 10:53:09 -07:00
Brad Davidson
cbf8535302 Bump klipper-lb to v0.4.4
Fixes issue with localhost access to ServiceLB when
ExternalTrafficPolicy=Local

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 93279d2f59)
2023-06-12 10:53:09 -07:00
Andrew Roffey
250a9e0035 allow coredns override extensions
Signed-off-by: Andrew Roffey <andrew@roffey.au>
(cherry picked from commit 0485a56f33)
2023-06-12 10:53:09 -07:00
Manuel Buil
ab07b36ccd VPN PoC
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-06-09 19:11:36 +02:00
Derek Nola
8988439e52 [Release-1.26] E2E and Dep Backports - June (#7693)
* Bump docker go.mod (#7681)
* Shortcircuit commands with version or help flags (#7683)
* Fix for longhorn integration test
* Add Rotation certification Check (#7097)
* Add Certification Test to Validate Cluster
* Fix to stop/start for k3s certificate rotation
* E2E: Use sudo for all RunCmdOnNode
* Remove unnecessary daemonset addition/deletion

Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: est-suse <esteban.esquivel@suse.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Esteban Esquivel Alvarado <esteban.alvarado@suse.com>
Co-authored-by: est-suse <esteban.esquivel@suse.com>
Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2023-06-08 15:05:30 -07:00
Manuel Buil
2b838e695d Wrap error stating that it is coming from netpol
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-05-15 09:43:49 +02:00
Brad Davidson
8312c171b2 Bump helm-controller version for repo auth/ca support
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-05-10 17:37:14 -07:00
Brad Davidson
03a3470193 Consistently use constant-time comparison of password hashes
As per https://github.com/golang/go/issues/47001 even subtle.ConstantTimeCompare should never be used with variable-length inputs, as it will return 0 if the lengths do not match. Switch to consistently using constant-time comparisons of hashes for password checks to avoid any possible side-channel leaks that could be combined with other vectors to discover password lengths.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 239021e759)
2023-05-10 17:37:14 -07:00
Brad Davidson
f14d33c471 Fail to validate server tokens that use bootstrap id/secret format
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit cf9ebb3259)
2023-05-10 17:37:14 -07:00
Brad Davidson
8159076d7e Bump cni plugins to v1.2.0-k3s1
Also add bandwidth and firewall plugins. The bandwidth plugin is
automatically registered with the appropriate capability, but the
firewall plugin must be configured by the user if they want to use it.

Ref: https://www.cni.dev/plugins/current/meta/firewall/

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit cedefeff24)
2023-05-10 17:37:14 -07:00
Brad Davidson
173a5b9131 Fix MemberList error handling and incorrect etcd-arg passthrough
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e61fde93c1)
2023-05-10 17:37:14 -07:00
Brad Davidson
705adedd1b Retry cluster join on "too many learners" error
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 91afb38799)
2023-05-10 17:37:14 -07:00
Brad Davidson
82a403a0c2 Fix stack log on panic
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f1b6a3549c)
2023-05-10 17:37:14 -07:00
Brad Davidson
bdd210e785 Fix race condition in tunnel server startup
Several places in the code used a 5-second retry loop to wait on
Runtime.Core to be set. This caused a race condition where OnChange
handlers could be added after the Wrangler shared informers were already
started. When this happened, the handlers were never called because the
shared informers they relied upon were not started.

Fix that by requiring anything that waits on Runtime.Core to run from a
cluster controller startup hook that is guaranteed to be called before
the shared informers are started, instead of just firing it off in a
goroutine that retries until it is set.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c44d33d29b)
2023-05-10 17:37:14 -07:00
Brad Davidson
14ebfa814f Improve egress selector handling on agentless servers
Don't set up the agent tunnel authorizer on agentless servers, and warn when agentless servers won't have a way to reach in-cluster endpoints.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 31a6386994)
2023-05-10 17:37:14 -07:00