Commit Graph

1473 Commits (976b23d4321df232345f80366eca3eaa9d536ca0)

Author SHA1 Message Date
Brad Davidson 976b23d432 Update tests
Also add an ordinal to subtests so its easier to figure out which one is failing

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-23 17:29:28 -08:00
Brad Davidson 29a5739b7e Remove local restriction for deferred node password validation
Restricting deferred node password validation to only requests from the local node is not possible without breaking split-role cluster cold start. There are too many cases where node password secrets may not yet be available due to the apiserver not being up.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-23 17:29:28 -08:00
Derek Nola 08c30f5ae6
chore: Bump klipper-lb and klipper-helm (#11595)
* Bump klipper-lb to v0.4.10

Bump klipper-helm to v0.9.4
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Bump helm-controller

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-01-16 12:08:26 -08:00
Brad Davidson d0ea741b13 Fix local password validation when bind-address is set
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-15 12:45:16 -08:00
Maja Bojarska 646e3135bc Align etcd-snapshot-dir default path description
The effective snapshot dir is "${data-dir}/server/db/snapshots". The
server segment is missing in the CLI-reported default path, potentially
misleading the user about the actual default snapshot destination.

Signed-off-by: Maja Bojarska <majabojarska98@gmail.com>
2025-01-13 11:32:56 -08:00
Brad Davidson 6b0247fa4d Improve flannel RBAC changes
Only wait for k3s-controller RBAC when AuthorizeNodeWithSelectors blocks kubelet from listing nodes

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-10 17:50:25 -08:00
muicoder 0144d9b749 Update Traefik to v2.11.18
#11501
Signed-off-by: muicoder <muicoder@gmail.com>
2025-01-09 11:45:59 -08:00
Vitor Savian 7e18c69254
Add auto import images for containerd image store
* Add auto import images

Signed-off-by: Vitor Savian <vitor.savian@suse.com>

* Fix EOF error log when importing tarball files

Signed-off-by: Vitor Savian <vitor.savian@suse.com>

* Delaying queue

Signed-off-by: Vitor Savian <vitor.savian@suse.com>

* Add parse for images

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2025-01-09 13:15:27 -03:00
Brad Davidson f345697c0a Add tests for supervisor request handlers
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson e6327652f0 Replace *core.Factory with CoreFactory interface
Make this field an interface instead of pointer to allow mocking. Not sure why wrangler has a type that returns an interface instead of just making it an interface itself. Wrangler in general is hard to mock for testing.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson c20c06373a Move additional core/v1 mocks into tests package
Convert nodepassword tests to use shared mocks

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson 8f8cfb56b5 Move core/v1 mock into tests package for reuse
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson f8271d8506 Add test for join existing cluster
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson 365372441b Handle cluster join as create if we're the only member
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson caeebc52b7 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>
2025-01-09 00:51:19 -08:00
Brad Davidson 5b1d57f7b9 Remove unused Certificate field from Node struct
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-01-09 00:51:19 -08:00
Brad Davidson 2e4e7cf2c1 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>
2025-01-09 00:51:19 -08:00
muicoder 056cee8290
Update Traefik to v2.11.17 (#11502)
#11501
Signed-off-by: muicoder <muicoder@gmail.com>
2025-01-07 14:52:20 -08:00
Derek Nola c3460fce73
Add "k3s certificate check" clause for better test coverage (#11485)
* Add "k3s certificate check" clause for better test coverage

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

* Add table support to cert check

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-01-07 10:19:23 -08:00
Hussein Galal e6f6fce676
Load kernel modules for nft in agent setup (#11524)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-01-07 03:01:02 +02:00
Hyouka e64e2fcfd4
add IPv6 to cluster-dns Usage Docs (#11498)
Signed-off-by: rivolity <hamdaouiomar1@gmail.com>
2025-01-03 09:30:31 -08:00
Brad Davidson 6381ae93e7 Switch to using kubelet config files instead of CLI args
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-20 14:41:40 -08:00
Hussein Galal 763188d642
V1.32.0+k3s1 (#11478)
* Update libraries and codegen for k8s 1.32

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Fixes for 1.32

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Disable tests with down-rev agents

These are broken by AuthorizeNodeWithSelectors being on by default. All
agents must be upgraded to v1.32 or newer to work properly, until we
backport RBAC changes to older branches.

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-20 23:17:14 +02:00
Reinhard Nägele 124be7472b
Update coredns to 1.12.0 (#11387)
* Update to coredns 1.12.0

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2024-12-10 10:09:27 -08:00
Brad Davidson e143e0fa12 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>
2024-12-10 09:31:18 -08:00
Brad Davidson 5a5b136151 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>
2024-12-10 09:31:18 -08:00
Derek Nola 69c310d68b
Remove experimental from embedded-registry flag (#11443)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-12-10 08:37:13 -08:00
Brad Davidson c7ff957cae Fall back to polling the supervisor for apiserver addresses when the watch fails
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 168b344d1d Return apiserver addresses from both etcd and endpoints
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 71918e0d69 Use helper to set consistent rest.Config rate limits and timeouts
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 3d2fabb013 Add loadbalancer metrics
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 911ee19a93 Refactor load balancer server list and health checking
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 95797c4a79 Refactor filterCN to use a Set instead of map[string]bool
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 67fd5fa9e5 Separate persistent config struct from LoadBalancer and make fields private
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson 13e9113787 Move http/socks proxy stuff to separate file
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-12-06 11:45:34 -08:00
Brad Davidson f2f57b4a4b 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>
2024-12-06 11:45:34 -08:00
Derek Nola 183f0c8d09
Fix secrets-encrypt reencrypt timeout error (#11385)
* Add missing default OS for split server test

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

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

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-12-05 09:11:22 -08:00
manuelbuil 4ec261733e If no etcd was deployed, fail etcd-snapshot with a useful error
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-11-28 09:40:42 +01:00
Brad Davidson cd4ddedbc9 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-13 19:41:45 -08:00
Brad Davidson 0c29696eef Fix handling of wrapped subcommands when run with a path
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-12 16:35:54 -08:00
Ludo Stellingwerff 2441e46950 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>
2024-11-08 08:52:53 -08:00
Brad Davidson ff5c633fe7 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>
2024-11-06 09:51:55 -08:00
Brad Davidson 56fb3b0991 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>
2024-11-05 11:36:55 -08:00
Brad Davidson bc60ff79f6 Set kine EmulatedETCDVersion from embedded etcd version
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-11-05 09:07:11 -08:00
Brad Davidson a39e191906 Add tests for ETCD.Test()
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-10-30 12:18:48 -07:00
Brad Davidson 095e34d816 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>
2024-10-30 12:18:48 -07:00
Derek Nola 4888376682
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>
2024-10-16 12:22:07 -07:00
manuelbuil 536fa44eb0 Revert "Make svclb as simple as possible"
This reverts commit 1befd65a0a.

Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-15 20:30:03 +02:00
manuelbuil 054cec849f Add the nvidia runtime cdi
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-11 21:38:21 +02:00
manuelbuil 660c6052c2 Make svclb as simple as possible
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-11 10:52:47 +02:00