Merge pull request #6375 from mytaxi/kubelet-cpu-cfs-quota

Allow users to set kubelet cpu-cfs-quota and cpu-cfs-quota-period flags
This commit is contained in:
Kubernetes Prow Robot 2019-01-27 12:58:44 -08:00 committed by GitHub
commit c1c74b7fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 0 deletions

View File

@ -179,6 +179,10 @@ type KubeletConfigSpec struct {
AuthenticationTokenWebhook *bool `json:"authenticationTokenWebhook,omitempty" flag:"authentication-token-webhook"`
// AuthenticationTokenWebhook sets the duration to cache responses from the webhook token authenticator. Default is 2m. (default 2m0s)
AuthenticationTokenWebhookCacheTTL *metav1.Duration `json:"authenticationTokenWebhookCacheTtl,omitempty" flag:"authentication-token-webhook-cache-ttl"`
// CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits
CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty" flag:"cpu-cfs-quota"`
// CPUCFSQuotaPeriod sets CPU CFS quota period value, cpu.cfs_period_us, defaults to Linux Kernel default
CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty" flag:"cpu-cfs-quota-period"`
}
// KubeProxyConfig defines the configuration for a proxy

View File

@ -179,6 +179,10 @@ type KubeletConfigSpec struct {
AuthenticationTokenWebhook *bool `json:"authenticationTokenWebhook,omitempty" flag:"authentication-token-webhook"`
// AuthenticationTokenWebhook sets the duration to cache responses from the webhook token authenticator. Default is 2m. (default 2m0s)
AuthenticationTokenWebhookCacheTTL *metav1.Duration `json:"authenticationTokenWebhookCacheTtl,omitempty" flag:"authentication-token-webhook-cache-ttl"`
// CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits
CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty" flag:"cpu-cfs-quota"`
// CPUCFSQuotaPeriod sets CPU CFS quota period value, cpu.cfs_period_us, defaults to Linux Kernel default
CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty" flag:"cpu-cfs-quota-period"`
}
// KubeProxyConfig defines the configuration for a proxy

View File

@ -3309,6 +3309,8 @@ func autoConvert_v1alpha1_KubeletConfigSpec_To_kops_KubeletConfigSpec(in *Kubele
out.RootDir = in.RootDir
out.AuthenticationTokenWebhook = in.AuthenticationTokenWebhook
out.AuthenticationTokenWebhookCacheTTL = in.AuthenticationTokenWebhookCacheTTL
out.CPUCFSQuota = in.CPUCFSQuota
out.CPUCFSQuotaPeriod = in.CPUCFSQuotaPeriod
return nil
}
@ -3386,6 +3388,8 @@ func autoConvert_kops_KubeletConfigSpec_To_v1alpha1_KubeletConfigSpec(in *kops.K
out.RootDir = in.RootDir
out.AuthenticationTokenWebhook = in.AuthenticationTokenWebhook
out.AuthenticationTokenWebhookCacheTTL = in.AuthenticationTokenWebhookCacheTTL
out.CPUCFSQuota = in.CPUCFSQuota
out.CPUCFSQuotaPeriod = in.CPUCFSQuotaPeriod
return nil
}

View File

@ -2190,6 +2190,16 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) {
*out = new(v1.Duration)
**out = **in
}
if in.CPUCFSQuota != nil {
in, out := &in.CPUCFSQuota, &out.CPUCFSQuota
*out = new(bool)
**out = **in
}
if in.CPUCFSQuotaPeriod != nil {
in, out := &in.CPUCFSQuotaPeriod, &out.CPUCFSQuotaPeriod
*out = new(v1.Duration)
**out = **in
}
return
}

View File

@ -179,6 +179,10 @@ type KubeletConfigSpec struct {
AuthenticationTokenWebhook *bool `json:"authenticationTokenWebhook,omitempty" flag:"authentication-token-webhook"`
// AuthenticationTokenWebhook sets the duration to cache responses from the webhook token authenticator. Default is 2m. (default 2m0s)
AuthenticationTokenWebhookCacheTTL *metav1.Duration `json:"authenticationTokenWebhookCacheTtl,omitempty" flag:"authentication-token-webhook-cache-ttl"`
// CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits
CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty" flag:"cpu-cfs-quota"`
// CPUCFSQuotaPeriod sets CPU CFS quota period value, cpu.cfs_period_us, defaults to Linux Kernel default
CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty" flag:"cpu-cfs-quota-period"`
}
// KubeProxyConfig defines the configuration for a proxy

View File

@ -3579,6 +3579,8 @@ func autoConvert_v1alpha2_KubeletConfigSpec_To_kops_KubeletConfigSpec(in *Kubele
out.RootDir = in.RootDir
out.AuthenticationTokenWebhook = in.AuthenticationTokenWebhook
out.AuthenticationTokenWebhookCacheTTL = in.AuthenticationTokenWebhookCacheTTL
out.CPUCFSQuota = in.CPUCFSQuota
out.CPUCFSQuotaPeriod = in.CPUCFSQuotaPeriod
return nil
}
@ -3656,6 +3658,8 @@ func autoConvert_kops_KubeletConfigSpec_To_v1alpha2_KubeletConfigSpec(in *kops.K
out.RootDir = in.RootDir
out.AuthenticationTokenWebhook = in.AuthenticationTokenWebhook
out.AuthenticationTokenWebhookCacheTTL = in.AuthenticationTokenWebhookCacheTTL
out.CPUCFSQuota = in.CPUCFSQuota
out.CPUCFSQuotaPeriod = in.CPUCFSQuotaPeriod
return nil
}

View File

@ -2261,6 +2261,16 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) {
*out = new(v1.Duration)
**out = **in
}
if in.CPUCFSQuota != nil {
in, out := &in.CPUCFSQuota, &out.CPUCFSQuota
*out = new(bool)
**out = **in
}
if in.CPUCFSQuotaPeriod != nil {
in, out := &in.CPUCFSQuotaPeriod, &out.CPUCFSQuotaPeriod
*out = new(v1.Duration)
**out = **in
}
return
}

View File

@ -2443,6 +2443,16 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) {
*out = new(v1.Duration)
**out = **in
}
if in.CPUCFSQuota != nil {
in, out := &in.CPUCFSQuota, &out.CPUCFSQuota
*out = new(bool)
**out = **in
}
if in.CPUCFSQuotaPeriod != nil {
in, out := &in.CPUCFSQuotaPeriod, &out.CPUCFSQuotaPeriod
*out = new(v1.Duration)
**out = **in
}
return
}