Commit graph

1719 commits

Author SHA1 Message Date
Derek Nola
eb991b23eb
Bump mirrored-pause to 3.10.2 (#14339) (#14392)
* Bump to 3.10.2

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-07-10 14:42:16 -07:00
Brad Davidson
4350867600 Pass through config.DisableAgent in snapshot request handler
Some checks failed
govulncheck / govulncheck (push) Has been cancelled
Fixes issue with on-demand snapshots on agentless servers

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7bee37f9a8)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Brad Davidson
21d670d673 Emit events attached to node when snapshot retention fails
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 9fedc866b5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Artem Muterko
7f415c8ca0 Redact single-dash secret flags in the node args annotation
Signed-off-by: Artem Muterko <artem@sopho.tech>
(cherry picked from commit 5a22c7d4eb)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Archy
d0aaece73f Synchronize egress map and CIDR trie reads in tunnel dialBackend (#14341)
(cherry picked from commit 58fe8e5f2f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Brad Davidson
6b61f0959c Add backoff to initial snapshot reconcile
Backoff starts at 1s and doubles, up to max of 32 seconds

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 79b2e9ee84)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Bheema Reddy
d18a5f19c4 fix: re-import airgap images when timestamp changes even if size is same (#14288)
(cherry picked from commit d8317a64c1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Brad Davidson
0c800b866b Add helm-controller-arg
Replaces helm-job-image flag, and allows setting other new helm-controller options (job-resources and job-tolerations)

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

Add deprecation message in the flag description

Signed-off-by: Manuel Buil <mbuil@suse.com>
(cherry picked from commit 7595fe7b83)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Sebastien Tardif
0a0826b40a fix: pre-apply feature gates before embedded API server starts
In the embedded executor, all Kubernetes components share a single
global utilfeature.DefaultFeatureGate. Feature gate flag parsing
normally occurs inside command.ExecuteContext(), but the API server's
REST storage registration can read the global gate before flags are
parsed, seeing alpha-default values instead of user-configured ones.

This causes an intermittent race condition where alpha feature gates
(e.g. InPlacePodVerticalScaling on K8s v1.32) are ignored even when
correctly configured via the k3s config file. The race depends on
goroutine scheduling: REST storage registration may complete before
the feature gate flag is parsed, causing the API server to not
register the corresponding subresources (e.g. pods/resize).

Fix: extract the feature-gates value from the API server args and
apply it to DefaultMutableFeatureGate before creating the API server
command and starting its goroutine. This ensures the global gate
reflects user configuration before any component reads it. The
subsequent flag parsing in ExecuteContext() will set the same values
again (idempotent).

Ref k3s-io/k3s#14286

AI-assisted: This change was developed with AI assistance.
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
(cherry picked from commit 43c121791c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>

fix: trim comment and include feature-gates value in warning

Apply reviewer suggestion: reduce verbose comment to a single line
and include the feature-gates value in the warning message.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
(cherry picked from commit ae1d51f4f4)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
immanuwell
7ff19d89ef fix: preserve logical paths for symlinked manifests
Signed-off-by: immanuwell <pchpr.00@list.ru>
(cherry picked from commit 419a3f3e25)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Neil
8911db12f2 Fix image-endpoint assignment in run_linux.go (#14246)
I am not sure if cre was used there on purpose, but it seems that the image service endpoint is the correct variable that should be used there.

Signed-off-by: Neil  <khair_talap@outlook.com>
Signed-off-by: neiltalap <khair_talap@outlook.com>
(cherry picked from commit f6d226eaf3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Brad Davidson
3ead5bf2bd Add image names to file cache
Image names are used to re-add the pinned label when importing is
skipped due to the image being skipped due to cache checks. This is done
once on startup, same as pinned label clearing.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit aed887dafb)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-07-09 14:36:04 -07:00
Derek Nola
4a22f09689 Unit test expansion (#14249)
* Expand unit tests for cridockerd and flannel packages
* Cover utility functions in loadbalancer package
* Add unit tests for encrypt/decrypt helper functions
* Add unit tests for isolated methods/functions

Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-07-06 12:11:25 -07:00
Brad Davidson
ead8a0defb Revert "Add runtime checking of golang version"
This reverts commit b297996b92.
2026-06-10 15:20:09 -07:00
Brad Davidson
3d248ec558 Fix cloud-controller-manager exiting due to missing core RBAC
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b82b0881ad)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-10 15:20:09 -07:00
Brad Davidson
be06e97c4a Reduce GRPC console spam
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f96256622a)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-10 15:20:09 -07:00
Brad Davidson
95f87d2c4b Wire up flags to new kine config for T4
T4 reuses datastore TLS config and etcd S3 flags, but needs to not
listen when bootstrapping TLS to avoid trying to connect to the peer
without certs.

T4 only uses TLS between peers when --kine-tls is enabled.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7c0c335d68)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
Brad Davidson
69ba464e00 Fix kine metrics registration
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit ad2fa9df0c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
Eran Markus
3ef4d90369 Use KubeProxyDisabled helper instead of a new config field
Signed-off-by: Eran Markus <eran132@gmail.com>
(cherry picked from commit 8655399438)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
Eran Markus
d143e75125 Skip bridge-nf-call sysctls when kube-proxy and flannel are disabled
Signed-off-by: Eran Markus <eran132@gmail.com>
(cherry picked from commit a1cee760f6)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
Elysia
6a2fed179f Fix token delete argument handling
Signed-off-by: Elysia <148540043+elysia090@users.noreply.github.com>
(cherry picked from commit decbab618f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
Jay Kubo
b81bdcb248 fix: populate IfaceName in LookupExtInterface for VXLAN recreation
LookupExtInterface() constructs a backend.ExternalInterface but never
sets the IfaceName field, leaving it as an empty string. When the VXLAN
device (flannel.1) is deleted — e.g. because the parent interface
specified via --flannel-iface transiently disappears — the recreation
code in vxlan_network.go:165 calls net.InterfaceByName(""), which
always fails. This puts flannel into an unrecoverable retry loop:

  external interface  not found, retrying in 30s

The fix adds IfaceName: iface.Name to the struct literal. The iface
variable already holds the correct *net.Interface; its Name field just
needs to be copied into the IfaceName string that the VXLAN recreation
path reads.

This is a one-line change that enables the VXLAN device recreation
logic added in flannel PR #2272 (v0.27.4+) to actually work when
flannel is embedded in K3s.

Affects any deployment using --flannel-iface with an overlay network
(Tailscale, Nebula, ZeroTier) where the parent interface can
transiently restart.

Ref: https://github.com/k3s-io/k3s/issues/12436
Ref: https://github.com/flannel-io/flannel/issues/2247

Signed-off-by: Jay Kubo <6161465+jkubo@users.noreply.github.com>
(cherry picked from commit 68ce5c2747)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
Eran Markus
d480847f4e Use 0600 permissions for compressed etcd snapshots
Signed-off-by: Eran Markus <eran132@gmail.com>
(cherry picked from commit 7d638a23fa)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-06-03 14:52:45 -07:00
nameearly
a24e47a16a add lost return
Signed-off-by: nameearly <2741313455@qq.com>
(cherry picked from commit 0f05ca280e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-05-07 18:50:22 -07:00
github-actions[bot]
4a5b9d8fc1 chore: Update rancher/klipper-lb image versions
Made with ❤️️ by updatecli

(cherry picked from commit 72ce287af2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-05-07 18:50:22 -07:00
Brad Davidson
a81b85c57f Bump spegel to v0.7.0
Upstream has enabled QUIC in the default transport config, but we
continue to only support HTTPS (TCP) as we do not want to add a
separate QUIC UDP listener on the registry port.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0e575f3a03)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-05-07 18:50:22 -07:00
Brad Davidson
22fe41c2de Move advertise-address setup before server prepare
Prepare uses the SANs list, so all modifications to that need to be done before preparing

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit eaddca726c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-05-07 18:50:22 -07:00
Brad Davidson
0e0da05c70 Replace PreparingExecutor with explicit executor init
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f06dc108f4)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-05-07 18:50:22 -07:00
github-actions[bot]
b5364bb295 chore: Update rancher/klipper-lb image versions
Made with ❤️️ by updatecli

(cherry picked from commit cd6bd5d026)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-05-07 18:50:22 -07:00
Brad Davidson
9355c645d6 Fix SANs added from comma-separated node-external-ip list
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c28aca64ab)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-04-22 11:03:39 -07:00
Brad Davidson
fa6e2c6de9 Fix embedded excutor VPN config injection
Allow the executor to modify node config before certs are generated, and use this to add VPN node IPs to kubelet serving cert

(cherry picked from commit f891548e32)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-04-15 11:20:38 -07:00
Brad Davidson
da70eef4b8 Bump runc/spegel/helm-controller/kine/etcd
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 59004ba8f6)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-04-15 11:20:38 -07:00
Brad Davidson
f7e351de13 Add context to controller event recorders
Fixes issue where RKE2 event recorder events were not logged to console due to lack of logging context.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a666b7905c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-04-15 11:20:38 -07:00
DT1mote
023def1c9b fix: typo in etcd membership error message
Found a typo while working, quick fix.
It should display "This server is not a member of the etcd cluster" instead of "this server is a not a member of the etcd cluster"
Kind regards,

Signed-off-by: DT1mote <74531281+DT1mote@users.noreply.github.com>
(cherry picked from commit cc1c20fdc0)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-04-15 11:20:38 -07:00
Charlie Tonneslan
c4a69ddd56 Fix typo: overriden -> overridden in snapshot_handler.go
Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
(cherry picked from commit f40cf096c9)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-04-15 11:20:38 -07:00
Brad Davidson
13a8403081 Simplify snapshot compress/decompress logic
Compression creates a zipfile with the same path as the snapshot file
containing only the snapshot. Decompression can be a bit simpler by also
extracting to the same path, and erroring if there are unexpected
contents.

In retrospect we probably should have just gzip'd the snapshot file, but
I think there was some intention to observe the same behavior as RKE1,
which used zip files.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-16 16:08:06 -07:00
Brad Davidson
5c183fc25e Bump containerd to v2.2.2
Some checks failed
govulncheck / govulncheck (push) Has been cancelled
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Brad Davidson
a52b2b5fa4 Use etcd-snapshot-retention as default for s3 if etcd-s3-retention is not set
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f4bb1e60c3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Brad Davidson
eeee3af7c6 Drop use of github.com/gorilla/mux
mux is replaced with a simple wrapper around http.ServeMux with middleware chain support

Unfortunately github.com/rootless-containers/rootlesskit/pkg/parent
still uses it so we can't drop the indirect dep yet.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3f5eec4c4e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Brad Davidson
187094a8dd Replace merr.NewErrors with errors.Join
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 270484f01b)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Brad Davidson
5381978123 Update packages to remove dep on archived github.com/pkg/errors
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3acf8db8f2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Brad Davidson
ec5b42708c Bump klipper-lb and klipper-helm
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 6ffcd77ffd)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Brad Davidson
6ea9e61ec3 Do not create etcd name file if etcd is not in use
etcd.setName was being called during managed driver creation, even if the managed driver (etcd) is not in use. Let etcd.Register handle calling setName.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8908d5fcde)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Ada
4a468a208d Add nix-snapshotter support to the embedded containerd
Add support for the "nix" snapshotter, which enables running container
images built with nix2container. Nix images reference store paths
directly, avoiding layer tarballs and enabling deduplication through
the nix store.

