Commit Graph

1353 Commits (4e3eda5526c4312bea6abeecba3798d05837c255)

Author SHA1 Message Date
Flavio Castelli 0dde325501 fix: use correct wasm shims names
Fix the wasm shim detection and the containerd configuration generation.

Prior to this commit, the binary and the `RuntimeType` values were not
correct.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
(cherry picked from commit 64e4f0e6e7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson eec7e227f7 Don't register embedded registry address as an upstream registry
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 091a5c8965)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson 8ef8ea53e4 Remove filtering of wildcard mirror entry
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b5a4846e9d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson 194b20d0f0 Add env var to allow spegel mirroring of `latest` tag
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 84a071a81e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Philip Laine b30b271de6 Bump spegel to v0.0.18-k3s4
Signed-off-by: Philip Laine <philip.laine@gmail.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 26feb25c40)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson 66f1109253 Move snapshot-retention to EtcdSnapshotFlags in order to support loading from config
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0b3593205a)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson 87eae0a664 Clean up snapshotDir create/exists logic
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3576ed4327)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson 1a82cf9358 Fix additional corner cases in registries handling
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b164d7a270)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson 135e76d272 Fix issue with etcd node name missing hostname
* Set ServerNodeName in snapshot CLI setup
* Raise errer if ServerNodeName ends up empty some other way
* Fix status controller to use etcd node name annotation instead of prefix checking

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 82432a2df7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson bebd5c2ffc Tweak netpol node wait logs
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 513c3416e7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Brad Davidson eef782c443 Fix NodeHosts on dual-stack clusters
* Add both dual-stack addresses to the node hosts file
* Add hostname to hosts file as alias for node name to ensure consistent resolution

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit be569f65a9)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Edgar Lee 4484760cb5 Rootless mode also bind service nodePort to host for LoadBalancer type
Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
(cherry picked from commit 8c83b5e0f3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-03-07 16:37:15 -08:00
Roberto Bonafiglia 923aac5e9f Adjust first node-ip based on configured clusterCIDR
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2024-03-06 11:13:06 +01:00
Manuel Buil f605ede835 Update klipper-lb image version
Signed-off-by: Manuel Buil <mbuil@suse.com>
2024-03-05 19:45:13 +01:00
Brad Davidson 06d6bc80b4 Fix netpol startup when flannel is disabled
Don't break out of the poll loop if we can't get the node, RBAC might not be ready yet.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-26 17:55:58 -08:00
Derek Nola 5efbb06874 Rename AgentReady to ContainerRuntimeReady for better clarity
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-02-21 13:50:47 -08:00
Derek Nola 4a787b6642 Restore original order of agent startup functions
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-02-21 13:50:47 -08:00
Brooks Newberry b3b0a25c0d
Update Kubernetes to v1.27.11 (#9491)
Signed-off-by: Brooks Newberry <brooks@newberry.com>
2024-02-15 13:14:34 -08:00
Derek Nola dd89199581
[Release-1.27] Test_UnitApplyContainerdQoSClassConfigFileIfPresent (#9441)
* [Testing]: Test_UnitApplyContainerdQoSClassConfigFileIfPresent (Created) (#8945)

Problem:
Function not tested.

Solution:
Unit test added.

Signed-off-by: Oliver Larsson <larsson.e.oliver@gmail.com>

Signed-off-by: Oliver Larsson <larsson.e.oliver@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Oliver Larsson <larsson.e.oliver@gmail.com>
2024-02-12 09:33:40 -08:00
Derek Nola ee8e1b4a1e
[Release-1.27] Enable longer http timeout requests (#9445)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-02-12 09:31:56 -08:00
Hussein Galal 1228fea1ae Update flannel to v0.24.0 and remove multiclustercidr flag (#9075)
* update flannel to v0.24.0

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* remove multiclustercidr flag

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2024-02-11 17:14:36 +01:00
Brad Davidson f6303cf14d Bump kine and set NotifyInterval to what the apiserver expects
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit de825845b2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Edgar Lee 8e343cdec1 Expose rootless containerd socket directories for external access
Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
(cherry picked from commit 0ac4c6a056)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Edgar Lee c323088120 Expose rootless state dir under ~/.rancher/k3s/rootless
Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
(cherry picked from commit 14c6c63b30)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Oleg Matskiv 6f167080f1 Don't verify the node password if the local host is not running an agent
Signed-off-by: Oleg Matskiv <oleg.matskiv@gmail.com>
(cherry picked from commit e3b237fc35)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Brad Davidson 0089772cc7 Fix ipv6 endpoint address selection for on-demand snapshots
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8224a3a7f6)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Brad Davidson c58ee7305b Fix issue with coredns node hosts controller
The nodes controller was reading from the configmaps cache, but doesn't add any handlers, so if no other controller added configmap handlers, the cache would remain empty.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 888f866dae)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Brad Davidson 10dfb09383 Add check for etcd-snapshot-dir and fix panic in Walk
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 6ec1926f88)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Brad Davidson bb26d8cf8e Retry startup snapshot reconcile
The reconcile may run before the kubelet has created the node object; retry until it succeeds

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 82e3c32c9f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Brad Davidson 9ac6519f5c Fix excessive retry on snapshot reconcile
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 4005600d4e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-10 00:49:41 -08:00
Harrison Affel d6c244c627 allow executors to define containerd and docker behavior
Signed-off-by: Harrison Affel <harrisonaffel@gmail.com>
2024-02-09 16:05:50 -03:00
Vitor Savian 4e80dccc92 Changed how lastHeartBeatTime works in the etcd condition
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-02-08 04:53:51 -03:00
Vitor Savian 0b361c37a4 Runtimes refactor using exec.LookPath
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-02-08 04:53:02 -03:00
Brad Davidson 9643d40179 Consistently handle component exit on shutdown
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-07 19:57:53 -08:00
Matt Trachier aa7a83d6ee
Bump Local Path Provisioner version (#8953) (#9427)
* chore: Bump Local Path Provisioner version
---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-07 18:24:41 -06:00
Brad Davidson 823eb2361a Bump runc and helm-controller versions
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-01 18:52:17 -08:00
Brad Davidson a14be04307 gofmt config_test.go
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-01 18:52:17 -08:00
Brad Davidson 6c64b4dd70 Fix issues with certs.d template generation
* Fix issue with bare host or IP as endpoint
* Fix issue with localhost registries not defaulting to http.
* Move the registry template prep to a separate function,
  and adds tests of that function so that we can ensure we're
  generating the correct content.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-02-01 18:52:17 -08:00
Aofei Sheng ce6158f80f Use `ipFamilyPolicy: RequireDualStack` for dual-stack kube-dns (#8984)
Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
(cherry picked from commit 8d2c40cdac)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-18 12:53:53 -08:00
Vitor Savian 5564a951d6 Error getting node in setEtcdStatusCondition
Signed-off-by: Vitor Savian <vitor.savian@suse.com>

Added retry and changed nodes for

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-01-12 18:12:16 -03:00
Derek Nola 138c5c99ae
Move proxy dialer out of init() and fix crash (#9220)
* Fixes issue where proxy support only honored server address via K3S_URL, not CLI or config.
* Fixes crash when agent proxy is enabled, but proxy env vars do not return a proxy URL for the server address (server URL is in NO_PROXY list).
* Adds tests

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-12 08:15:17 -08:00
Brad Davidson 5461c3d749 Enable network policy controller metrics
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit ab8d2f55b9)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson faf9d4466d Add embedded registry implementation
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 37e9b87f62)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 8ab374deed Add server CLI flag and config fields for embedded registry
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit ef90da5c6e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 42ea9be3e5 Propagate errors up from config.Get
Fixes crash when killing agent while waiting for config from server

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 77846d63c1)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson f81d460ee5 Move registries.yaml load into agent config
Moving it into config.Agent so that we can use or modify it outside the context of containerd setup

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 16d29398ad)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 3bc3ba5efe Pin images instead of locking layers with lease
Layer leases never did what we wanted anyways, and this is the new approved interface for ensuring that images do not get GCd

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5c99bdd9bd)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 3d4216ca46 Add runtime checking of golang version
Forces other groups packaging k3s to intentionally choose to build k3s with an unvalidated golang version

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit b297996b92)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Lex Rivera 91331c4733 Add more paths to crun runtime detection (#9086)
* add usr/local paths for crun detection

Signed-off-by: Lex Rivera <me@lex.io>
(cherry picked from commit 5fe074b540)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 053afed3ef Add support for containerd cri registry config_path
Render cri registry mirrors.x.endpoints and configs.x.tls into config_path; keep
using mirrors.x.rewrites and configs.x.auth those do not yet have an
equivalent in the new format.

The new config file format allows disabling containerd's fallback to the
default endpoint when using mirror endpoints; a new CLI flag is added to
control that behavior.

This also re-shares some code that was unnecessarily split into parallel
implementations for linux/windows versions. There is probably more work
to be done on this front but it's a good start.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c45524e662)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson fed2f71417 Fix nil map in full snapshot configmap reconcile
If a full reconcile wins the race against sync of an individual snapshot resource, or someone intentionally deletes the configmap, the data map could be nil and cause a crash.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 319dca3e82)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 31bc0ea3ce Handle logging flags when parsing kube-proxy args
Also adds a test to ensure this continues to work.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit db7091b3f6)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 6bbdf19a10 Fix the OTHER log message that prints the wrong variable
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 1e663622d2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 47cb25272b Add ServiceLB support for PodHostIPs FeatureGate
If the feature-gate is enabled, use status.hostIPs for dual-stack externalTrafficPolicy=Local support

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a27d660a24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Brad Davidson 067a6545b4 Remove GA feature-gates (#8970)
Remove KubeletCredentialProviders and JobTrackingWithFinalizers feature-gates, both of which are GA and cannot be disabled.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 231cb6ed20)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2024-01-11 16:30:56 -08:00
Vitor Savian e9b2e59ff4 Handle etcd status condition when cluster reset and disable etcd
Signed-off-by: Vitor Savian <vitor.savian@suse.com>

