Skip to content

Commit 8b55822

Browse files
authored
Add resource limits when launching IMDS test container
Add resource limits when launching IMDS test container (closes #20)
2 parents d6312cf + 21b2c7a commit 8b55822

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/managed-kubernetes-auditing-toolkit/eks/imds/imds_tester.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"syscall"
1212
"time"
1313

14+
"k8s.io/apimachinery/pkg/api/resource"
1415
v1 "k8s.io/api/core/v1"
1516
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1617
"k8s.io/apimachinery/pkg/util/wait"
@@ -102,6 +103,16 @@ func (m *ImdsTester) runCommandInPodAndGetLogs(podName string, command []string)
102103
Name: podName,
103104
Image: "curlimages/curl:8.00.1",
104105
Command: command,
106+
Resources: v1.ResourceRequirements{
107+
Requests: v1.ResourceList{
108+
v1.ResourceCPU: resource.MustParse("500m"),
109+
v1.ResourceMemory: resource.MustParse("128Mi"),
110+
},
111+
Limits: v1.ResourceList{
112+
v1.ResourceCPU: resource.MustParse("500m"),
113+
v1.ResourceMemory: resource.MustParse("256Mi"),
114+
},
115+
},
105116
}},
106117
RestartPolicy: v1.RestartPolicyNever, // don't restart the pod once the command has been executed
107118
},

0 commit comments

Comments
 (0)