Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify cpuRequest for API Server #6706

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion nodeup/pkg/model/kube_apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
probeAction.Scheme = v1.URISchemeHTTPS
}

requestCPU := resource.MustParse("150m")
if b.Cluster.Spec.KubeAPIServer.CPURequest != "" {
requestCPU = resource.MustParse(b.Cluster.Spec.KubeAPIServer.CPURequest)
}

container := &v1.Container{
Name: "kube-apiserver",
Image: b.Cluster.Spec.KubeAPIServer.Image,
Expand Down Expand Up @@ -416,7 +421,7 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceCPU: resource.MustParse("150m"),
v1.ResourceCPU: requestCPU,
},
},
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ type KubeAPIServerConfig struct {
// The specified file can contain multiple keys, and the flag can be specified multiple times with different files.
// If unspecified, --tls-private-key-file is used.
ServiceAccountKeyFile []string `json:"serviceAccountKeyFile,omitempty" flag:"service-account-key-file"`

// CPURequest, cpu request compute resource for kube proxy e.g. "20m"
mikesplain marked this conversation as resolved.
Show resolved Hide resolved
CPURequest string `json:"cpuRequest,omitempty"`
}

// KubeControllerManagerConfig is the configuration for the controller
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha1/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ type KubeAPIServerConfig struct {
// The specified file can contain multiple keys, and the flag can be specified multiple times with different files.
// If unspecified, --tls-private-key-file is used.
ServiceAccountKeyFile []string `json:"serviceAccountKeyFile,omitempty" flag:"service-account-key-file"`

// CPURequest, cpu request compute resource for kube proxy e.g. "20m"
CPURequest string `json:"cpuRequest,omitempty"`
}

// KubeControllerManagerConfig is the configuration for the controller
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ type KubeAPIServerConfig struct {
// The specified file can contain multiple keys, and the flag can be specified multiple times with different files.
// If unspecified, --tls-private-key-file is used.
ServiceAccountKeyFile []string `json:"serviceAccountKeyFile,omitempty" flag:"service-account-key-file"`

// CPURequest, cpu request compute resource for kube proxy e.g. "20m"
CPURequest string `json:"cpuRequest,omitempty"`
}

// KubeControllerManagerConfig is the configuration for the controller
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.