mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Implement simple endpoint slice batching
This commit is contained in:
@@ -9,6 +9,7 @@ go_library(
|
||||
],
|
||||
importpath = "k8s.io/kubernetes/pkg/controller/endpointslice/config",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
|
||||
@@ -16,6 +16,10 @@ limitations under the License.
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// EndpointSliceControllerConfiguration contains elements describing
|
||||
// EndpointSliceController.
|
||||
type EndpointSliceControllerConfiguration struct {
|
||||
@@ -28,4 +32,11 @@ type EndpointSliceControllerConfiguration struct {
|
||||
// added to an EndpointSlice. More endpoints per slice will result in fewer
|
||||
// and larger endpoint slices, but larger resources.
|
||||
MaxEndpointsPerSlice int32
|
||||
|
||||
// EndpointUpdatesBatchPeriod can be used to batch endpoint updates.
|
||||
// All updates of endpoint triggered by pod change will be delayed by up to
|
||||
// 'EndpointUpdatesBatchPeriod'. If other pods in the same endpoint change
|
||||
// in that period, they will be batched to a single endpoint update.
|
||||
// Default 0 value means that each pod update triggers an endpoint update.
|
||||
EndpointUpdatesBatchPeriod metav1.Duration
|
||||
}
|
||||
|
||||
@@ -61,12 +61,14 @@ func RegisterConversions(s *runtime.Scheme) error {
|
||||
func autoConvert_v1alpha1_EndpointSliceControllerConfiguration_To_config_EndpointSliceControllerConfiguration(in *v1alpha1.EndpointSliceControllerConfiguration, out *config.EndpointSliceControllerConfiguration, s conversion.Scope) error {
|
||||
out.ConcurrentServiceEndpointSyncs = in.ConcurrentServiceEndpointSyncs
|
||||
out.MaxEndpointsPerSlice = in.MaxEndpointsPerSlice
|
||||
out.EndpointUpdatesBatchPeriod = in.EndpointUpdatesBatchPeriod
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_config_EndpointSliceControllerConfiguration_To_v1alpha1_EndpointSliceControllerConfiguration(in *config.EndpointSliceControllerConfiguration, out *v1alpha1.EndpointSliceControllerConfiguration, s conversion.Scope) error {
|
||||
out.ConcurrentServiceEndpointSyncs = in.ConcurrentServiceEndpointSyncs
|
||||
out.MaxEndpointsPerSlice = in.MaxEndpointsPerSlice
|
||||
out.EndpointUpdatesBatchPeriod = in.EndpointUpdatesBatchPeriod
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ package config
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EndpointSliceControllerConfiguration) DeepCopyInto(out *EndpointSliceControllerConfiguration) {
|
||||
*out = *in
|
||||
out.EndpointUpdatesBatchPeriod = in.EndpointUpdatesBatchPeriod
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user