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

[master] Add etcd extra args support for K3s #4463

Merged
merged 3 commits into from
Nov 12, 2021

Conversation

Oats87
Copy link
Member

@Oats87 Oats87 commented Nov 11, 2021

Proposed Changes

Add etcd extra args support for K3s

Types of Changes

CLI/Etcd changes

Verification

Run etcd with custom args, check to see that it actually runs with these custom args

Linked Issues

#4462

User-Facing Change

K3s now supports `--etcd-arg` to specify additional etcd arguments for running etcd

Further Comments

@Oats87 Oats87 requested a review from a team as a code owner November 11, 2021 17:42
@briandowns
Copy link
Contributor

This seems reasonable and very straightforward but I'm a little concerned with what values are passed in and how we handle them. ie should we do some introspection to prevent obvious foot-gun situations? Have we tested this for basic functionality? We should probably add some additional integration tests for this before merging given the ramifications of the change.

@Oats87 Oats87 force-pushed the etcd-extra-args branch 9 times, most recently from 0aae168 to ec2111f Compare November 11, 2021 23:24
@Oats87 Oats87 changed the title WIP: Add etcd extra args support for K3s Add etcd extra args support for K3s Nov 11, 2021
Copy link
Contributor

@galal-hussein galal-hussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Oats87 Oats87 changed the title Add etcd extra args support for K3s [master] Add etcd extra args support for K3s Nov 11, 2021
Signed-off-by: Chris Kim <oats87g@gmail.com>
Signed-off-by: Chris Kim <oats87g@gmail.com>
@Oats87 Oats87 force-pushed the etcd-extra-args branch 2 times, most recently from 6029d81 to 49d91a7 Compare November 12, 2021 04:13
Signed-off-by: Chris Kim <oats87g@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2021

Codecov Report

Merging #4463 (7a2cdc8) into master (41ff19d) will decrease coverage by 0.03%.
The diff coverage is 9.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4463      +/-   ##
==========================================
- Coverage   12.07%   12.04%   -0.04%     
==========================================
  Files         135      135              
  Lines        9148     9175      +27     
==========================================
  Hits         1105     1105              
- Misses       7808     7834      +26     
- Partials      235      236       +1     
Flag Coverage Δ
inttests 0.76% <0.00%> (-0.01%) ⬇️
unittests 11.60% <9.67%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
pkg/apis/k3s.cattle.io/v1/zz_generated_deepcopy.go 0.00% <ø> (ø)
pkg/cli/cmds/server.go 0.00% <ø> (ø)
pkg/cli/server/server.go 0.00% <0.00%> (ø)
pkg/cluster/bootstrap.go 0.00% <0.00%> (ø)
pkg/daemons/config/types.go 50.00% <ø> (ø)
pkg/deploy/zz_generated_bindata.go 0.00% <ø> (ø)
pkg/static/zz_generated_bindata.go 0.00% <ø> (ø)
pkg/daemons/executor/executor.go 11.36% <3.70%> (-16.42%) ⬇️
pkg/daemons/executor/etcd.go 37.03% <100.00%> (ø)
pkg/etcd/etcd.go 16.62% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41ff19d...7a2cdc8. Read the comment docs.

@Oats87 Oats87 merged commit f18b325 into k3s-io:master Nov 12, 2021
@Oats87
Copy link
Member Author

Oats87 commented Nov 15, 2021

How to Test:

This PR/enhancement adds --etcd-arg functionality to K3s.

One way to test this is to run K3s like:

k3s server --etcd-arg quota-backend-bytes=858993459 --etcd-arg "experimental-initial-corrupt-check=true"  --etcd-arg "log-rotation-config-json={\"maxsize\": 100, \"maxage\": 0, \"maxbackups\": 0, \"localtime\": false, \"compress\": false}" --etcd-arg "log-outputs=[default]"

then, inspect the logs it spits out looking for the fact that it's using 858993459 as the quota backend size, and checking the various other things that are set.

Any of the etcd parameters here: https://etcd.io/docs/v3.5/op-guide/configuration/ are settable via the arg, with the notable exception of the duration-type arguments as there is a known issue with setting those via config file.

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.

None yet

6 participants