Skip to content

Commit

Permalink
Fix CPU FS quota and its defaulting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Apr 7, 2023
1 parent 87ee33a commit 0034707
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkg/apis/crds/karpenter.sh_machines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ spec:
with your worker nodes.
type: string
cpuCFSQuota:
default: true
description: CPUCFSQuota enables CPU CFS quota enforcement for
containers that specify CPU limits.
type: boolean
Expand Down Expand Up @@ -150,6 +151,8 @@ spec:
description: SystemReserved contains resources reserved for OS
system daemons and kernel memory.
type: object
required:
- cpuCFSQuota
type: object
machineTemplateRef:
description: MachineTemplateRef is a reference to an object that defines
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/crds/karpenter.sh_provisioners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ spec:
with your worker nodes.
type: string
cpuCFSQuota:
default: true
description: CPUCFSQuota enables CPU CFS quota enforcement for
containers that specify CPU limits.
type: boolean
Expand Down Expand Up @@ -150,6 +151,8 @@ spec:
description: SystemReserved contains resources reserved for OS
system daemons and kernel memory.
type: object
required:
- cpuCFSQuota
type: object
labels:
additionalProperties:
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/v1alpha5/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ type KubeletConfiguration struct {
ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty"`
// CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits.
// +optional
CPUCFSQuota bool `json:"cpuCFSQuota,omitempty"`
CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty"`
}

type MachineTemplateRef struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/state/informer/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *ProvisionerController) Name() string {
return "provisioner_state"
}

func (c *ProvisionerController) Reconcile(_ context.Context, _ *v1alpha5.Provisioner) (reconcile.Result, error) {
func (c *ProvisionerController) Reconcile(_ context.Context, p *v1alpha5.Provisioner) (reconcile.Result, error) {
// Something changed in the provisioner so we should re-consider consolidation
c.cluster.SetConsolidated(false)
return reconcile.Result{}, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduling/volumeusage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"fmt"

"k8s.io/csi-translation-lib"
csitranslation "k8s.io/csi-translation-lib"
"knative.dev/pkg/logging"

v1 "k8s.io/api/core/v1"
Expand Down

0 comments on commit 0034707

Please sign in to comment.