Changes:
- Register nix-snapshotter as a builtin containerd plugin
- Add NixSupported() validation (checks nix-store is in PATH)
- Configure nix-snapshotter image service proxy in V2/V3 templates
  with containerd_address for CRI image operations
- Add Transfer service unpack_config with differ=walking for
  multi-arch support
- Use containerd state dir for socket path (rootless compatible)
- Disable NRI in rootless mode to prevent bind failures

Usage: k3s server --snapshotter nix

Signed-off-by: Ada <ada@6bit.com>
Co-Authored-By: Joshua Perry <josh@6bit.com>
Signed-off-by: Ada <ada@6bit.com>
(cherry picked from commit de59b6327c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Fabiano Fidêncio
77b243929e config: add default imports to containerd base templates
Add imports to the generated containerd config so containerd loads
drop-in TOML files: config.toml.d for v2, config-v3.toml.d for v3
(e.g. /var/lib/rancher/k3s/agent/etc/containerd/config.toml.d and
/var/lib/rancher/k3s/agent/etc/containerd/config-v3.toml.d).

Also fix the v3 header comment to say config-v3.toml.tmpl instead
of config.toml.tmpl.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
(cherry picked from commit b51167a996)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-03-11 18:07:57 -07:00
Derek Nola
573223538a
Save cluster state before reencyrpting secrets with newly created key (#13773)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-03-10 11:25:08 -07:00
Brad Davidson
58c8edf69e Improve resilience of datastore bootstrap reconcile from etcd
Some checks are pending
govulncheck / govulncheck (push) Waiting to run
* Add store tests with fixtures
* Try connecting to local etcd first, if it is available
* Handle panics from etcd backend code
* Don't try to read WAL and restore v3 snapshots as they almost never exist

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit d300004f29)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-02-26 13:14:02 -08:00
Derek Nola
52bd766aa6 Revert "Move to rootlesskit v2 (#13486)"
This reverts commit f1b166f74f.

Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-02-26 13:02:02 -08:00
Brad Davidson
2b74b290a2 Fix removal of init node
Removing the initial node from the cluster would previously cause etcd to panic on startup. Fixes to etcd reconcile have stopped that from happening, but now the node will successfully come up and start a new cluster - which is not right either. Require either manual removal of DB files to create a new cluster, or setting server address to join an existing cluster.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-02-10 15:50:00 -08:00
Brad Davidson
2505a99041 Bump klipper-helm and klipper-lb images
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-02-10 14:57:00 -08:00