Commit Graph

2843 Commits (0b7b7895291b60b66aa73314bb5ab0764f1f2143)

Author SHA1 Message Date
Brad Davidson 0b7b789529 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:56:32 -08:00
Harsimran Singh Maan d8c98539f1 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:56:32 -08:00
Jason Costello 91622fcedc 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:56:32 -08:00
Brad Davidson 57ed39a4b9 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:56:32 -08:00
Brad Davidson c62308b764 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:56:32 -08:00
chenk008 ce7b9ed708 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:56:32 -08:00
Oliver Larsson 564d3c8378 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:56:32 -08:00
Brad Davidson 00821f0d04 Bump kine to fix multiple issues
Ref: https://github.com/k3s-io/kine/releases/tag/v0.11.0
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 32a1efa408)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:56:32 -08:00
Thorsten Klein 6b13ee3669 add: timezone info in image
Signed-off-by: Thorsten Klein <tk@thklein.io>
(cherry picked from commit a26441613b)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-11-16 09:56:32 -08:00
Vitor Savian 32ddb34835
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-16 04:19:56 -08:00
Hussein Galal e4c55af295
Update traefik to fix registry value (#8791)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2023-11-06 21:57:31 +02:00
Hussein Galal f62d0e8e04
[release-1.25] Update traefik chart to v25.0.0 (#8777)
* 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 18:54:43 +02:00
Derek Nola ad5b443452
Fix SystemdCgroup in templates_linux.go (#8767)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-11-02 13:41:28 -07:00
Derek Nola 222805cbde
[Release-1.25] E2E Domain Drone Cleanup (#8584)
* E2E Domain Drone Cleanup (#8579)

* Cleanup inactive vm domains
* Have e2e depend on amd64 pipeline

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-10-31 16:46:16 -07:00
Brad Davidson d19260dc59 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:07:21 -07:00
Johnatas d2b3219c1a
Update to v1.25.15 (#8679) 2023-10-19 16:55:22 -07:00
Brad Davidson fe637b10b3 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 17:13:39 -07:00
Brad Davidson ecf2a7a764 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 17:13:39 -07:00
Edgar Lee b02a874d53 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:45:12 -07:00
Derek Nola ec31704c1a
Use version.Program not K3s in log (#8654)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-10-16 14:18:24 -07:00
Sean Yen 2cda8e5512 Windows support
Signed-off-by: Sean Yen <seanyen@microsoft.com>
2023-10-16 23:16:05 +02:00
Brad Davidson 1f3880c756 Start etcd client before ensuring self removal
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-14 01:15:24 -07:00
Brad Davidson 6f776a3a04 Add etcd-only/control-plane-only server test
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-14 01:15:24 -07:00
Brad Davidson 429224d364 Update kube-router package in build script
Package was changed in version script in bc332ac667 but we missed changing it here as well.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 16:23:31 -07:00
Brad Davidson fdd80188b0 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 12:28:56 -07:00
dlorenc b2d3d6cef5 Switch build target from main.go to a package. (#8342)
* Switch build target from main.go to a package.
* Dont build with vcs

Signed-off-by: Dan Lorenc <dlorenc@chainguard.dev>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit 3d25e9f66c)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson d1cd3399a6 Fix etcd snapshot integration tests
Snapshot delete/prune tests were only working because the delete command
would report success even when deleting a snapshot that didn't exist,
and the test regex was finding the snapshot name multiple times in
the list output and deleting it twice.

Snapshot restore tests seem to have expected the deployment to be rolled out
immediately, which is not a reasonable expectation.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 7c5b69ca1d)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson 3b28ac0a1f 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 12:28:56 -07:00
Brad Davidson e86e9d4fbc 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 12:28:56 -07:00
Brad Davidson e0222ac1a2 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 12:28:56 -07:00
Brad Davidson 8633571a5b 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 12:28:56 -07:00
Brad Davidson 61bbad7d9e 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 12:28:56 -07:00
Brad Davidson db4ee1b2ae 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 12:28:56 -07:00
Brad Davidson 514bcade78 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 12:28:56 -07:00
Brad Davidson a89645dfb4 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 12:28:56 -07:00
Brad Davidson a8d117dc42 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 12:28:56 -07:00
Brad Davidson e2296d8538 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 12:28:56 -07:00
Brad Davidson a0e04b3068 Add new CRD for etcd snapshots
Also adds a hack go script to print the embedded CRDs, for developer use.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 500744bb94)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson ab464cab61 Minor updates as per design review discussion
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 64107b54e4)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson eb1f2af7ab Add ADR for etcd snapshot CRD migration
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 22065affa2)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson 34d8b325f1 Bump busybox to v1.36.1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 9bb1ce1253)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson 81ec0650f8 Bump containerd to v1.7.7-k3s1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5fe4f6709a)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson 11bc2c29f6 Pass SystemdCgroup setting through to nvidia runtime options
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 0e5c760625)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson 03b4872344 Don't ignore assets in home dir if system assets exist
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 1e38b5d904)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Brad Davidson babe286e20 Disable HTTP on main etcd client port
Fixes performance issue under load, ref: https://github.com/etcd-io/etcd/issues/15402 and https://github.com/kubernetes/kubernetes/pull/118460

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 8c73fd670b)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-13 12:28:56 -07:00
Roberto Bonafiglia 722fca3b82 Use IPv6 in case is the first configured IP with dualstack
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2023-10-13 10:25:34 +02:00
Derek Nola 0816812c99
[Release-1.25] Clear remove annotations on cluster reset (#8589)
* Use admin kubeconfig instead of supervisor for etcd snapshot CLI

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

* Skip creating CRDs and setting up event recorder for CLI controller context

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

* Don't export functions not needed outside the etcd package

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

* Reorganize Driver interface and etcd driver to avoid passing context and config into most calls

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

* Clear remove annotations on cluster reset; refuse to delete last member from cluster

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

---------

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Co-authored-by: Brad Davidson <brad.davidson@rancher.com>
2023-10-12 08:11:34 -07:00
Derek Nola 6afee00eaf
Server Token Rotation (#8578)
* Consolidate NewCertCommands
* Add support for user defined new token
* Add E2E testlets
* Ensure agent token also changes

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-10-10 09:45:27 -07:00
Roberto Bonafiglia 07646f6877 Fixed tailscale node IP dualstack mode in case of IPv4 only node
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
2023-10-10 10:38:14 +02:00
Vitor Savian 8bfd2389fe
Added advertise address integration test
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
2023-10-05 17:11:14 -03:00