Documentation
¶
Index ¶
- func ConfigureHostPathForPodCgroup(pod *v1.Pod)
- func IsPodOnCgroupv2Node(f *framework.Framework, pod *v1.Pod) (result bool)
- func MakeContainerWithResources(name string, r *ContainerResources, command string) v1.Container
- func VerifyCgroupValue(f *framework.Framework, pod *v1.Pod, cName, cgPath string, ...) error
- func VerifyContainerCPULimit(f *framework.Framework, pod *v1.Pod, containerName string, ...) error
- func VerifyContainerCgroupValues(f *framework.Framework, pod *v1.Pod, tc *v1.Container, podOnCgroupv2 bool) error
- func VerifyContainerMemoryLimit(f *framework.Framework, pod *v1.Pod, containerName string, ...) error
- func VerifyOomScoreAdjValue(f *framework.Framework, pod *v1.Pod, cName, expectedOomScoreAdj string) error
- func VerifyPodCgroups(ctx context.Context, f *framework.Framework, pod *v1.Pod, ...) error
- type ContainerResources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPodOnCgroupv2Node ¶
IsPodOnCgroupv2Node checks whether the pod is running on cgroupv2 node. TODO: Deduplicate this function with NPD cluster e2e test: https://github.com/kubernetes/kubernetes/blob/2049360379bcc5d6467769cef112e6e492d3d2f0/test/e2e/node/node_problem_detector.go#L369
func MakeContainerWithResources ¶
func MakeContainerWithResources(name string, r *ContainerResources, command string) v1.Container
func VerifyCgroupValue ¶
func VerifyCgroupValue(f *framework.Framework, pod *v1.Pod, cName, cgPath string, expectedCgValues ...string) error
VerifyCgroupValue verifies that the given cgroup path has the expected value in the specified container of the pod. It execs into the container to retrieve the cgroup value, and ensures that the retrieved cgroup value is equivalent to at least one of the values in expectedCgValues.
func VerifyContainerCPULimit ¶
func VerifyOomScoreAdjValue ¶
func VerifyOomScoreAdjValue(f *framework.Framework, pod *v1.Pod, cName, expectedOomScoreAdj string) error
VerifyOomScoreAdjValue verifies that oom_score_adj for pid 1 (pidof init/systemd -> app) has the expected value in specified container of the pod. It execs into the container, reads the oom_score_adj value from procfs, and compares it against the expected value.
func VerifyPodCgroups ¶
func VerifyPodCgroups(ctx context.Context, f *framework.Framework, pod *v1.Pod, info *ContainerResources) error
VerifyPodCgroups verifies pod cgroup is configured on a node as expected.
Types ¶
type ContainerResources ¶
type ContainerResources struct {
CPUReq string
CPULim string
MemReq string
MemLim string
EphStorReq string
EphStorLim string
ExtendedResourceReq string
ExtendedResourceLim string
}
func BuildPodResourceInfo ¶
func BuildPodResourceInfo(podCPURequestMilliValue, podCPULimitMilliValue, podMemoryLimitInBytes int64) ContainerResources
func (*ContainerResources) ResourceRequirements ¶
func (cr *ContainerResources) ResourceRequirements() *v1.ResourceRequirements