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
Add --concurrent-ephemeralvolume-syncs flag for kube-controller-manager #102981
Add --concurrent-ephemeralvolume-syncs flag for kube-controller-manager #102981
Conversation
25d704a
to
f0ae3d1
Compare
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/label api-review |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
/triage accepted |
can someone from sig apps or storage review first? |
/milestone clear |
@@ -401,8 +401,7 @@ func startEphemeralVolumeController(ctx ControllerContext) (http.Handler, bool, | |||
if err != nil { | |||
return nil, true, fmt.Errorf("failed to start ephemeral volume controller: %v", err) | |||
} | |||
// TODO (before beta at the latest): make this configurable similar to the EndpointController | |||
go ephemeralController.Run(1 /* int(ctx.ComponentConfig.EphemeralController.ConcurrentEphemeralVolumeSyncs) */, ctx.Stop) | |||
go ephemeralController.Run(int(ctx.ComponentConfig.EphemeralController.ConcurrentEphemeralVolumeSyncs), ctx.Stop) | |||
return nil, true, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this TODO. It never made it into tracking list of opens for the feature and then of course was promptly forgotten - my bad.
Making it configurable makes sense. The rest seems to be mostly cut-and-paste from how it is done elsewhere and looks good to me.
/lgtm
/approve |
/assign @liggitt |
pkg/controller/apis/config/types.go
Outdated
@@ -84,6 +85,9 @@ type KubeControllerManagerConfiguration struct { | |||
// EndpointSliceMirroringControllerConfiguration holds configuration for | |||
// EndpointSliceMirroringController related features. | |||
EndpointSliceMirroringController endpointslicemirroringconfig.EndpointSliceMirroringControllerConfiguration | |||
// EphemeralControllerConfiguration holds configuration for EphemeralController | |||
// related features. | |||
EphemeralController ephemeralconfig.EphemeralControllerConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest naming this EphemeralVolumeController for clarity (same for the type)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also applies to the v1alpha1/types.go file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// run it in your wrapper struct of this type in its `SetDefaults_` method. | ||
func RecommendedDefaultEphemeralControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.EphemeralControllerConfiguration) { | ||
if obj.ConcurrentEphemeralVolumeSyncs == 0 { | ||
obj.ConcurrentEphemeralVolumeSyncs = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is 1 really the default we want? is there a downside to making this > 1 (most sync loops default to 5)
f0ae3d1
to
7fa0b9b
Compare
/test pull-kubernetes-integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/milestone v1.23
/approve
config API type mechanics lgtm
would like an ack on the thread safety of the controller's sync loop from @pohly
// run it in your wrapper struct of this type in its `SetDefaults_` method. | ||
func RecommendedDefaultEphemeralVolumeControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.EphemeralVolumeControllerConfiguration) { | ||
if obj.ConcurrentEphemeralVolumeSyncs == 0 { | ||
obj.ConcurrentEphemeralVolumeSyncs = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, would like an ack from @pohly that this controller's sync loop is threadsafe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It certainly was meant to be thread safe, so although that hasn't been tested at scale because it couldn't be enabled earlier, it should be fine.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, liggitt, SataQiu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
I has my LGTM (#102981 (comment)). /hold cancel |
/hold Sorry, just noticed the additional questions... let me check. |
/hold cancel |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
While many other controllers like deployment have flag
--concurrent-xxx-syncs
to set the number of workers, the ephemeral controller doesn't and just hardcoded with 1 worker. It is very slow to deal with a large number of ephemeral volumes in the cluster. This PR exports a flag--concurrent-ephemeralvolume-syncs
with the default value of 1 for the ephemeral controller.Which issue(s) this PR fixes:
xref #79169
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: