Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix secrets-encrypt reencrypt timeout error #11385

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

dereknola
Copy link
Member

Proposed Changes

  • When running k3s secrets-encrypt reencrypt, once the reencrypt-active annotation has been written, run the actual secrets updates in a go routine, allowing the http statusOK response to return in the 10s window.
  • Fixed missing OS definitions for agents in split-role vagrantfile. Found while trying to replicate above issue.

Types of Changes

Verification

Either have a slow cluster, or use large secrets. Either way, you need to have reencryption take more than 10 seconds.

I used 1000, 100k size secrets on a single node and could hit the 10s limit (4vcpu, 4GB)

head -c 100K </dev/urandom  > file.txt && for i in {1..1000}; do echo test$i >> file.txt; kubectl create secret generic test$i --from-file=file.txt; done

With this change, k3s secrets-encrypt reencrypt should return with no errors within 1-3 seconds.

Testing

Linked Issues

#11384

User-Facing Change


Further Comments

Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola requested a review from a team as a code owner November 27, 2024 23:27
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 42.34%. Comparing base (b5e2fa7) to head (80658e6).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
pkg/server/secrets-encrypt.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11385      +/-   ##
==========================================
- Coverage   47.16%   42.34%   -4.82%     
==========================================
  Files         179      179              
  Lines       18600    18601       +1     
==========================================
- Hits         8772     7877     -895     
- Misses       8476     9518    +1042     
+ Partials     1352     1206     -146     
Flag Coverage Δ
e2etests 34.22% <0.00%> (-8.02%) ⬇️
inttests 18.82% <0.00%> (-15.89%) ⬇️
unittests 13.82% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dereknola dereknola merged commit 183f0c8 into k3s-io:master Dec 5, 2024
38 checks passed
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 9, 2024
* Add missing default OS for split server test

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

* Launch go routine and return for k3s secrets-encrypt reencrypt

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 9, 2024
* Add missing default OS for split server test

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

* Launch go routine and return for k3s secrets-encrypt reencrypt

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Dec 9, 2024
* Add missing default OS for split server test

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

* Launch go routine and return for k3s secrets-encrypt reencrypt

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola deleted the fix_se_timeotu branch December 16, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants