Brad Davidson
18c072e595
Update tests
...
Also add an ordinal to subtests so its easier to figure out which one is failing
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-01-23 21:27:58 -08:00
Brad Davidson
be4b1bcdba
Fix local password validation when bind-address is set
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit d0ea741b13 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-01-15 15:49:47 -08:00
Brad Davidson
014f1a058f
Add tests for supervisor request handlers
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit f345697c0a )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-01-10 16:11:04 -08:00
Brad Davidson
fcc5f32cfe
Remove unused Certificate field from Node struct
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 5b1d57f7b9 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-01-10 16:11:04 -08:00
Brad Davidson
0d62e7308d
Move request handlers out of server package
...
The servers package, and router.go in particular, had become quite
large. Address this by moving some things out to separate packages:
* http request handlers all move to pkg/server/handlers.
* node password bootstrap auth handler goes into pkg/nodepassword with
the other nodepassword code.
While we're at it, also be more consistent about calling variables that
hold a config.Control struct or reference `control` instead of `config` or `server`.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 2e4e7cf2c1 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-01-10 16:11:04 -08:00
Brad Davidson
f151d1c38b
Return apiserver addresses from both etcd and endpoints
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 168b344d1d )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-12-10 17:02:07 -08:00
Brad Davidson
89593847d7
Use helper to set consistent rest.Config rate limits and timeouts
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 71918e0d69 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-12-10 17:02:07 -08:00
Derek Nola
74669307c6
Fix secrets-encrypt reencrypt timeout error ( #11441 )
...
* Add missing default OS for split server test
* Launch go routine and return for k3s secrets-encrypt reencrypt
---------
Signed-off-by: Derek Nola <derek.nola@suse.com >
2024-12-09 15:59:23 -08:00
Brad Davidson
6131cd9abf
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:39 -07:00
Brad Davidson
507f728491
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:23 -07:00
Derek Nola
e562d883d6
Remove secrets encryption controller ( #10612 )
...
* Remove secrets encryption controller
Signed-off-by: Derek Nola <derek.nola@suse.com >
2024-09-04 11:50:40 -07:00
Brad Davidson
7190c74acc
[release-1.30] Backports for 2024-08 release cycle ( #10664 )
...
* 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:00 -07:00
Katherine Door
7a0ea3c953
Add write-kubeconfig-group flag to server ( #9233 )
...
* Add write-kubeconfig-group flag to server
* update kubectl unable to read config message for kubeconfig mode/group
Signed-off-by: Katherine Pata <me@kitty.sh >
2024-05-30 23:45:34 -07:00
Brad Davidson
f8e0648304
Convert remaining http handlers over to use util.SendError
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-05-28 16:24:57 -07:00
Brad Davidson
3d14092f76
Fix issue with k3s-etcd informers not starting
...
Start shared informer caches when k3s-etcd controller wins leader election. Previously, these were only started when the main k3s apiserver controller won an election. If the leaders ended up going to different nodes, some informers wouldn't be started
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-05-28 15:48:15 -07:00
huangzy
6fcaad553d
allow helm controller set owner reference
...
Signed-off-by: huangzy <huangzynn@outlook.com >
2024-05-24 12:44:10 -07:00
Brad Davidson
5a0162d8ee
Drop check for legacy traefik v1 chart
...
We have been bundling traefik v2 for three years, its time to drop the legacy chart check
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-05-23 14:13:13 -07:00
Hussein Galal
144f5ad333
Kubernetes V1.30.0-k3s1 ( #10063 )
...
* kubernetes 1.30.0-k3s1
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Update go version to v1.22.2
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update dynamiclistener and helm-controller
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update go in go.mod to 1.22.2
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update go in Dockerfiles
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update cri-dockerd
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Add proctitle package with linux and windows constraints
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* go mod tidy
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Fixing setproctitle function
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update dynamiclistener to v0.6.0-rc1
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
---------
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
2024-05-06 19:42:27 +03:00
Brad Davidson
94e29e2ef5
Make /db/info available anonymously from localhost
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-04-22 19:34:43 -07:00
Brad Davidson
08f1022663
Don't log 'apiserver disabled' error sent by etcd-only nodes
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-04-09 15:36:33 -07:00
Brad Davidson
fe465cc832
Move etcd snapshot management CLI to request/response
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-04-09 15:21:26 -07:00
Derek Nola
14f54d0b26
Transition from deprecated pointer library to ptr ( #9801 )
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2024-03-28 10:07:02 -07:00
Brad Davidson
7a2a2d075c
Move error response generation code into util
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-26 15:17:15 -07:00
Oleg Matskiv
e3b237fc35
Don't verify the node password if the local host is not running an agent
...
Signed-off-by: Oleg Matskiv <oleg.matskiv@gmail.com >
2024-02-09 14:21:43 -08:00
Derek Nola
fa11850563
Readd k3s secrets-encrypt rotate-keys with correct support for KMSv2 GA ( #9340 )
...
* Reorder copy order for caching
* Enable longer http timeout requests
Signed-off-by: Derek Nola <derek.nola@suse.com >
* Setup reencrypt controller to run on all apiserver nodes
* Fix reencryption for disabling secrets encryption, reenable drone tests
2024-02-09 11:37:37 -08:00
Brad Davidson
c635818956
Bump runc and helm-controller versions
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-02-01 18:51:51 -08:00
Aofei Sheng
8d2c40cdac
Use ipFamilyPolicy: RequireDualStack for dual-stack kube-dns ( #8984 )
...
Signed-off-by: Aofei Sheng <aofei@aofeisheng.com >
2024-01-09 00:44:03 +02:00
Derek Nola
aca1c2fd11
Add a retry around updating a secrets-encrypt node annotations ( #9039 )
...
* Add a retry around updating a se node annotations
Signed-off-by: Derek Nola <derek.nola@suse.com >
2024-01-02 12:21:37 -08:00
Brad Davidson
6c544a4679
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:53:28 -08:00
Harsimran Singh Maan
abc2efdd57
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 >
2023-11-15 14:35:31 -08:00
Brad Davidson
7464007037
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 >
2023-10-12 15:04:45 -07:00
Derek Nola
dface01de8
Server Token Rotation ( #8265 )
...
* Consolidate NewCertCommands
* Add support for user defined new token
* Add E2E testlets
Signed-off-by: Derek Nola <derek.nola@suse.com >
* Ensure agent token also changes
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-10-09 10:58:49 -07:00
Manuel Buil
0b23a478cf
ipFamilyPolicy:PreferDualStack for coredns and metrics-server
...
Signed-off-by: Manuel Buil <mbuil@suse.com >
2023-09-29 10:10:43 +02:00
Brad Davidson
a3c52d60a5
Skip creating CRDs and setting up event recorder for CLI controller context
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-09-25 11:54:23 -07:00
Derek Nola
2cb7023660
Use already imported semver, bump kine
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-08-25 14:17:00 -06:00
Derek Nola
f2d0c5409a
Add check for support on cp nodes
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-08-25 14:17:00 -06:00
Derek Nola
51f1a5a0ab
Review comments and fixes
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-08-25 14:17:00 -06:00
Derek Nola
42c2ac95e2
CLI + Backend for Secrets Encryption v3
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-08-25 14:17:00 -06:00
Brad Davidson
aa76942d0f
Add FilterCN function to prevent SAN Stuffing
...
Wire up a node watch to collect addresses of server nodes, to prevent adding unauthorized SANs to the dynamiclistener cert.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-08-02 11:15:39 -07:00
Derek Nola
0b18a65d4f
Revert "Warn that v1.28 will deprecate reencrypt/prepare ( #7848 )"
...
This reverts commit 4ab01f3941 .
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-07-14 12:38:33 -07:00
Derek Nola
8405813c12
Fix rootless node password ( #7887 )
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-07-07 09:14:49 -07:00
Derek Nola
4ab01f3941
Warn that v1.28 will deprecate reencrypt/prepare ( #7848 )
...
* Warn that v1.28 will deprecate reencrypt/prepare
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-07-06 12:34:51 -07:00
Daishan Peng
ce3443ddf6
Allow k3s to customize apiServerPort on helm-controller
...
Signed-off-by: Daishan Peng <daishan@acorn.io >
2023-07-03 11:09:49 -07:00
Vitor Savian
0809187cff
Adding cli to custom klipper helm image ( #7682 )
...
Adding cli to custom klipper helm image
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
2023-06-28 15:31:58 +00:00
Brad Davidson
5170bc5a04
Improve error response logging
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-06-05 15:31:04 -07:00
Brad Davidson
45d8c1a1a2
Soft-fail on node password verification if the secret cannot be created
...
Allows nodes to join the cluster during a webhook outage. This also
enhances auditability by creating Kubernetes events for the deferred
verification.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-06-05 15:31:04 -07:00
Derek Nola
b0188f5a13
Test Coverage Reports for E2E tests ( #7526 )
...
* Move coverage writer into agent and server
* Add coverage report to E2E PR tests
* Add codecov upload to drone
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-06-05 14:15:17 -07:00
Brad Davidson
64a5f58f1e
Create new kubeconfig for supervisor use
...
Only actual admin actions should use the admin kubeconfig; everything done by the supervisor/deploy/helm controllers will now use a distinct account for audit purposes.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-05-30 18:15:11 -07:00
Brad Davidson
8748813a61
Use distinct clients for supervisor, deploy, and helm controllers
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-05-30 18:15:11 -07:00
Brad Davidson
8f450bafe1
Bump helm-controller version for repo auth/ca support
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-05-10 14:57:37 -07:00