Skip to content

feat(podprobe): add gRPC probe support using upstream Kubernetes prober#2336

Open
arnavgogia20 wants to merge 6 commits intoopenkruise:masterfrom
arnavgogia20:feat/podprobe-grpc-support
Open

feat(podprobe): add gRPC probe support using upstream Kubernetes prober#2336
arnavgogia20 wants to merge 6 commits intoopenkruise:masterfrom
arnavgogia20:feat/podprobe-grpc-support

Conversation

@arnavgogia20
Copy link

Summary

This PR adds gRPC probe support to OpenKruise PodProbe, enabling workloads to use native gRPC health checks in addition to existing HTTP and TCP probes.

The implementation reuses the upstream Kubernetes gRPC prober to ensure behavior is consistent with kubelet and avoids duplicating protocol logic.


Why is this needed?

gRPC-based services are increasingly common, and Kubernetes already provides first-class support for gRPC health probes.
However, PodProbe in OpenKruise did not previously support GRPCAction, which limited its usability for modern microservices.

This change closes that gap and improves feature parity with core Kubernetes probing behavior.


Key Changes

Code

  • pkg/daemon/podprobe/prober.go
    • Integrated k8s.io/kubernetes/pkg/probe/grpc into the prober lifecycle
    • Added handling for GRPCAction in runProbe
    • Defaulted Host to PodIP when not explicitly specified
    • Ensured timeout and probe lifecycle behavior match existing HTTP/TCP probes

Tests

  • pkg/daemon/podprobe/prober_test.go
    • Added a mock gRPC health server using google.golang.org/grpc/health
    • Added test cases for:
      • Successful gRPC probe (SERVING)
      • Failed gRPC probe (NOT_SERVING)
    • Verified compatibility with existing probe tests

Behavior Notes / Edge Cases

  • Probe timeout (timeoutSeconds) is fully respected by the gRPC probe path.
  • Context cancellation and failure semantics match existing HTTP/TCP probe behavior.
  • No changes were made to existing probe logic or defaults.

Verification

  • go test -v ./pkg/daemon/podprobe/...
  • All existing and new tests pass
  • No lint or CI issues observed

Related Issue

Closes #2334

- Add 'job7' with empty selector {} to initialJobs
- Expect 'job7' to match all nodes in TestGetActiveJobsForNodeImage
- This reproduces the issue where empty selector was matching nothing

Signed-off-by: Arnav Gogia <arnavgogia404@gmail.com>
Signed-off-by: Arnav Gogia <arnavgogia404@gmail.com>
Signed-off-by: Arnav Gogia <arnavgogia404@gmail.com>
Signed-off-by: Arnav Gogia <arnavgogia404@gmail.com>
@kruise-bot kruise-bot requested a review from veophi January 24, 2026 20:32
@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign furykerry for approval by writing /assign @furykerry in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot kruise-bot requested a review from zmberg January 24, 2026 20:32
@kruise-bot kruise-bot added the size/L size/L: 100-499 label Jan 24, 2026
@codecov
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

❌ Patch coverage is 73.68421% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.75%. Comparing base (30f100e) to head (014dfde).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/control/sidecarcontrol/util.go 62.50% 6 Missing and 3 partials ⚠️
pkg/daemon/podprobe/prober.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2336      +/-   ##
==========================================
+ Coverage   48.54%   48.75%   +0.20%     
==========================================
  Files         324      324              
  Lines       27892    27934      +42     
==========================================
+ Hits        13541    13619      +78     
+ Misses      12821    12772      -49     
- Partials     1530     1543      +13     
Flag Coverage Δ
unittests 48.75% <73.68%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Arnav Gogia <arnavgogia404@gmail.com>
@arnavgogia20 arnavgogia20 force-pushed the feat/podprobe-grpc-support branch from 622fa32 to f4ff503 Compare January 24, 2026 21:00
Signed-off-by: Arnav Gogia <arnavgogia404@gmail.com>
@arnavgogia20 arnavgogia20 force-pushed the feat/podprobe-grpc-support branch from f4ff503 to 014dfde Compare January 25, 2026 11:19
@arnavgogia20
Copy link
Author

Hii @furykerry @veophi @zmberg , Can u please review the PR, thankyouu

@arnavgogia20
Copy link
Author

Hii @furykerry @veophi @zmberg , Can u please review the PR, thankyouu

Hii @furykerry @veophi @zmberg , expecting a quick-review from your end , thankyouu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L size/L: 100-499

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Support gRPC-based liveness/readiness probes in PodProbe

2 participants