Commit Graph

1558 Commits

Author SHA1 Message Date
Vitor Savian
968460dfe8 Add retention flag specific for s3
* Add retention flag specific for s3
* Add retention for the unit tests:

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2025-08-05 14:06:38 -03:00
Brad Davidson
19394a9da1 Update kine and use config defaults helper
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5ce3db779d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-07-14 18:24:28 -07:00
Brad Davidson
79887b7e1f Update to new CRDs
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7ab7865530)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-07-14 18:24:28 -07:00
bo.jiang
9fd01a8707 fix: Remove unused legacy certificates
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
(cherry picked from commit db778faaf3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-07-14 18:24:28 -07:00
Derek Nola
d66f873a12 [Release-1.31] GHA Artifacts + Testing Backports July 2025 (#12610)
* Move to more secure split trivy workflow based on labels, not comments (#12592)

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

* Add basic fuzz test

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

* Add retry around common timeout for hardened docker test (#12601)

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

* Remove ghcr build cache (#12602)

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

* Migrate K3s Release Artifacts to GHA (#12606)

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-07-11 10:55:51 -07:00
Vitor Savian
05e0f84a23 Refac shell completion to a better command structure
* Refac for shell completion

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

* Change FLAGS to OPTIONS

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

* Refac bash and zsh func names

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

* Refac bash and zsh func names

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

---------

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2025-07-11 03:45:20 -03:00
Derek Nola
77dca1ac15 Add usage description for etcd-snapshot (#12572)
Co-authored-by: Manuel Buil <mbuil@suse.com>
2025-07-03 09:24:25 -07:00
Roberto Bonafiglia
c548d39a53 Update network components
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2025-06-17 15:00:26 +02:00
Brad Davidson
eb195875e5 Fix sqlite-etcd migration
Forgot to add new config to temporary kine in #12293

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 4eabd0f1fd)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-06-13 11:08:25 -07:00
Zero King
ad7568bf8e Add new topologySpreadConstraints to coredns
Prefer scaling across zones if multiple zones are available.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-06-13 11:08:25 -07:00
bo.jiang
5793ff60c7 Fix K3s not validating datastore connection when no token is set
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
(cherry picked from commit b5f4fd1d73)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-06-13 11:08:25 -07:00
haruna
0031ed6df1 Improve shebang of bash completion script
Signed-off-by: haruna <w10776e8w@yahoo.co.jp>
(cherry picked from commit d256968ee4)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-06-13 11:08:25 -07:00
bo.jiang
ce341a1270 Fix secrets encryption rotation timeout causing false failures
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
(cherry picked from commit f7f546a23e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-06-13 11:08:25 -07:00
Brad Davidson
6c7be18621 Fix startuphooks race condition panic
Ensure startup hooks WaitGroup is initialized before starting goroutine that will wait on it

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-15 17:46:07 -07:00
Brad Davidson
64981bc458 Fix secretsencryption request handler panic
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-15 17:46:07 -07:00
Brad Davidson
398eef4220 Fix authorization-config/authentication-config handling
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-15 15:39:35 -07:00
Brad Davidson
8053523ea1 Sync datastore config defaults with kine CLI
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 10e3d40bf3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Richard Hansen
d4bb1cbbda flannel: Use custom type for network mode (IPv4, IPv6, dual-stack)
Move the `ipv4` and `ipv6` constants to their own constant
declaration.  This ensures that the `iota` expression for the `ipv4`
constant evaluates to 0, not some arbitrary value.  (`iota` evaluates
to N for the Nth constant in the constant declaration; see
<https://go.dev/ref/spec#Iota>.)  This is also more idiomatic, which
improves readability.

Also switch from incremental integers to bit flags, and use bitwise
operators for checking.  This is more idiomatic (the integer is
treated like a set of booleans), it avoids some code duplication, and
it is necessary to avoid ambiguity.  Consider the following:

    const (
    	ipv4 = iota
    	ipv6
    )

In the above, `ipv4` would have the value 0 and `ipv6` would have the
value 1.  This would make it impossible to distinguish an IPv6-only
stack from a dual-stack configuration because `ipv6` would equal
`ipv4 + ipv6`.  With bit flags this problem doesn't exist.

And put the integer holding the bit flags in a custom type with
convenience methods to improve readability.

Signed-off-by: Richard Hansen <rhansen@rhansen.org>
(cherry picked from commit 925726c84d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
bo.jiang
a890866a83 Optimize certificate status check
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
(cherry picked from commit 4c1f014d27)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Brad Davidson
36ef04e9c9 Add support for conditional image tarball imports
Normally K3s will import all tarballs in the image dir on startup, and
re-import any tarballs that change while it is running.

This change allows users to opt into only importing tarballs that have
changed since they were last imported, even across restarts.

This behavior is opted into by touching a `.cache.json` file in the
images dir. This file is used to track the size and mtime of the image
files when they are imported.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 67291090ca)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Brad Davidson
bc309b8c15 Add CLI flag and config file for s3 bucket lookup type
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a8f0acbe52)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Brad Davidson
29b29b8e15 Add anonymous-auth to flags gated on empty authorization-config value
Also warn if default flags are not set due to user provided config

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 921e502918)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Brad Davidson
ca634926b8 Bump containerd/cri-dockerd/spegel/runc
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b15af84e4a)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Vitor Savian
8efef65aaf Fix prints that broke unit tests
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Brad Davidson
a4f870e60b Bump spegel to v0.1.1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 396f1366cc)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Robert Rose
c037d66355 Remove resources created by addon before deleting addon (#11975)
Remove the AddOn last, after any resources it created in the cluster
have been deleted and the AddOn file is removed.

Signed-off-by: Robert Rose <robert.rose@mailbox.org>
(cherry picked from commit 5e1845b7c1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-05-13 14:45:27 -07:00
Vitor Savian
b39fd93002 Update certification renew alert to 120 days
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2025-05-13 17:46:08 -03:00
Vitor Savian
a2634b8904 Add generation for kube-scheduler and kube-controller-manager certs (#12285)
* Add generation for kube-scheduler and kube-controller-manager certs

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

* Add new certs to the tests

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

* Change cert-dir to tls-cert-file and tls-private-key-file

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

* Address altName structure

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: Vitor Savian <vitor.savian@suse.com>

---------

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
Co-authored-by: Brad Davidson <brad@oatmail.org>
2025-05-13 17:46:08 -03:00
Brad Davidson
7975e4bfef Bump traefik to v2.11.24
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-21 16:12:35 -07:00
Brad Davidson
7225aa3d63 Fix handler panic when bootstrapper returned empty peer list
Panic gets rescued by the http server, and was only visible when running in debug mode, but should be handled properly.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-18 10:33:32 -07:00
Brad Davidson
bb3b1330de Add cache to spegel p2p peerinfo handler
libp2p may make a large number of bootstrap calls during startup; serve nodes from cache to avoid excessive CPU usage.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-17 21:30:52 -07:00
Brad Davidson
11042804f3 Move delegating auth middleware into common package and add MaxInFlight
Adds maximum in-flight request limits to agent join and p2p peer info
request request handlers.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-17 21:30:52 -07:00
Brad Davidson
5a1859d405 Fix chainingBootstrapper to return the first successful address list
Avoids infinite recursion when the chain includes an agentBootstrapper with a server address that points back at this node (via join address loop or external LB)

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-17 21:30:52 -07:00
Brad Davidson
ece7520bcc Fix etcd socket option config
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-11 14:28:22 -07:00
Aaron Dewes
e5a21f7a3e fix: Use proper key when signing kubelet certificate
I assume this was a mistake when copying and the kubelet key should have been used here.

This bug was introduced in #11471.

Signed-off-by: Aaron Dewes <aaron@nirvati.org>
(cherry picked from commit 147a3c0daf)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-11 14:28:22 -07:00
github-actions[bot]
196df2249c Bump Klipper Helm and Helm Controller version (#12026)
* chore: Bump Klipper Helm and Helm Controller version

Made with ❤️️ by updatecli

* chore: Bump Klipper Helm and Helm Controller version

Made with ❤️️ by updatecli

* Fix build

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit 2fdc6fab07)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-11 14:28:22 -07:00
Brad Davidson
650e431b1c Fix windows socket prefix
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f5b0d7884f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-11 14:28:22 -07:00
Brad Davidson
895bf636d7 Add ReusePort/ReuseAddr flags to etcd config
Addresses flakes in etcd CI due to the port still being in TIME_WAIT after the server is shut down between tests

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 9deef77eef)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-11 14:28:22 -07:00
Brad Davidson
f497eb0522 Bump to traefik/v2.11.22, coredns/v1.12.1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7cdf0fa688)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-11 14:28:22 -07:00
manuelbuil
93bd4bb2a1 Add error in certificate check
Signed-off-by: manuelbuil <mbuil@suse.com>
2025-04-11 13:37:37 -07:00
Derek Nola
9e5267e384 Remove double error check
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-04-09 01:01:06 -04:00
Derek Nola
37ceaca12a Align Value CLI
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-04-09 01:01:06 -04:00
Derek Nola
af9c58ec75 Mark rotate-keys as GA
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-04-09 01:01:06 -04:00
Derek Nola
e66881bd97 Implement secrets-encryption secretbox provider
- Add testlet for new provider switch
- Handle migration between providers
- Add exception for criticalcontrolargs
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-04-09 01:01:06 -04:00
Brad Davidson
0dd43a9ba9 Fix flakey etcd startup tests
Increase etcd shutdown delay to avoid "bind: address already in use" errors seen in CI. Also uses test TmpDir to ensure dir is cleaned up between tests.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-02 11:38:51 -07:00
Brad Davidson
c42cc2d43c Add tests for control-plane component arg generation
Use mocked executor to ensure the correct args are being passed to components

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 1ba19856de)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-02 11:38:51 -07:00
Brad Davidson
028bbc7745 Fix issue caused by default authorization-mode apiserver arg
Move arg-parsing helper functions into util, and use them to see if the user has set an authorization-config flag - and do not set authorization-mode if so.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit ee036f7bc9)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-02 11:38:51 -07:00
Brad Davidson
d8221573e3 Rework mock executor using gomock for call validation
Generate the mock executor with mockgen and convert existing uses of the mock executor to set it up properly.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0eeac6a622)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-04-02 11:38:51 -07:00
Brad Davidson
e8079602af Move etcd ready channel into executor
This eliminates the final channel that was being passed around in an internal struct. The ETCD management code passes in a func that can be polled until etcd is ready; the executor is responsible for polling this after etcd is started and closing the etcd ready channel at the correct time.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit d45006be66)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-03-31 17:22:44 -07:00
Brad Davidson
6f0212ab9a Fix etcd tests to use mock executor
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 72bbd676f1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-03-31 17:22:44 -07:00