Skip to content

Commit

Permalink
add more resources settings for container (#318)
Browse files Browse the repository at this point in the history
Signed-off-by: Stephanie <yangcao@redhat.com>
  • Loading branch information
yangcao77 committed Jan 21, 2021
1 parent 198daa6 commit 49ba915
Show file tree
Hide file tree
Showing 19 changed files with 474 additions and 0 deletions.
24 changes: 24 additions & 0 deletions crds/workspace.devfile.io_devworkspaces.v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4502,6 +4502,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run in its
own separated pod, instead of running as part of the
Expand Down Expand Up @@ -4605,6 +4609,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project source
code should be mounted in the component. \n Defaults
Expand Down Expand Up @@ -5225,6 +5231,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should
run in its own separated pod, instead of
Expand Down Expand Up @@ -5336,6 +5346,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down Expand Up @@ -6035,6 +6047,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run
in its own separated pod, instead of running as
Expand Down Expand Up @@ -6139,6 +6155,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down Expand Up @@ -6751,6 +6769,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should
run in its own separated pod, instead
Expand Down Expand Up @@ -6869,6 +6891,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the
project source code should be mounted
Expand Down
24 changes: 24 additions & 0 deletions crds/workspace.devfile.io_devworkspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4500,6 +4500,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run in its
own separated pod, instead of running as part of the
Expand Down Expand Up @@ -4605,6 +4609,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project source
code should be mounted in the component. \n Defaults
Expand Down Expand Up @@ -5230,6 +5236,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should
run in its own separated pod, instead of
Expand Down Expand Up @@ -5341,6 +5351,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down Expand Up @@ -6040,6 +6052,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run
in its own separated pod, instead of running as
Expand Down Expand Up @@ -6144,6 +6160,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down Expand Up @@ -6756,6 +6774,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should
run in its own separated pod, instead
Expand Down Expand Up @@ -6874,6 +6896,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the
project source code should be mounted
Expand Down
24 changes: 24 additions & 0 deletions crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4256,6 +4256,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run in its own
separated pod, instead of running as part of the main
Expand Down Expand Up @@ -4353,6 +4357,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project source
code should be mounted in the component. \n Defaults to
Expand Down Expand Up @@ -4959,6 +4965,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run
in its own separated pod, instead of running
Expand Down Expand Up @@ -5064,6 +5074,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down Expand Up @@ -5736,6 +5748,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run in its
own separated pod, instead of running as part of the
Expand Down Expand Up @@ -5837,6 +5853,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project source
code should be mounted in the component. \n Defaults
Expand Down Expand Up @@ -6432,6 +6450,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should
run in its own separated pod, instead of
Expand Down Expand Up @@ -6543,6 +6565,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down
24 changes: 24 additions & 0 deletions crds/workspace.devfile.io_devworkspacetemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4254,6 +4254,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run in its own
separated pod, instead of running as part of the main
Expand Down Expand Up @@ -4353,6 +4357,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project source
code should be mounted in the component. \n Defaults to
Expand Down Expand Up @@ -4964,6 +4970,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run
in its own separated pod, instead of running
Expand Down Expand Up @@ -5069,6 +5079,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down Expand Up @@ -5741,6 +5753,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should run in its
own separated pod, instead of running as part of the
Expand Down Expand Up @@ -5842,6 +5858,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project source
code should be mounted in the component. \n Defaults
Expand Down Expand Up @@ -6437,6 +6455,10 @@ spec:
items:
type: string
type: array
cpuLimit:
type: string
cpuRequest:
type: string
dedicatedPod:
description: "Specify if a container should
run in its own separated pod, instead of
Expand Down Expand Up @@ -6548,6 +6570,8 @@ spec:
type: string
memoryLimit:
type: string
memoryRequest:
type: string
mountSources:
description: "Toggles whether or not the project
source code should be mounted in the component.
Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/workspaces/v1alpha2/containerComponent.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ type Container struct {
// +optional
MemoryLimit string `json:"memoryLimit,omitempty"`

// +optional
MemoryRequest string `json:"memoryRequest,omitempty"`

// +optional
CpuLimit string `json:"cpuLimit,omitempty"`

// +optional
CpuRequest string `json:"cpuRequest,omitempty"`

// The command to run in the dockerimage component instead of the default one provided in the image.
//
// Defaults to an empty array, meaning use whatever is defined in the image.
Expand Down
18 changes: 18 additions & 0 deletions pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go

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

9 changes: 9 additions & 0 deletions pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go

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

Loading

0 comments on commit 49ba915

Please sign in to comment.