Skip to content

Commit 4991d2f

Browse files
committed
Resize E2E tests without limits
1 parent 25cf2a2 commit 4991d2f

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

test/e2e/common/node/pod_resize.go

+114
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,24 @@ func doPodResizeTests(f *framework.Framework) {
566566
},
567567
},
568568
},
569+
{
570+
name: "Burstable QoS pod, one container with cpu & memory requests - increase cpu request",
571+
containers: []e2epod.ResizableContainerInfo{
572+
{
573+
Name: "c1",
574+
Resources: &e2epod.ContainerResources{CPUReq: "200m", MemReq: "500Mi"},
575+
},
576+
},
577+
patchString: `{"spec":{"containers":[
578+
{"name":"c1", "resources":{"requests":{"cpu":"300m"}}}
579+
]}}`,
580+
expected: []e2epod.ResizableContainerInfo{
581+
{
582+
Name: "c1",
583+
Resources: &e2epod.ContainerResources{CPUReq: "300m", MemReq: "500Mi"},
584+
},
585+
},
586+
},
569587
{
570588
name: "Burstable QoS pod, one container with cpu requests - resize with equivalent request",
571589
containers: []e2epod.ResizableContainerInfo{
@@ -776,6 +794,102 @@ func doPodResizeTests(f *framework.Framework) {
776794
},
777795
},
778796
},
797+
{
798+
name: "Burstable QoS pod, mixed containers - scale up cpu and memory",
799+
containers: []e2epod.ResizableContainerInfo{
800+
{
801+
Name: "c1",
802+
Resources: &e2epod.ContainerResources{CPUReq: "100m", CPULim: "100m", MemReq: "100Mi", MemLim: "100Mi"},
803+
CPUPolicy: &noRestart,
804+
MemPolicy: &noRestart,
805+
},
806+
{
807+
Name: "c2",
808+
Resources: &e2epod.ContainerResources{},
809+
},
810+
},
811+
patchString: `{"spec":{"containers":[
812+
{"name":"c1", "resources":{"requests":{"cpu":"200m","memory":"200Mi"},"limits":{"cpu":"200m","memory":"200Mi"}}}
813+
]}}`,
814+
expected: []e2epod.ResizableContainerInfo{
815+
{
816+
Name: "c1",
817+
Resources: &e2epod.ContainerResources{CPUReq: "200m", CPULim: "200m", MemReq: "200Mi", MemLim: "200Mi"},
818+
CPUPolicy: &noRestart,
819+
MemPolicy: &noRestart,
820+
},
821+
{
822+
Name: "c2",
823+
Resources: &e2epod.ContainerResources{},
824+
},
825+
},
826+
},
827+
{
828+
name: "Burstable QoS pod, mixed containers - add requests",
829+
containers: []e2epod.ResizableContainerInfo{
830+
{
831+
Name: "c1",
832+
Resources: &e2epod.ContainerResources{CPUReq: "100m", CPULim: "100m", MemReq: "100Mi", MemLim: "100Mi"},
833+
CPUPolicy: &noRestart,
834+
MemPolicy: &noRestart,
835+
},
836+
{
837+
Name: "c2",
838+
Resources: &e2epod.ContainerResources{},
839+
},
840+
},
841+
patchString: `{"spec":{"containers":[
842+
{"name":"c2", "resources":{"requests":{"cpu":"100m","memory":"100Mi"}}}
843+
]}}`,
844+
expected: []e2epod.ResizableContainerInfo{
845+
{
846+
Name: "c1",
847+
Resources: &e2epod.ContainerResources{CPUReq: "100m", CPULim: "100m", MemReq: "100Mi", MemLim: "100Mi"},
848+
CPUPolicy: &noRestart,
849+
MemPolicy: &noRestart,
850+
},
851+
{
852+
Name: "c2",
853+
Resources: &e2epod.ContainerResources{CPUReq: "100m", MemReq: "100Mi"},
854+
CPUPolicy: &noRestart,
855+
MemPolicy: &noRestart,
856+
},
857+
},
858+
},
859+
{
860+
name: "Burstable QoS pod, mixed containers - add limits",
861+
containers: []e2epod.ResizableContainerInfo{
862+
{
863+
Name: "c1",
864+
Resources: &e2epod.ContainerResources{CPUReq: "100m", CPULim: "100m", MemReq: "100Mi", MemLim: "100Mi"},
865+
CPUPolicy: &noRestart,
866+
MemPolicy: &noRestart,
867+
},
868+
{
869+
Name: "c2",
870+
Resources: &e2epod.ContainerResources{CPUReq: "100m", MemReq: "100Mi"},
871+
CPUPolicy: &noRestart,
872+
MemPolicy: &noRestart,
873+
},
874+
},
875+
patchString: `{"spec":{"containers":[
876+
{"name":"c2", "resources":{"limits":{"cpu":"200m","memory":"200Mi"}}}
877+
]}}`,
878+
expected: []e2epod.ResizableContainerInfo{
879+
{
880+
Name: "c1",
881+
Resources: &e2epod.ContainerResources{CPUReq: "100m", CPULim: "100m", MemReq: "100Mi", MemLim: "100Mi"},
882+
CPUPolicy: &noRestart,
883+
MemPolicy: &noRestart,
884+
},
885+
{
886+
Name: "c2",
887+
Resources: &e2epod.ContainerResources{CPUReq: "100m", CPULim: "200m", MemReq: "100Mi", MemLim: "200Mi"},
888+
CPUPolicy: &noRestart,
889+
MemPolicy: &noRestart,
890+
},
891+
},
892+
},
779893
{
780894
name: "Guaranteed QoS pod, one container - increase CPU & memory with an extended resource",
781895
containers: []e2epod.ResizableContainerInfo{

0 commit comments

Comments
 (0)