Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ type WorkspaceConfig struct {
// the value "0" should be used. By default, the memory limit is 128Mi and the memory request is 64Mi.
// No CPU limit or request is added by default.
DefaultContainerResources *corev1.ResourceRequirements `json:"defaultContainerResources,omitempty"`
// ContainerResourceCaps defines the maximum resource requirements enforced for all
// workspace containers. If a container specifies higher limits or requests, they
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tolusha, if a container does not specify limits / requests the maximums from DWOC will be used, right?
This is an important nuance that should be documented at the specification level, I believe.
@cgruver could you confirm that this is a requested behaviour?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantically when I hear ContainerResourceCaps, to me it sounds like only an upper limit, and not a default if limits / requests are not defined in the devfile.

If we want defaults applied when limits/requests are not defined in the devfile, IMHO the DefaultContainerResources should be the field for that

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a container does not specify limits / requests the maximums from DWOC will be used,

I would rather not have this functionality, since right now, DefaultContainerResources will be used instead which IMHO makes more sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkwon17
Updated

// will be capped at these maximum values. This is not applied to initContainers or
// the projectClone container.
ContainerResourceCaps *corev1.ResourceRequirements `json:"containerResourceCaps,omitempty"`
// PodAnnotations defines the metadata.annotations for DevWorkspace pods created by the DevWorkspace Operator.
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
// RuntimeClassName defines the spec.runtimeClassName for DevWorkspace pods created by the DevWorkspace Operator.
Expand Down
5 changes: 5 additions & 0 deletions apis/controller/v1alpha1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions controllers/workspace/devworkspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ func (r *DevWorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request
workspace.Config.Workspace.ContainerSecurityContext,
workspace.Config.Workspace.ImagePullPolicy,
workspace.Config.Workspace.DefaultContainerResources,
workspace.Config.Workspace.ContainerResourceCaps,
workspace.Config.Workspace.PostStartTimeout,
postStartDebugTrapSleepDuration,
)
Expand Down

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

63 changes: 63 additions & 0 deletions deploy/deployment/kubernetes/combined.yaml

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

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

63 changes: 63 additions & 0 deletions deploy/deployment/openshift/combined.yaml

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

Loading
Loading