Set condition if node is unhealthy

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2024-01-09 12:00:37 -03:00
Manuel Buil 2ec192146d Wait for taint to be gone in the node before starting the netpol controller
Signed-off-by: Manuel Buil <mbuil@suse.com>
2024-01-09 09:59:22 +01:00
Derek Nola 5ecf175fd5
[Release-1.27] Added support for env *_PROXY variables for agent loadbalancer (#9117)
Signed-off-by: Yodo <pierre@azmed.co>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Pierre <129078893+pierre-az@users.noreply.github.com>
2024-01-06 21:45:11 -07:00
Derek Nola cf5fd5f679
Add a retry around updating a secrets-encrypt node annotations (#9124)
* Add a retry around updating a se node annotations

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-01-06 21:44:36 -07:00
Brad Davidson d01c57fd3d Allow setting default-runtime on servers
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-12-08 18:19:50 -08:00
Flavio Castelli 9e182bb798 Added runtimes for wasm/crun/nvidia
Create a generic helper function that finds extra containerd runtimes.
The code was originally inside of the nvidia container discovery file.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>

Discover the containerd shims based on runwasi that are already
available on the node.

The runtimes could have been installed either by a package manager or by
the kwasm operator.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>

The containerd configuration on a Linux system now handles the nvidia
and the WebAssembly runtimes.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>

---------

Signed-off-by: Flavio Castelli <fcastelli@suse.com>

Added runtime classes for crun/wasm/nvidia

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

Added default runtime flag

Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2023-12-08 18:19:50 -08:00
Brad Davidson 352d119434 Bump containerd/runc to v1.7.10-k3s1/v1.1.10
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-12-08 18:17:29 -08:00
Brad Davidson 1aa0eac285 Print key instead of file path in snapshot metadata log message
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-21 14:49:38 -08:00
Brad Davidson 0624d2a51f Don't apply s3 retention if S3 client failed to initialize
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-21 14:49:38 -08:00
Brad Davidson 0473839f16 Don't request metadata when listing objects
While some implementations may support it, it appears that most don't,
and some may in fact return an error if it is requested.

We already stat the object to get the metadata anyway, so this was
unnecessary if harmless on most implementations.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-21 14:49:38 -08:00
Brad Davidson f270db4bbb Reorder snapshot configmap reconcile to reduce log spew during initial startup
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-17 10:09:38 -08:00
Manuel Buil 8cf46ed4a3 Improve dualStack log
Signed-off-by: Manuel Buil <mbuil@suse.com>
2023-11-17 09:17:32 +01:00
Vitor Savian fd676a5a64
Handle nil pointer when runtime core is not ready in etcd
Signed-off-by: Vitor <vitor.savian@suse.com>
2023-11-16 15:46:46 -08:00
Brad Davidson 12e64c8b47 Go generate
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Brad Davidson a7f71bb5f2 Add jitter to client config retry
Also:
* Replaces labeled for/continue RETRY loops with wait helpers for improved readability
* Pulls secrets and nodes from cache for node password verification
* Migrate nodepassword tests to wrangler mocks for better code reuse

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Harsimran Singh Maan dd1787d026 Disable helm CRD installation for disable-helm-controller (#8702)
* Disable helm CRD installation for disable-helm-controller
    The NewContext package requires config as input which would
    require all third-party callers to update when the new go module
    is published.

    This change only affects the behaviour of installation of helm
    CRDs. Existing helm crds installed in a cluster would not be removed
    when disable-helm-controller flag is set on the server.

    Addresses #8701
* address review comments
* remove redundant check

Signed-off-by: Harsimran Singh Maan <maan.harry@gmail.com>
(cherry picked from commit abc2efdd57)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Jason Costello 7d1034ab20 Tweaked order of ingress IPs in ServiceLB (#8711)
* Tweaked order of ingress IPs in ServiceLB
    Previously, ingress IPs were only string-sorted when returned
    Sorted by IP family and string-sorted in each family as part of
    filterByIPFamily method
* Update pkg/cloudprovider/servicelb.go
* Formatting

Signed-off-by: Jason Costello <jason@hazy.com>
Co-authored-by: Brad Davidson <brad@oatmail.org>
(cherry picked from commit 07ee854914)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Brad Davidson 248a009de5 Skip initial datastore reconcile during cluster-reset
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7ecd5874d2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Brad Davidson 6f489f08f9 Fix issue with snapshot metadata configmap
Omit snapshot list configmap entries for snapshots without extra metadata; reduce log level of warnings about missing s3 metadata files.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 2088218c5f)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
chenk008 df7b982107 add agent flag disable-apiserver-lb (#8717)
* add node flag disable-agent-lb
* add agent flag disable-apiserver-lb

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: chenk008 <kongchen28@gmail.com>
(cherry picked from commit b47cbbfd42)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Oliver Larsson d7c1ac7ab6 QoS-class resource configuration
Problem:
Configuring qos-class features in containerd requres a custom containerd configuration template.

Solution:
Look for configuration files in default locations and configure containerd to use them if they exist.

Signed-off-by: Oliver Larsson <larsson.e.oliver@gmail.com>
(cherry picked from commit 30c8ad926d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:55:41 -08:00
Hussein Galal 27106c47fc
Add warning for multiclustercidr flag (#8759)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2023-11-14 01:28:09 +02:00
Vitor Savian 3377e9d809
Added etcd status condition
* Added ADR for etcd status

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

* Added etcd status condition

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

---------

Signed-off-by: Vitor <vitor.savian@suse.com>
2023-11-13 11:05:04 -08:00
Hussein Galal 575bce7689
Update traefik to fix registry value (#8789)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2023-11-06 22:55:59 +02:00
Hussein Galal 1f0c784a93
[release-1.27] Update traefik chart to v25.0.0 (#8775)
* Upgrade traefik chart to v25.0.0

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* go generate

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2023-11-03 19:10:28 +02:00
Derek Nola 40ee2725ee
Fix SystemdCgroup in templates_linux.go (#8765)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-11-02 13:41:38 -07:00
Brad Davidson b6f23014b2 Don't try to read token hash and cluster id during cluster-reset
These fields are only necessary when saving snapshots to S3, and will block restoration if attempted

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-27 15:06:50 -07:00
Brad Davidson 0f6e77feaa Manually requeue configmap reconcile when no nodes have reconciled snapshots
Silences error message from lasso - this is a normal startup condition
when no snapshots exist so we shouldn't log nasty looking errors.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-18 15:09:39 -07:00
Brad Davidson edc3fb2804 Re-enable etcd endpoint auto-sync
Removing this in 002e6c43ee regressed
control-plane-only nodes, as we rely on the etcd client to update its
endpoint list internally so that we can use it to sync the load-balancer
address list.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-18 15:09:39 -07:00
Edgar Lee 55e61670c3 Add --image-service-endpoint flag (#8279)
* Add --image-service-endpoint flag

Problem:
External container runtime can be set but image service endpoint is unchanged
and also is not exposed as a flag. This is useful for using containerd
snapshotters outside of the ones that have built-in support like
stargz-snapshotter.

Solution:
Add a flag --image-service-endpoint and also default image service endpoint to
container runtime endpoint if set.

Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
(cherry picked from commit fe18b1fce9)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-17 10:44:19 -07:00
Brad Davidson b0fb6f343e Fix CloudDualStackNodeIPs feature-gate inconsistency
Enable the feature-gate for both kubelet and cloud-controller-manager. Enabling it on only one side breaks RKE2, where feature-gates are not shared due to running in different processes.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-17 10:43:37 -07:00
Sean Yen dbea2e68c8 Windows support
Signed-off-by: Sean Yen <seanyen@microsoft.com>
2023-10-16 23:14:58 +02:00
Derek Nola 40f29507c7
Use version.Program not K3s in log (#8656)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-10-16 12:26:27 -07:00
Brad Davidson 78e57bc970 Start etcd client before ensuring self removal
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-14 00:38:56 -07:00
Brad Davidson 22f8d28ba6 Bump traefik, golang.org/x/net, google.golang.org/grpc
Fixes exposure to CVE-2023-39325

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson 52c7d6c91d Add server token hash to CR and S3
This required pulling the token hash stuff out of the cluster package, into util.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit d885162967)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson e7014cf859 Switch to managing ETCDSnapshotFile resources
Reconcile snapshot CRs instead of ConfigMap; manage ConfigMap downstream from CR list

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 550ab36ab7)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson 22c0916abd Move snapshot delete into local/s3 functions
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5cd4f69bfa)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson 1a448d4b45 Sort snapshots by time and key in tabwriter output
Fixes snapshot list coming out in non-deterministic order

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit a15b804e00)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson df0fd0de49 Store extra metadata and cluster ID for snapshots
Write the extra metadata both locally and to S3. These files are placed such that they will not be used by older versions of K3s that do not make use of them.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7464007037)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson 7375740ed4 Move s3 snapshot list functionality to s3.go
Also, don't list ONLY s3 snapshots if S3 is enabled.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 80f909d0ca)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson 487b3948a3 Consistently set snapshotFile timestamp
Attempt to use timestamp from creation or filename instead of file/object modification times

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8d47645312)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson d270e97825 Tidy s3 upload functions
Consistently refer to object keys as such, simplify error handling.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f1afe153a3)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson 7a0eecd601 Elide old snapshot data when apiserver rejects configmap with ErrRequestEntityTooLarge
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 2b0e2e8ada)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00
Brad Davidson eed767ea74 Move etcd snapshot code into separate file
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 676b00aa0e)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 11:09:28 -07:00