mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Disable gzip compression in core control plane components
On local networks (such as the typical connection path between control plane components) gzip compression increases CPU use and end to end p99 latency rather than decreasing it. Disable compression within the control plane components like a 1.15 cluster would be configured.
This commit is contained in:
parent
dee6de70d0
commit
33521b41d4
@ -176,6 +176,7 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Kubeconfig.DisableCompression = true
|
||||
c.Kubeconfig.ContentConfig.ContentType = o.Generic.ClientConnection.ContentType
|
||||
c.Kubeconfig.QPS = o.Generic.ClientConnection.QPS
|
||||
c.Kubeconfig.Burst = int(o.Generic.ClientConnection.Burst)
|
||||
|
@ -433,6 +433,9 @@ func buildGenericConfig(
|
||||
// cannot default to it in generic apiserver and need to explicitly
|
||||
// set it in kube-apiserver.
|
||||
genericConfig.LoopbackClientConfig.ContentConfig.ContentType = "application/vnd.kubernetes.protobuf"
|
||||
// Disable compression for self-communication, since we are going to be
|
||||
// on a fast local network
|
||||
genericConfig.LoopbackClientConfig.DisableCompression = true
|
||||
|
||||
kubeClientConfig := genericConfig.LoopbackClientConfig
|
||||
clientgoExternalClient, err := clientgoclientset.NewForConfig(kubeClientConfig)
|
||||
|
@ -391,6 +391,7 @@ func (s KubeControllerManagerOptions) Config(allControllers []string, disabledBy
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
kubeconfig.DisableCompression = true
|
||||
kubeconfig.ContentConfig.ContentType = s.Generic.ClientConnection.ContentType
|
||||
kubeconfig.QPS = s.Generic.ClientConnection.QPS
|
||||
kubeconfig.Burst = int(s.Generic.ClientConnection.Burst)
|
||||
|
@ -313,6 +313,7 @@ func createClients(config componentbaseconfig.ClientConnectionConfiguration, mas
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
kubeConfig.DisableCompression = true
|
||||
kubeConfig.AcceptContentTypes = config.AcceptContentTypes
|
||||
kubeConfig.ContentType = config.ContentType
|
||||
kubeConfig.QPS = config.QPS
|
||||
|
@ -267,6 +267,7 @@ func createKubernetesClient(kubeconfigPath string) (*kubernetes.Clientset, error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg.DisableCompression = true
|
||||
|
||||
client, err := kubernetes.NewForConfig(cfg)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user