Skip to content

Report crash looping Kelvin and PEM pods as unhealthy data plane pods - #2412

Open
NopeCharon wants to merge 1 commit into
pixie-io:mainfrom
NopeCharon:fix-unhealthy-data-plane-pods
Open

NopeCharon wants to merge 1 commit into
pixie-io:mainfrom
NopeCharon:fix-unhealthy-data-plane-pods

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

Summary: Report crash looping Kelvin and PEM pods as unhealthy data plane pods

The cloud connector sends a sample of unhealthy data plane pods to the cloud, and the UI shows them under "Sample of Unhealthy Data Plane Pods" on the cluster's "Pixie pods" tab. As described in the issue, a crash looping Kelvin never shows up there, and neither does any PEM. K8sVizierInfo.getDataPlaneState() has two problems:

  • A pod counts as unhealthy only if its phase is not Running. A pod whose container is in CrashLoopBackOff keeps the Running phase (see the pod status in the issue), so it is treated as healthy.
  • The loop that adds unhealthy PEMs to the sample breaks when the sample holds <= 10 pods instead of >= 10, so it always exits before adding any PEM.

This PR adds isDataPlanePodHealthy(), which requires the Running phase and every container to be ready, and uses it for both Kelvin and PEM pods. It also fixes the inverted check, so unhealthy PEMs (sorted by name, as before) fill the sample up to the existing limit of 10 pods. Kelvin and PEM have no readiness probes, so a container counts as ready once it is running and has not crashed.

Because the same check is used for the PEM count, the reported number of instrumented nodes no longer includes crash looping PEMs.

To test getDataPlaneState() against a fake clientset, K8sVizierInfo now stores its clientset as kubernetes.Interface instead of *kubernetes.Clientset. NewK8sVizierInfo() still creates the same client.

Relevant Issues: Fixes #2152

Type of change: /kind bug

Test Plan: Added vzinfo_test.go to //src/vizier/services/cloud_connector/bridge:bridge_test. It covers isDataPlanePodHealthy() and runs getDataPlaneState() against a fake clientset with healthy pods, a crash looping Kelvin, crash looping and pending PEMs, and more unhealthy PEMs than the sample limit. On main, the getDataPlaneState() cases with crash looping Kelvin, unhealthy PEMs and the sample limit fail. With this change they pass. go test, go vet and golangci-lint v2.3.1 with the repo's .golangci.yaml are clean for the package.

Changelog Message:

Fixed the cluster details "Pixie pods" tab so that crash looping Kelvin and PEM pods show up as unhealthy data plane pods.

The cloud connector reports a sample of unhealthy data plane pods to the
cloud, which the UI shows on the cluster details "Pixie pods" tab. Two
problems kept crashing pods from ever showing up there:

* A pod was only considered unhealthy if its phase was not Running. A
  pod whose container is in CrashLoopBackOff keeps the Running phase, so
  a crash looping Kelvin or PEM was treated as healthy.
* The loop that adds unhealthy PEMs to the sample broke out as soon as
  the sample held 10 pods or fewer, so no PEM was ever added.

Add isDataPlanePodHealthy(), which requires the Running phase and every
container to be ready, and use it for both Kelvin and PEM pods. Fix the
inverted check so that unhealthy PEMs fill the sample up to its limit of
10 pods. The number of instrumented nodes now only counts PEMs that are
healthy by the same definition.

To make getDataPlaneState() testable, K8sVizierInfo now stores the
clientset as kubernetes.Interface. Add tests that run it against a fake
clientset.

Fixes pixie-io#2152

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
@NopeCharon
NopeCharon requested a review from a team as a code owner October 26, 2026 12:21

This branch is waiting to be deployed

1 waiting deployment
pr-actions-approval — 8375be7a Waiting Oct 26, 2026 by NopeCharon via authorize #3143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pixie UI's cluster details page fails to show unhealthy data plane pods

1 participant