Commit Graph

1447 Commits (6c236d061f478f879ab02544495cc1e62c9daeed)

Author SHA1 Message Date
Brad Davidson 6c236d061f Move core/v1 mock into tests package for reuse
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8f8cfb56b5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
Brad Davidson 40f45e7dbb Add test for join existing cluster
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f8271d8506)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
Brad Davidson d0ca7bec63 Handle cluster join as create if we're the only member
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 365372441b)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
Brad Davidson fb7b765383 Add client-side certificate generation support
Clients now generate keys client-side and send CSRs. If the server is down-level and sends a cert+key instead of just responding with a cert signed with the client's public key, we use the key from the server instead.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit caeebc52b7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
Brad Davidson fcc5f32cfe Remove unused Certificate field from Node struct
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5b1d57f7b9)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
Brad Davidson 0d62e7308d Move request handlers out of server package
The servers package, and router.go in particular, had become quite
large. Address this by moving some things out to separate packages:
* http request handlers all move to pkg/server/handlers.
* node password bootstrap auth handler goes into pkg/nodepassword with
  the other nodepassword code.

While we're at it, also be more consistent about calling variables that
hold a config.Control struct or reference `control` instead of `config` or `server`.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 2e4e7cf2c1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
muicoder ebd9961896 Update Traefik to v2.11.17 (#11502)
#11501
Signed-off-by: muicoder <muicoder@gmail.com>
(cherry picked from commit 056cee8290)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
galal-hussein 481758e8ac RBAC changes for compat with AuthorizeNodeWithSelectors
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b4747703b0)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 16:11:04 -08:00
manuelbuil d1ac892f09 If no etcd was deployed, fail etcd-snapshot with a useful error
Signed-off-by: manuelbuil <mbuil@suse.com>
2025-01-09 11:47:17 -08:00
Arne Winter 18ed589122 add node-internal-dns/node-external-dns address pass-through support (#10852)
* add --node-internal-dns and --node-external-dns

Signed-off-by: Arne Winter <github@arnewinter.dev>
Co-authored-by: Brad Davidson <brad@oatmail.org>
(cherry picked from commit c4c11e51f1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-11 17:09:48 -08:00
Brad Davidson fe0a1baef5 Add hidden flag/var for supervisor/apiserver listen config
Add flags supervisor and apiserver ports and bind address so that we can add an e2e to cover supervisor and apiserver on separate ports, as used by rke2

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e143e0fa12)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson 4bc0ffdf9d Fix agent tunnel address on rke2
Fix issue where rke2 tunnel was trying to connect to apiserver port instead of supervisor

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5a5b136151)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson 42d36cf5a2 Fall back to polling the supervisor for apiserver addresses when the watch fails
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c7ff957cae)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson f151d1c38b Return apiserver addresses from both etcd and endpoints
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 168b344d1d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson 89593847d7 Use helper to set consistent rest.Config rate limits and timeouts
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 71918e0d69)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson 46e1c57fc9 Add loadbalancer metrics
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3d2fabb013)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson ea31a93f6f Refactor load balancer server list and health checking
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 911ee19a93)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson bb39692aed Refactor filterCN to use a Set instead of map[string]bool
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 95797c4a79)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson 942a51109a Separate persistent config struct from LoadBalancer and make fields private
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 67fd5fa9e5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson c4bee6fa8e Move http/socks proxy stuff to separate file
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 13e9113787)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Brad Davidson 5e30c670af Remove unused code from etcdproxy
None of these fields or functions are used in k3s or rke2

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f2f57b4a4b)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-10 17:02:07 -08:00
Derek Nola dbe1e39af3
Update coredns to 1.12.0 (#11387) (#11455)
* Update to coredns 1.12.0

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>
2024-12-10 16:21:55 -08:00
Derek Nola f8e26053b7
Remove experimental from embedded-registry flag (#11445)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-12-10 08:37:26 -08:00
Derek Nola 74669307c6
Fix secrets-encrypt reencrypt timeout error (#11441)
* Add missing default OS for split server test



* Launch go routine and return for k3s secrets-encrypt reencrypt



---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-12-09 15:59:23 -08:00
Brad Davidson 51404d0e83 Fix issue with loadbalancer failover to default server
The loadbalancer should only fail over to the default server if all other server have failed, and it should force fail-back to a preferred server as soon as one passes health checks.

The loadbalancer tests have been improved to ensure that this occurs.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-14 08:19:39 -08:00
Brad Davidson 5d2bc57e85 Fix handling of wrapped subcommands when run with a path
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-12 19:28:24 -08:00
Ludo Stellingwerff 7603ce8dfb Fix the "Standalone"-mode of oidc-login in the wrapped kubectl application.
This fixes: 'error: no Auth Provider found for name "oidc"' when trying to run any subcommands in kubectl that require a valid server login.

Signed-off-by: Ludo Stellingwerff <ludo.stellingwerff@gmail.com>
(cherry picked from commit 2441e46950)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-12 19:28:24 -08:00
Brad Davidson 48750ae6fc Fix MustFindString returning override flags on external CLI commands
External CLI actions cannot short-circuit on --help or --version, so we
cannot skip loading the config file if these flags are present when
running these wrapped commands. The behavior of just returning the
override flag name instead of the requested flag value was breaking
data-dir lookup when running wrapped commands.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit ff5c633fe7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-06 12:41:11 -08:00
Brad Davidson e08085f1e9 Add nonroot-devices flag to agent CLI
Add new flag that is passed through to the device_ownership_from_security_context parameter in the containerd CRI config. This is not possible to change without providing a complete custom containerd.toml template so we should add a flag for it.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 56fb3b0991)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-06 12:41:11 -08:00
Brad Davidson 39489b475d Set kine EmulatedETCDVersion from embedded etcd version
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit bc60ff79f6)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-06 12:41:11 -08:00
Brad Davidson 208aafc9a0 Add tests for ETCD.Test()
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a39e191906)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-06 12:41:11 -08:00
Brad Davidson f213d2ad0d Fix issues with defragment and alarm clear on etcd startup
* Use clientv3.NewCtxClient instead of New to avoid automatic retry of all RPCs
* Only timeout status requests; allow defrag and alarm clear requests to run to completion.
* Only clear alarms on the local cluster member, not ALL cluster members

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 095e34d816)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-06 12:41:11 -08:00
Derek Nola ddea433411
[Release-1.30] Backport E2E GHA fixes (#11227)
* Fix Github Actions for Ubuntu-24.04 (#11112)

* Fix vagrant/libvirt composite action for ubuntu-24.04

* Don't ignore changes to internal actions

* Fix unit tests for ubuntu 24.04, new lsof version

* Pin os version for unit and E2E workflows

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Pin vagrant to older version to avoid known issue 13527

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-11-05 08:36:52 -08:00
Derek Nola 5ec454f50e
[Release-1.30] Revert "Make svclb as simple as possible" (#11113)
* Revert "Make svclb as simple as possible"

This reverts commit 1befd65a0a.

Signed-off-by: manuelbuil <mbuil@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Pin E2E tests to 22.04

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: manuelbuil <mbuil@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: manuelbuil <mbuil@suse.com>
2024-10-15 22:35:33 -07:00
manuelbuil 29fd916cc9 Add the nvidia runtime cdi
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-12 07:37:48 +02:00
manuelbuil e9bb624c92 Make svclb as simple as possible
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-11 15:51:01 +02:00
Derek Nola 737f5946c0
Allow additional Rootless CopyUpDirs through K3S_ROOTLESS_COPYUPDIRS env variable (#11044)
Signed-off-by: Ludo Stellingwerff <ludo.stellingwerff@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Ludo Stellingwerff <ludo@almende.org>
2024-10-10 13:13:40 -07:00
Brad Davidson 53369c52fb Bump local-path-provisioner to v0.0.30
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b0ad6d846d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
github-actions[bot] 51a609bf22 chore: Bump Local Path Provisioner version
Made with ❤️️ by updatecli

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c00af8e95e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Brad Davidson 72b0eb5f5a Update tcpproxy for import path change
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 1ae9ca73f5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Brad Davidson 6131cd9abf Fix issue that caused passwd file and psk to be regenerated when rotating CA certs
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c6392c9ffc)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Brad Davidson 97df5ce8d2 Fix race condition when multiple nodes reconcile S3 snapshots
Don't delete s3 etcdsnapshotfiles if they are missing from s3 but less than a minute old, its possible the other node just finished uploading it and the object key has not yet become visible.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0826ebc142)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Brad Davidson cc4e044bb6 Fix sqlite endpoint when migrating from sqlite to etcd
Support for 'sqlite' as the endpoint was removed in
https://github.com/k3s-io/kine/pull/320 and the constant removed in
https://github.com/k3s-io/kine/pull/325

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0942e6a0c5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Brad Davidson f35165d434 Bump kine
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c9e7b05971)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Brad Davidson b0f98b28e5 Bump traefik to chart 27.0.2 / appVersion v2.11.10
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 6c6d87d1b0)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-10 11:40:39 -07:00
Vitor Savian 0a2b383a32 Add user path to runtimes search
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-10-08 13:19:18 -03:00
Brad Davidson ca84f13846 Fix hosts.toml header var
Resolves issue from 270f85e468 that prevented old hosts.toml files from being cleaned up.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-09-10 15:00:04 -07:00
Brad Davidson 9e06189a7c Only clean up containerd hosts dirs managed by k3s
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 270f85e468)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-09-06 11:30:23 -07:00
Brad Davidson 507f728491 Fix rotateca validation failures when not touching default self-signed CAs
Also silences warnings about bootstrap fields that are not intended to be handled by CA rotation

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit fe3324cb84)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-09-06 11:30:23 -07:00
Harsimran Singh Maan f65b540eec Update coredns to 1.11.3 and metrics-server to 0.7.2
Used https://github.com/coredns/corefile-migration to
migrate the corefile. There are no changes for the
default file from 1.10.1 to 1.11.3.

Notable plugin changes include the k8s_external with fallthrough option
and rewrite with cname_target option.

These changes are not part of the default config that ships
with k3s. Customers using these two plugins can start using the new options

Metrics does not have any new features other than build tooling updates.

Requires https://github.com/rancher/image-mirror/pull/704

Signed-off-by: Harsimran Singh Maan <maan.harry@gmail.com>
(cherry picked from commit 0b4d2497e5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-09-06 11:30:23 -07:00