Skip to content

Commit

Permalink
Merge pull request #6706 from granular-ryanbonham/apiserver_cpurequest
Browse files Browse the repository at this point in the history
Add ability to specify cpuRequest for API Server
  • Loading branch information
k8s-ci-robot committed Apr 10, 2019
2 parents 9661c57 + 415472a commit b91db4f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
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 @@ -417,6 +417,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 api server. Defaults to "150m"
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 @@ -417,6 +417,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 api server. Defaults to "150m"
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 @@ -417,6 +417,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 api server. Defaults to "150m"
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.

0 comments on commit b91db4f

Please sign in to comment.