Skip to content

Commit 49ba915

Browse files
authored
add more resources settings for container (#318)
Signed-off-by: Stephanie <[email protected]>
1 parent 198daa6 commit 49ba915

19 files changed

+474
-0
lines changed

crds/workspace.devfile.io_devworkspaces.v1beta1.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4502,6 +4502,10 @@ spec:
45024502
items:
45034503
type: string
45044504
type: array
4505+
cpuLimit:
4506+
type: string
4507+
cpuRequest:
4508+
type: string
45054509
dedicatedPod:
45064510
description: "Specify if a container should run in its
45074511
own separated pod, instead of running as part of the
@@ -4605,6 +4609,8 @@ spec:
46054609
type: string
46064610
memoryLimit:
46074611
type: string
4612+
memoryRequest:
4613+
type: string
46084614
mountSources:
46094615
description: "Toggles whether or not the project source
46104616
code should be mounted in the component. \n Defaults
@@ -5225,6 +5231,10 @@ spec:
52255231
items:
52265232
type: string
52275233
type: array
5234+
cpuLimit:
5235+
type: string
5236+
cpuRequest:
5237+
type: string
52285238
dedicatedPod:
52295239
description: "Specify if a container should
52305240
run in its own separated pod, instead of
@@ -5336,6 +5346,8 @@ spec:
53365346
type: string
53375347
memoryLimit:
53385348
type: string
5349+
memoryRequest:
5350+
type: string
53395351
mountSources:
53405352
description: "Toggles whether or not the project
53415353
source code should be mounted in the component.
@@ -6035,6 +6047,10 @@ spec:
60356047
items:
60366048
type: string
60376049
type: array
6050+
cpuLimit:
6051+
type: string
6052+
cpuRequest:
6053+
type: string
60386054
dedicatedPod:
60396055
description: "Specify if a container should run
60406056
in its own separated pod, instead of running as
@@ -6139,6 +6155,8 @@ spec:
61396155
type: string
61406156
memoryLimit:
61416157
type: string
6158+
memoryRequest:
6159+
type: string
61426160
mountSources:
61436161
description: "Toggles whether or not the project
61446162
source code should be mounted in the component.
@@ -6751,6 +6769,10 @@ spec:
67516769
items:
67526770
type: string
67536771
type: array
6772+
cpuLimit:
6773+
type: string
6774+
cpuRequest:
6775+
type: string
67546776
dedicatedPod:
67556777
description: "Specify if a container should
67566778
run in its own separated pod, instead
@@ -6869,6 +6891,8 @@ spec:
68696891
type: string
68706892
memoryLimit:
68716893
type: string
6894+
memoryRequest:
6895+
type: string
68726896
mountSources:
68736897
description: "Toggles whether or not the
68746898
project source code should be mounted

crds/workspace.devfile.io_devworkspaces.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4500,6 +4500,10 @@ spec:
45004500
items:
45014501
type: string
45024502
type: array
4503+
cpuLimit:
4504+
type: string
4505+
cpuRequest:
4506+
type: string
45034507
dedicatedPod:
45044508
description: "Specify if a container should run in its
45054509
own separated pod, instead of running as part of the
@@ -4605,6 +4609,8 @@ spec:
46054609
type: string
46064610
memoryLimit:
46074611
type: string
4612+
memoryRequest:
4613+
type: string
46084614
mountSources:
46094615
description: "Toggles whether or not the project source
46104616
code should be mounted in the component. \n Defaults
@@ -5230,6 +5236,10 @@ spec:
52305236
items:
52315237
type: string
52325238
type: array
5239+
cpuLimit:
5240+
type: string
5241+
cpuRequest:
5242+
type: string
52335243
dedicatedPod:
52345244
description: "Specify if a container should
52355245
run in its own separated pod, instead of
@@ -5341,6 +5351,8 @@ spec:
53415351
type: string
53425352
memoryLimit:
53435353
type: string
5354+
memoryRequest:
5355+
type: string
53445356
mountSources:
53455357
description: "Toggles whether or not the project
53465358
source code should be mounted in the component.
@@ -6040,6 +6052,10 @@ spec:
60406052
items:
60416053
type: string
60426054
type: array
6055+
cpuLimit:
6056+
type: string
6057+
cpuRequest:
6058+
type: string
60436059
dedicatedPod:
60446060
description: "Specify if a container should run
60456061
in its own separated pod, instead of running as
@@ -6144,6 +6160,8 @@ spec:
61446160
type: string
61456161
memoryLimit:
61466162
type: string
6163+
memoryRequest:
6164+
type: string
61476165
mountSources:
61486166
description: "Toggles whether or not the project
61496167
source code should be mounted in the component.
@@ -6756,6 +6774,10 @@ spec:
67566774
items:
67576775
type: string
67586776
type: array
6777+
cpuLimit:
6778+
type: string
6779+
cpuRequest:
6780+
type: string
67596781
dedicatedPod:
67606782
description: "Specify if a container should
67616783
run in its own separated pod, instead
@@ -6874,6 +6896,8 @@ spec:
68746896
type: string
68756897
memoryLimit:
68766898
type: string
6899+
memoryRequest:
6900+
type: string
68776901
mountSources:
68786902
description: "Toggles whether or not the
68796903
project source code should be mounted

crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4256,6 +4256,10 @@ spec:
42564256
items:
42574257
type: string
42584258
type: array
4259+
cpuLimit:
4260+
type: string
4261+
cpuRequest:
4262+
type: string
42594263
dedicatedPod:
42604264
description: "Specify if a container should run in its own
42614265
separated pod, instead of running as part of the main
@@ -4353,6 +4357,8 @@ spec:
43534357
type: string
43544358
memoryLimit:
43554359
type: string
4360+
memoryRequest:
4361+
type: string
43564362
mountSources:
43574363
description: "Toggles whether or not the project source
43584364
code should be mounted in the component. \n Defaults to
@@ -4959,6 +4965,10 @@ spec:
49594965
items:
49604966
type: string
49614967
type: array
4968+
cpuLimit:
4969+
type: string
4970+
cpuRequest:
4971+
type: string
49624972
dedicatedPod:
49634973
description: "Specify if a container should run
49644974
in its own separated pod, instead of running
@@ -5064,6 +5074,8 @@ spec:
50645074
type: string
50655075
memoryLimit:
50665076
type: string
5077+
memoryRequest:
5078+
type: string
50675079
mountSources:
50685080
description: "Toggles whether or not the project
50695081
source code should be mounted in the component.
@@ -5736,6 +5748,10 @@ spec:
57365748
items:
57375749
type: string
57385750
type: array
5751+
cpuLimit:
5752+
type: string
5753+
cpuRequest:
5754+
type: string
57395755
dedicatedPod:
57405756
description: "Specify if a container should run in its
57415757
own separated pod, instead of running as part of the
@@ -5837,6 +5853,8 @@ spec:
58375853
type: string
58385854
memoryLimit:
58395855
type: string
5856+
memoryRequest:
5857+
type: string
58405858
mountSources:
58415859
description: "Toggles whether or not the project source
58425860
code should be mounted in the component. \n Defaults
@@ -6432,6 +6450,10 @@ spec:
64326450
items:
64336451
type: string
64346452
type: array
6453+
cpuLimit:
6454+
type: string
6455+
cpuRequest:
6456+
type: string
64356457
dedicatedPod:
64366458
description: "Specify if a container should
64376459
run in its own separated pod, instead of
@@ -6543,6 +6565,8 @@ spec:
65436565
type: string
65446566
memoryLimit:
65456567
type: string
6568+
memoryRequest:
6569+
type: string
65466570
mountSources:
65476571
description: "Toggles whether or not the project
65486572
source code should be mounted in the component.

crds/workspace.devfile.io_devworkspacetemplates.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4254,6 +4254,10 @@ spec:
42544254
items:
42554255
type: string
42564256
type: array
4257+
cpuLimit:
4258+
type: string
4259+
cpuRequest:
4260+
type: string
42574261
dedicatedPod:
42584262
description: "Specify if a container should run in its own
42594263
separated pod, instead of running as part of the main
@@ -4353,6 +4357,8 @@ spec:
43534357
type: string
43544358
memoryLimit:
43554359
type: string
4360+
memoryRequest:
4361+
type: string
43564362
mountSources:
43574363
description: "Toggles whether or not the project source
43584364
code should be mounted in the component. \n Defaults to
@@ -4964,6 +4970,10 @@ spec:
49644970
items:
49654971
type: string
49664972
type: array
4973+
cpuLimit:
4974+
type: string
4975+
cpuRequest:
4976+
type: string
49674977
dedicatedPod:
49684978
description: "Specify if a container should run
49694979
in its own separated pod, instead of running
@@ -5069,6 +5079,8 @@ spec:
50695079
type: string
50705080
memoryLimit:
50715081
type: string
5082+
memoryRequest:
5083+
type: string
50725084
mountSources:
50735085
description: "Toggles whether or not the project
50745086
source code should be mounted in the component.
@@ -5741,6 +5753,10 @@ spec:
57415753
items:
57425754
type: string
57435755
type: array
5756+
cpuLimit:
5757+
type: string
5758+
cpuRequest:
5759+
type: string
57445760
dedicatedPod:
57455761
description: "Specify if a container should run in its
57465762
own separated pod, instead of running as part of the
@@ -5842,6 +5858,8 @@ spec:
58425858
type: string
58435859
memoryLimit:
58445860
type: string
5861+
memoryRequest:
5862+
type: string
58455863
mountSources:
58465864
description: "Toggles whether or not the project source
58475865
code should be mounted in the component. \n Defaults
@@ -6437,6 +6455,10 @@ spec:
64376455
items:
64386456
type: string
64396457
type: array
6458+
cpuLimit:
6459+
type: string
6460+
cpuRequest:
6461+
type: string
64406462
dedicatedPod:
64416463
description: "Specify if a container should
64426464
run in its own separated pod, instead of
@@ -6548,6 +6570,8 @@ spec:
65486570
type: string
65496571
memoryLimit:
65506572
type: string
6573+
memoryRequest:
6574+
type: string
65516575
mountSources:
65526576
description: "Toggles whether or not the project
65536577
source code should be mounted in the component.

pkg/apis/workspaces/v1alpha2/containerComponent.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ type Container struct {
2929
// +optional
3030
MemoryLimit string `json:"memoryLimit,omitempty"`
3131

32+
// +optional
33+
MemoryRequest string `json:"memoryRequest,omitempty"`
34+
35+
// +optional
36+
CpuLimit string `json:"cpuLimit,omitempty"`
37+
38+
// +optional
39+
CpuRequest string `json:"cpuRequest,omitempty"`
40+
3241
// The command to run in the dockerimage component instead of the default one provided in the image.
3342
//
3443
// Defaults to an empty array, meaning use whatever is defined in the image.

pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)