Commit Graph

1419 Commits (39385c1654e7ea1d2b4136318903c4237c58a4b4)

Author SHA1 Message Date
Brad Davidson 1026d10203 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 13:18:20 -08:00
Brad Davidson 0be80c535d 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 13:18:20 -08:00
Brad Davidson 74274e5a82 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 13:18:20 -08:00
Brad Davidson 1b119e31b5 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 13:18:20 -08:00
Brad Davidson 8c6d5a17e0 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 13:18:20 -08:00
Derek Nola 008981138b
[Release-1.29] Backport E2E GHA fixes (#11229)
* 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-04 20:26:42 -08:00
Derek Nola 9510ac25fe
[Release-1.29] Revert "Make svclb as simple as possible" (#11114)
* 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:21 -07:00
manuelbuil 6cbbd27367 Add the nvidia runtime cdi
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-12 07:38:46 +02:00
manuelbuil 56a9685011 Make svclb as simple as possible
Signed-off-by: manuelbuil <mbuil@suse.com>
2024-10-11 15:50:52 +02:00
Derek Nola 74ce150ee7
Allow additional Rootless CopyUpDirs through K3S_ROOTLESS_COPYUPDIRS env variable (#11043)
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:48 -07:00
Brad Davidson ddaa77f95a 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:54 -07:00
github-actions[bot] a662f1d4b7 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:54 -07:00
Brad Davidson bc636088eb 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:54 -07:00
Brad Davidson 36cc03671d 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:54 -07:00
Brad Davidson 12b9e7d4b1 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:54 -07:00
Brad Davidson 4d0a6134a0 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:54 -07:00
Brad Davidson f8d6f06e10 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:54 -07:00
Brad Davidson 7cdd4db2e7 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:54 -07:00
Vitor Savian 9624098a4e Add user path to runtimes search
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-10-08 13:19:28 -03:00
Brad Davidson 0dfad66a35 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:19 -07:00
Derek Nola 17201d4eb9 Increase timeout polling for secrets-encrypt metrics
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-09-06 14:58:22 -07:00
Derek Nola 9969e8c133 Remove secrets encryption controller (#10612)
* Remove secrets encryption controller

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-09-06 14:58:22 -07:00
Brad Davidson 1dacf77599 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:37 -07:00
Brad Davidson d506595074 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:37 -07:00
Harsimran Singh Maan edd2affb83 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:37 -07:00
Brad Davidson b926e0274f Bump traefik to v2.11.8
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit bd45aa5c45)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-09-06 11:30:37 -07:00
Alireza Eskandari d416975b02 Add tolerations support for DaemonSet pods
Signed-off-by: Alireza Eskandari <alireza.eskandari@wsd.com>
(cherry picked from commit 22fb7049bd)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-08-12 17:09:56 -07:00
Derek Nola 551616038d Allow Pprof and Superisor metrics in standalone mode (#10576)
* Allow pprof to run on server with `--disable-agent`
* Allow supervisor metrics to run on server with `--disable-agent`

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-08-06 08:51:20 -07:00
Derek Nola 1f238a0155 Use higher QPS for secrets reencryption (#10571)
* Use higher QPS for secrets reencryption

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-08-06 08:51:20 -07:00
Brad Davidson 429d00a93f
[release-1.29] Backports for 2024-08 release cycle (#10665)
* Use pagination when retrieving etcd snapshot list

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c2216a62ad)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Update secretsencrypt pagination

Make secretsencrypt page size and iteration consistent with other paginators

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 891e72f90f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Cap length of generated name used for servicelb daemonset

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 21611c5665)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Fix ipv6 sysctl required by non-ipv6 LoadBalancer service

This is a partial revert of 095ecdb034,
with the workaround moved into klipper-lb.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit d4c3422a85)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* remove deprecated use of wait functions

Signed-off-by: Will <will7989@hotmail.com>
(cherry picked from commit e4f3cc7b54)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Update pkg/secretsencrypt/config.go

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: Will Andrews <will7989@hotmail.com>
(cherry picked from commit 3ec086f6f7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Update pkg/cluster/managed.go

Co-authored-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Will Andrews <will7989@hotmail.com>
(cherry picked from commit e2179aa957)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Wire lasso metrics up to common gatherer

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e168438d44)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

* Fix cloudprovider controller name

Looking at metrics revealed the cloudprovider controller name was anempty string.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit bffdf463e1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

---------

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Will <will7989@hotmail.com>
Signed-off-by: Will Andrews <will7989@hotmail.com>
Co-authored-by: Will <will7989@hotmail.com>
Co-authored-by: Derek Nola <derek.nola@suse.com>
2024-08-05 09:35:07 -07:00
galal-hussein b59dfc404a Fixing setproctitle function
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
(cherry picked from commit bf6e874241)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-08-02 11:19:19 -07:00
Brad Davidson f246bbc390 Fix inconsistent loading of config dropins when config file does not exist
FindString would silently skip parsing dropins if the main config file
didn't exist. If a custom config file path was passed it would raise an
error, but if we were parsing the default config file and it didn't
exist it would just silently fail to load the dropins.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-29 17:00:06 -07:00
Brad Davidson 0293118796 Add K3S_DATA_DIR as env var for --data-dir flag
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-29 17:00:06 -07:00
Brad Davidson 3f2e9e2cb9 Don't use server and token values from config file for etcd-snapshot commands
Fixes an issue where running etcd-snapshot commands on a node that has a server address set in the config will manage snapshots on that server, instead of on the local node as intended.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Brad Davidson 875c61d684 Add dial duration to debug error message
This should give us more detail on how long dials take before failing, so that we can perhaps better tune the retry loop in the future.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Brad Davidson 066ff3c10a Fix IPv6 primary node-ip handling
I should have caught `[]string{cfg.NodeIP}[0]` and `[]string{envInfo.NodeIP.String()}[0]` in code review...

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Brad Davidson a5099da4e2 Fix agents removing configured supervisor address
We shouldn't be replacing the configured server address on agents. Doing
so breaks the agent's ability to fall back to the fixed registration
endpoint when all servers are down, since we replaced it with the first
discovered apiserver address. The fixed registration endpoint will be
restored as default when the service is restarted, but this is not the
correct behavior. This should have only been done on etcd-only nodes
that start up using their local supervisor, but need to switch to a
control-plane node as soon as one is available.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Brad Davidson ea59d1f42c Fix reentrant rlock in loadbalancer.dialContext
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Brad Davidson 389ebc7a5b Add etcd s3 config secret implementation
* Move snapshot structs and functions into pkg/etcd/snapshot
* Move s3 client code and functions into pkg/etcd/s3
* Refactor pkg/etcd to track snapshot and s3 moves
* Add support for reading s3 client config from secret
* Add minio client cache, since S3 client configuration can now be
  changed at runtime by modifying the secret, and don't want to have to
  create a new minio client every time we read config.
* Add tests for pkg/etcd/s3

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c36db53e54)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Brad Davidson 92f8dc0a15 Ensure remotedialer kubelet connections use kubelet bind address
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit eb8bd15889)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
github-actions[bot] 2bdaaed7bb Bump Local Path Provisioner version (#10394)
* chore: Bump Local Path Provisioner version

Made with ❤️️ by updatecli

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit a0b374508e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-07-15 10:14:33 -07:00
Roberto Bonafiglia b4b156d9d1 Update flannel to v0.25.4 and fixed issue with IPv6 mask
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2024-07-01 18:58:20 +02:00
Brad Davidson 83ae095ab9 Replace 1-weight semaphore on snapshots with simple mutex
Fixes an issue where the semaphore wasn't permanently initialized
until a scheduled snapshot was taken, allowing multiple on-demand
snapshots to be taken until the first scheduled snapshot was triggered.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-06-19 09:48:09 -07:00
Brad Davidson 4a5f69fae1 Fix agent supervisor port using apiserver port instead
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-06-13 15:13:34 -07:00
Harrison Affel 125f5bf501 fix typo, use rancher/permissions
Signed-off-by: Harrison Affel <harrisonaffel@gmail.com>
2024-06-07 08:31:26 -07:00
Brad Davidson 3ef137a8d2 Fix race condition panic in loadbalancer.nextServer
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-06-07 07:40:10 -07:00
fmoral2 12864fb665
Add test for `isValidResolvConf` (#10302)
Signed-off-by: Francisco <francisco.moral@suse.com>
2024-06-07 11:07:27 -03:00
Vitor Savian 013ec43b02 Add snapshot retention etcd-s3-folder fix
* Add snapshot retention folder fix

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

* Add snapshot retention E2E test

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

---------

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-06-06 20:17:39 -03:00
Brad Davidson 485eaf31b4 Fix bug that caused agents to bypass local loadbalancer
If proxy.SetAPIServerPort was called multiple times, all calls after the
first one would cause the apiserver address to be set to the default
server address, bypassing the local load-balancer. This was most likely
to occur on RKE2, where the supervisor may be up for a period of time
before it is ready to manage node password secrets, causing the agent
to retry.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 1661f1024a)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-06-04 12:48:16 -07:00
Koen de Laat 9fedcc5220 fix: Use actual warningPeriod in certmonitor
Signed-off-by: Koen de Laat <koen.de.laat@philips.com>
(cherry picked from commit 79ba10f5ec)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-06-04 12:48:16 -07:00