Skip to content

Commit

Permalink
Merge pull request #291 from craig-willis/qps
Browse files Browse the repository at this point in the history
Added QPS and Burst overrides
  • Loading branch information
craig-willis authored Sep 16, 2019
2 parents 9cd795a + d36766e commit 02a14a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
9 changes: 9 additions & 0 deletions apiserver/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func main() {
if cfg.Kubernetes.TokenPath == "" {
cfg.Kubernetes.TokenPath = "/run/secrets/kubernetes.io/serviceaccount/token"
}
if cfg.Kubernetes.QPS <= 0 {
cfg.Kubernetes.QPS = 50
}
if cfg.Kubernetes.Burst <= 0 {
cfg.Kubernetes.Burst = 100
}
if cfg.DefaultLimits.MemMax <= 0 {
cfg.DefaultLimits.MemMax = 8196 //M
}
Expand Down Expand Up @@ -144,6 +150,9 @@ func main() {
}
}

kConfig.QPS = cfg.Kubernetes.QPS
kConfig.Burst = cfg.Kubernetes.Burst

kube, err := kube.NewKubeHelper(cfg.Kubernetes.Address,
cfg.Kubernetes.Username, cfg.Kubernetes.Password, cfg.Kubernetes.TokenPath, kConfig, cfg.AuthSignInURL, cfg.AuthURL)
if err != nil {
Expand Down
22 changes: 12 additions & 10 deletions apiserver/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ type Specs struct {
Path string `json:"path"`
}
type Volume struct {
Path string `json:"path"`
Name string `json:"name"`
ReadOnly bool `json:"readOnly"`
Path string `json:"path"`
Name string `json:"name"`
ReadOnly bool `json:"readOnly"`
}

type DefaultLimits struct {
Expand All @@ -51,13 +51,15 @@ type Etcd struct {
MaxMessages int `json:"maxMessages"`
}
type Kubernetes struct {
Address string `json:"address"`
TokenPath string `json:"tokenPath"`
Username string `json:"username"`
Password string `json:"password"`
NodeSelectorName string `json:"nodeSelectorName"`
NodeSelectorValue string `json:"nodeSelectorValue"`
StorageClass string `json:"pvcStorageClass"`
Address string `json:"address"`
TokenPath string `json:"tokenPath"`
Username string `json:"username"`
Password string `json:"password"`
NodeSelectorName string `json:"nodeSelectorName"`
NodeSelectorValue string `json:"nodeSelectorValue"`
StorageClass string `json:"pvcStorageClass"`
QPS float32 `json:"qps"`
Burst int `json:"burst"`
}
type Email struct {
Host string `json:"host"`
Expand Down

0 comments on commit 02a14a6

Please sign in to comment.