package e2enode
import "k8s.io/kubernetes/test/e2e_node"
Package e2enode contains e2e tests specific to the node
Index ¶
- Constants
- Variables
- func CountSampleDeviceAllocatable(node *v1.Node) int64
- func CountSampleDeviceCapacity(node *v1.Node) int64
- func ExecCommand(name string, c execCommand) []string
- func IsCgroup2UnifiedMode() bool
- func PrePullAllImages(ctx context.Context) error
- func RemoveImage(ctx context.Context, image string) error
- func WaitForPodContainerRestartCount(ctx context.Context, c clientset.Interface, namespace, podName string, containerIndex int, desiredRestartCount int32, timeout time.Duration) error
- func WaitForPodInitContainerRestartCount(ctx context.Context, c clientset.Interface, namespace, podName string, initContainerIndex int, desiredRestartCount int32, timeout time.Duration) error
- func WaitForPodInitContainerToFail(ctx context.Context, c clientset.Interface, namespace, podName string, containerIndex int, reason string, timeout time.Duration) error
- type ResourceCollector
- func NewResourceCollector(interval time.Duration) *ResourceCollector
- func (r *ResourceCollector) GetBasicCPUStats(containerName string) map[float64]float64
- func (r *ResourceCollector) GetCPUSummary() e2ekubelet.ContainersCPUSummary
- func (r *ResourceCollector) GetLatest() (e2ekubelet.ResourceUsagePerContainer, error)
- func (r *ResourceCollector) GetResourceTimeSeries() map[string]*perftype.ResourceSeries
- func (r *ResourceCollector) LogLatest()
- func (r *ResourceCollector) Reset()
- func (r *ResourceCollector) Start()
- func (r *ResourceCollector) Stop()
Constants ¶
const ( // TimeSeriesTag is the tag for time series. TimeSeriesTag = "[Result:TimeSeries]" // TimeSeriesEnd is the end tag for time series. TimeSeriesEnd = "[Finish:TimeSeries]" )
const ( // SampleDevicePluginDSYAML is the path of the daemonset template of the sample device plugin. // TODO: Parametrize it by making it a feature in TestFramework. SampleDevicePluginDSYAML = "test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin.yaml" SampleDevicePluginControlRegistrationDSYAML = "test/e2e/testing-manifests/sample-device-plugin/sample-device-plugin-control-registration.yaml" // SampleDevicePluginName is the name of the device plugin pod SampleDevicePluginName = "sample-device-plugin" // SampleDeviceResourceName is the name of the resource provided by the sample device plugin SampleDeviceResourceName = "example.com/resource" SampleDeviceEnvVarNamePluginSockDir = "PLUGIN_SOCK_DIR" )
const ( // SRIOVDevicePluginCMYAML is the path of the config map to configure the sriov device plugin. SRIOVDevicePluginCMYAML = "test/e2e_node/testing-manifests/sriovdp-cm.yaml" // SRIOVDevicePluginDSYAML is the path of the daemonset template of the sriov device plugin. // TODO: Parametrize it by making it a feature in TestFramework. SRIOVDevicePluginDSYAML = "test/e2e_node/testing-manifests/sriovdp-ds.yaml" // SRIOVDevicePluginSAYAML is the path of the service account needed by the sriov device plugin to run. SRIOVDevicePluginSAYAML = "test/e2e_node/testing-manifests/sriovdp-sa.yaml" // SRIOVDevicePluginName is the name of the device plugin pod SRIOVDevicePluginName = "sriov-device-plugin" )
Variables ¶
var NodePrePullImageList = sets.NewString( imageutils.GetE2EImage(imageutils.Agnhost), "gcr.io/cadvisor/cadvisor:v0.47.2", busyboxImage, "registry.k8s.io/e2e-test-images/busybox@sha256:a9155b13325b2abef48e71de77bb8ac015412a566829f621d06bfae5c699b1b9", imageutils.GetE2EImage(imageutils.Nginx), imageutils.GetE2EImage(imageutils.Perl), imageutils.GetE2EImage(imageutils.Nonewprivs), imageutils.GetPauseImageName(), imageutils.GetE2EImage(imageutils.NodePerfNpbEp), imageutils.GetE2EImage(imageutils.NodePerfNpbIs), imageutils.GetE2EImage(imageutils.Etcd), )
NodePrePullImageList is a list of images used in node e2e test. These images will be prepulled before test running so that the image pulling won't fail in actual test.
var SIGDescribe = framework.SIGDescribe("node")
SIGDescribe annotates the test with the SIG label.
Functions ¶
func CountSampleDeviceAllocatable ¶
CountSampleDeviceAllocatable returns the number of devices of SampleDeviceResourceName advertised by a node allocatable
func CountSampleDeviceCapacity ¶
CountSampleDeviceCapacity returns the number of devices of SampleDeviceResourceName advertised by a node capacity
func ExecCommand ¶
ExecCommand returns the command to execute in the container that implements execCommand and logs activities to a container specific log that persists across container restarts. The final log is written to container log so it can be retrieved by the test harness during the container execution. Log to /proc/1/fd/1 so that the lifecycle hook handler logs are captured as well.
func IsCgroup2UnifiedMode ¶
func IsCgroup2UnifiedMode() bool
IsCgroup2UnifiedMode returns whether we are running in cgroup v2 unified mode.
func PrePullAllImages ¶
PrePullAllImages pre-fetches all images tests depend on so that we don't fail in an actual test.
func RemoveImage ¶
func WaitForPodContainerRestartCount ¶
func WaitForPodContainerRestartCount(ctx context.Context, c clientset.Interface, namespace, podName string, containerIndex int, desiredRestartCount int32, timeout time.Duration) error
WaitForPodContainerRestartCount waits for the given Pod container to achieve at least a given restartCount TODO: eventually look at moving to test/e2e/framework/pod
func WaitForPodInitContainerRestartCount ¶
func WaitForPodInitContainerRestartCount(ctx context.Context, c clientset.Interface, namespace, podName string, initContainerIndex int, desiredRestartCount int32, timeout time.Duration) error
WaitForPodInitContainerRestartCount waits for the given Pod init container to achieve at least a given restartCount TODO: eventually look at moving to test/e2e/framework/pod
func WaitForPodInitContainerToFail ¶
func WaitForPodInitContainerToFail(ctx context.Context, c clientset.Interface, namespace, podName string, containerIndex int, reason string, timeout time.Duration) error
WaitForPodInitContainerToFail waits for the given Pod init container to fail with the given reason, specifically due to invalid container configuration. In this case, the container will remain in a waiting state with a specific reason set, which should match the given reason. TODO: eventually look at moving to test/e2e/framework/pod
Types ¶
type ResourceCollector ¶
type ResourceCollector struct {
// contains filtered or unexported fields
}
ResourceCollector is a collector object which collects resource usage periodically from Cadvisor.
func NewResourceCollector ¶
func NewResourceCollector(interval time.Duration) *ResourceCollector
NewResourceCollector creates a resource collector object which collects resource usage periodically from Cadvisor
func (*ResourceCollector) GetBasicCPUStats ¶
func (r *ResourceCollector) GetBasicCPUStats(containerName string) map[float64]float64
GetBasicCPUStats returns the percentiles the cpu usage in cores for containerName. This method examines all data currently in the buffer.
func (*ResourceCollector) GetCPUSummary ¶
func (r *ResourceCollector) GetCPUSummary() e2ekubelet.ContainersCPUSummary
GetCPUSummary gets CPU usage in percentile.
func (*ResourceCollector) GetLatest ¶
func (r *ResourceCollector) GetLatest() (e2ekubelet.ResourceUsagePerContainer, error)
GetLatest gets the latest resource usage from stats buffer.
func (*ResourceCollector) GetResourceTimeSeries ¶
func (r *ResourceCollector) GetResourceTimeSeries() map[string]*perftype.ResourceSeries
GetResourceTimeSeries gets the time series of resource usage of each container.
func (*ResourceCollector) LogLatest ¶
func (r *ResourceCollector) LogLatest()
LogLatest logs the latest resource usage.
func (*ResourceCollector) Reset ¶
func (r *ResourceCollector) Reset()
Reset clears the stats buffer of resource collector.
func (*ResourceCollector) Start ¶
func (r *ResourceCollector) Start()
Start starts resource collector and connects to the standalone Cadvisor pod then repeatedly runs collectStats.
func (*ResourceCollector) Stop ¶
func (r *ResourceCollector) Stop()
Stop stops resource collector collecting stats. It does not clear the buffer
Source Files ¶
benchmark_util.go checkpoint_container.go container_lifecycle_pod_construction.go doc.go framework.go image_list.go image_volume.go node_problem_detector_linux.go numa_alignment.go pod_host_ips.go pod_ips.go resource_collector.go util.go util_sampledevice.go util_sriov.go util_sriov_linux.go util_xfs_linux.go utils_linux.go
Directories ¶
Path | Synopsis |
---|---|
test/e2e_node/builder | |
test/e2e_node/criproxy | |
test/e2e_node/environment | Build the binary with `go build conformance.go`, then run the conformance binary on a node candidate. |
test/e2e_node/kubeletconfig | |
test/e2e_node/perf | |
test/e2e_node/perftype | |
test/e2e_node/perf/workloads | |
test/e2e_node/plugins | |
test/e2e_node/plugins/gcp-credential-provider | Originally copied from pkg/credentialproviders/gcp |
test/e2e_node/remote | Package remote contains implementations of the TestSuite interface, which specify how to run various node test suites remotely. |
test/e2e_node/remote/gce | |
test/e2e_node/runner | |
test/e2e_node/runner/local | |
test/e2e_node/runner/remote | To run the node e2e tests remotely against one or more hosts on gce: $ go run run_remote.go --v 2 --ssh-env gce --hosts <comma separated hosts> To run the node e2e tests remotely against one or more images on gce and provision them: $ go run run_remote.go --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images> |
test/e2e_node/services | |
test/e2e_node/system | |
test/e2e_node/testdeviceplugin | |
test/e2e_node/testing-manifests |
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 96 packages
- Last checked
- 3 hours ago –
Tools for package owners.