getPodFromStandaloneKubelet returns (nil, err) when the kubelet's
/pods endpoint is transiently unreachable, which happens briefly
after a kubelet restart. The post-restart Eventually block
dereferenced pod.Status.StartTime before checking err, so a
transient failure caused a panic instead of a retry.
Reorder the assertions to check err first and guard StartTime
against nil, matching the pattern already used earlier in the
same test and elsewhere in this file.
Ref kubernetes/kubernetes issue 139469
Signed-off-by: Karun Choudhary <karunchoudhary2000@gmail.com>
PR #140023 added framework.WithNodeConformance() to three SIGDescribe
blocks (PLR Pod InPlace Resize, Pod InPlace Resize Init Container,
and Device
Plugin Failures Pod Status). ci-kubernetes-node-e2e-containerd focuses
on [NodeConformance] and only skips Flaky/Slow/Serial, so these tests
started running there unconditionally and pushed the job's runtime
from ~35m to ~55-67m, close to its 65m timeout.
Add framework.WithSlow() to the same blocks so the job's existing
skip="[Flaky]|[Slow]|[Serial]" filter excludes them again.
Tests using only framework.WithFeatureGate() produce [FeatureGate:X] in
their test names, which is not matched by the skip regex [Feature:.+]
used in the unlabelled node e2e job. When these feature gates graduated
to Beta (default=true) in 1.36, the tests started executing in the
unlabelled job instead of being self-skipped at runtime, causing
timeouts.
Add feature.InPlacePodVerticalScaling to:
- pod_level_resources_resize.go (PLR Pod InPlace Resize)
- pod_resize.go (Pod InPlace Resize Init Container)
Add feature.ContainerRestartRules to:
- container_restart_policy.go (both SIGDescribe blocks)
Add feature.DevicePlugin to:
- device_plugin_failures_pod_status_test.go
The hard-coded verbosity in `make test-e2e-node` is 4
(17e2eda611/hack/make-rules/test-e2e-node.sh (L248)).
Pre-pending -v4 emulates that behavior, with the difference that an explicit
-v passed by the caller (typically kubetest2) could be used to override it.
`make test-e2e-node` sets the -results-dir based on the ARTIFACTS Prow job env
variable. When e2e_node.test gets invoked directly, it should do the same,
otherwise JUnit and log files are not captured for the job.
Migrate the kubelet (and the kube-proxy conntrack helper) off the full github.com/google/cadvisor module onto the lean github.com/google/cadvisor/lib: repoint info/v1+info/v2 type usage to lib/model and the manager/fs/cache/etc. consumers to lib/*; regenerate the cadvisor.Interface mocks; keep the kubelet-pinned cAdvisor global flags via lib/cadvisorflags.
go.mod: require + replace github.com/google/cadvisor/lib (=> the dims/cadvisor/lib fork for now, until lib is tagged) and drop the full github.com/google/cadvisor module entirely; keep github.com/containerd/containerd/api at v1.11.0 (matching upstream master); add github.com/google/cadvisor to unwanted-dependencies.json unwantedModules so the full module cannot be re-vendored.
test/e2e_node: the one remaining consumer of the full module -- the node-e2e ResourceCollector, which used the v2 HTTP client (client/v2) + v2 API types (info/v2) -- now scrapes the standalone cAdvisor pod's /api/v2.1/stats directly over HTTP+JSON, so test/e2e_node depends on no cAdvisor package. No change to the kubelet's stats surfaces.
This test verifies that pods with pre-allocated CPUs (from the checkpoint file)
are not rejected after kubelet restart when SMT alignment is enabled.
Regression test for the fix where the container presence check was moved
before the SMT alignment check.
The key is to request enough CPUs so that if pre-allocated CPUs are not
counted, the SMT alignment check would fail due to insufficient available
physical CPUs.
Calculate the maximum SMT-aligned CPUs we can request
We need to request most of the allocatable CPUs to trigger the bug.
Signed-off-by: Talor Itzhak <titzhak@redhat.com>
Update node-problem-detector from v1.34.0 to v1.35.2 and remove all
related addon manifests and install logic that is no longer needed:
- Update version in build/dependencies.yaml, test/e2e_node/image_list.go
and test/kubemark/resources/hollow-node_template.yaml.
- Remove cluster/addons/node-problem-detector/ entirely. No e2e tests
depend on these manifests: e2e_node tests create NPD pods inline and
GCE standalone mode runs NPD as a systemd service.
- Remove install-node-problem-detector function and DEFAULT_NPD_* vars
from cluster/gce/gci/configure.sh along with the conditional that
invoked it, since NPD is no longer installed as a standalone binary
via this script.
- Remove the setup-addon-manifests calls for node-problem-detector from
cluster/gce/gci/configure-helper.sh since the source directory no
longer exists.
- Remove stale refPaths in build/dependencies.yaml that pointed to the
deleted addon files.
Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
This is not usable through "make test-e2e-node", which (while feasible) would
be a bit pointless because the Kubernetes source could would still be needed
for the make rules.
Instead, "kubetest2 noop -test=node" gets extended to invoke `e2e_node.test
remote` with flags that tell e2e_node.test where to find the binaries and
flags that were provided by the caller of kubetest2.
The additional commands (mounter, gcp-credentials-provider) are needed for E2E
node testing. This change makes e2e_node.test entirely self-contained.
Copying the commands' code into separate packages is temporary and only done to
avoid touching them while it is still unclear whether this approach will work
out.
Besides avoiding changes to the build rules, bundling the functionality also has a
slight size advantage: the size of e2e_node.test increases by 10KB, whereas
the other two separate commands would add 10MB.
The caller does not need to enable or disable CGO explicitly, the build rules
do that automatically:
$ make WHAT="cmd/kubelet cluster/gce/gci/mounter"
+++ [0515 17:02:56] Building go targets for linux/amd64
k8s.io/kubernetes/cluster/gce/gci/mounter (static)
k8s.io/kubernetes/cmd/kubelet (non-static)
BuildGo builds the same targets as before. BuildTargets gets changed
to accept a list of targets from the caller, which is a more useful
package API.
The DisableCPUQuotaWithExclusiveCPUs FG is now locked to true,
so we can remove all the tests referring to it.
Some of them were backward compatibility tests - no longer
needed if the FG is locked;
some other tests explicitly set the FG to true - no longer
needed either as the default is true and can't be changed anymore.
Signed-off-by: Francesco Romani <fromani@redhat.com>
DisableCPUQuotaWithExclusiveCPUs is locked to its default (true) since v1.37, so any KubeletConfiguration that sets it to false is rejected and crash-loops the kubelet at startup. configureCPUManagerInKubelet wrote the gate unconditionally and the field defaults to false, so every CPU Manager test that reconfigured the kubelet hit it. Only set the gate when true, and skip the "CFS quota can be disabled" block that exercised the false path.
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Pass a logger into ParseContainerID instead of creating a klog.TODO inside the helper. This lets kubelet, prober, and node e2e call sites use their available contextual logger when container ID parsing fails.