Skip to content

Commit

Permalink
Merge pull request #388 from glazychev-art/qps
Browse files Browse the repository at this point in the history
Add QPS option support
  • Loading branch information
denis-tingaikin authored Jan 19, 2024
2 parents bcd63bc + 4e8d639 commit b91fb8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 7 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021-2023 Doc.ai and/or its affiliates.
//
// Copyright (c) 2023 Cisco and/or its affiliates.
// Copyright (c) 2023-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -58,10 +58,12 @@ type Config struct {
SidecarLimitsCPU string `default:"200m" desc:"Lower bound of the NSM sidecar CPU limit (in k8s resource management units)" split_words:"true"`
SidecarRequestsMemory string `default:"40Mi" desc:"Lower bound of the NSM sidecar requests memory limits (in k8s resource management units)" split_words:"true"`
SidecarRequestsCPU string `default:"100m" desc:"Lower bound of the NSM sidecar requests CPU limits (in k8s resource management units)" split_words:"true"`
envs []corev1.EnvVar
caBundle []byte
cert tls.Certificate
once sync.Once
// QPS for 50 NSC
KubeletQPS int `default:"50" desc:"kubelet QPS config" split_words:"true"`
envs []corev1.EnvVar
caBundle []byte
cert tls.Certificate
once sync.Once
}

// Mode internal webhook mode type.
Expand Down
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021-2023 Doc.ai and/or its affiliates.
//
// Copyright (c) 2023 Cisco and/or its affiliates.
// Copyright (c) 2023-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -453,7 +453,10 @@ func main() {
s := echo.New()
s.Use(middleware.Logger())
s.Use(middleware.Recover())
_, restConfig, err := kubeutils.NewVersionedClient()
restConfig, err := kubeutils.NewClientSetConfig(
kubeutils.WithQPS(float32(conf.KubeletQPS)),
kubeutils.WithBurst(conf.KubeletQPS*2),
)
if err != nil {
logger.Fatal(err.Error())
}
Expand Down

0 comments on commit b91fb8f

Please sign in to comment.