Skip to content

feat(ngxdig): add Helm chart for the ngxdig eBPF diagnosis agent#315

Merged
nic-6443 merged 7 commits into
mainfrom
feat/ngxdig-chart
Jul 14, 2026
Merged

feat(ngxdig): add Helm chart for the ngxdig eBPF diagnosis agent#315
nic-6443 merged 7 commits into
mainfrom
feat/ngxdig-chart

Conversation

@jarvis9443

@jarvis9443 jarvis9443 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adds a public Helm chart for ngxdig (source: api7/ngx-flame), the eBPF on-CPU flame-graph and CPU/memory/latency diagnosis agent for OpenResty/Nginx.

Because ngxdig profiles the OpenResty/Nginx worker processes running on a node, it is packaged as a DaemonSet (one collector per node), not a plain Deployment — mirroring how node-level eBPF profilers deploy. The chart wires up exactly what the collector needs to work:

  • hostPID: true so the collector sees target worker processes on the node.
  • Container security context granting CAP_BPF / CAP_PERFMON / CAP_SYS_PTRACE, runAsUser: 0, and unconfined seccomp/AppArmor.
  • Read-only hostPath mount of the node's kernel BTF (/sys/kernel/btf), and an emptyDir for run artifacts.
  • The image runs ngxdig ui; a ClusterIP Service exposes the debug UI (reached via kubectl port-forward, since the UI is not a hardened multi-user service).

Default image is api7/ngxdig:latest. Chart is independently versioned (not forked per EE line); added a row to AGENTS.md.

CI: added charts/ngxdig to the existing ct lint and ct install steps in .github/workflows/ci.yaml. Validated locally against a kind v1.31 cluster — ct lint and ct install pass, the DaemonSet Pod becomes Ready, and ngxdig doctor inside the Pod confirms BPF features, kernel BTF, and root are all available (host looks ready).

Summary by CodeRabbit

  • New Features

    • Added the ngxdig Helm chart for deploying a node-level diagnostics collector and debug UI.
    • Added configurable service exposure, scheduling, security, probes, resources, tolerations, and host BTF support.
    • Added guidance for installation, UI access, node targeting, and diagnostic troubleshooting.
  • Documentation

    • Added chart metadata, usage instructions, configuration reference, and deployment notes.
  • Chores

    • Updated CI chart linting and installation checks to include ngxdig.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cea94b6a-6ebd-4f8f-bbf1-b57ec388096c

📥 Commits

Reviewing files that changed from the base of the PR and between 287acac and e48dc10.

📒 Files selected for processing (5)
  • charts/ngxdig/README.md
  • charts/ngxdig/README.md.gotmpl
  • charts/ngxdig/templates/NOTES.txt
  • charts/ngxdig/templates/service.yaml
  • charts/ngxdig/values.yaml
📝 Walkthrough

Walkthrough

A new ngxdig Helm chart is added with DaemonSet, Service, and optional ServiceAccount resources, configurable scheduling and security settings, operational documentation, chart-testing values, and CI coverage for linting and installation.

Changes

ngxdig Helm chart

Layer / File(s) Summary
Chart metadata, defaults, and helpers
charts/ngxdig/.helmignore, charts/ngxdig/Chart.yaml, charts/ngxdig/values.yaml, charts/ngxdig/templates/_helpers.tpl
Defines chart metadata, default collector/UI configuration, scheduling and security options, storage extensions, and reusable naming and labeling helpers.
Kubernetes resources and scheduling
charts/ngxdig/templates/daemonset.yaml, charts/ngxdig/templates/service.yaml, charts/ngxdig/templates/serviceaccount.yaml, charts/ngxdig/ci/ct-values.yaml
Renders the collector DaemonSet, debug UI Service, optional ServiceAccount, and chart-testing toleration settings.
Chart usage and operational documentation
charts/ngxdig/README.md, charts/ngxdig/README.md.gotmpl, charts/ngxdig/templates/NOTES.txt
Documents installation, UI access, node targeting, diagnostics, eBPF readiness, and chart values.
Repository registration and CI coverage
AGENTS.md, .github/workflows/ci.yaml
Registers ngxdig as an independently versioned chart and adds it to Helm lint and installation testing.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Helm
  participant Kubernetes
  participant ngxdig
  Helm->>Kubernetes: Render DaemonSet, Service, and ServiceAccount
  Kubernetes->>ngxdig: Start one collector Pod per node
  ngxdig->>Kubernetes: Expose debug UI through the Service
Loading

Possibly related PRs

Suggested reviewers: nic-6443


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Security Check ❌ Error charts/ngxdig/values.yaml:36-70 ships node-rooted defaults (hostPID, root, CAP_SYS_ADMIN, unconfined seccomp/AppArmor) and the UI Service is always created. Default to least privilege: disable hostPID and CAP_SYS_ADMIN by default, set restrictive seccomp/AppArmor/readOnlyRootFilesystem, and make the UI Service opt-in or network-protected.
E2e Test Quality Review ⚠️ Warning Only ct lint/install smoke-tests the default chart on kind; there’s no automated E2E coverage for UI/service/doctor flow or edge cases. Add a real E2E test that installs ngxdig, verifies Pod readiness, reaches the UI/service, and exercises ngxdig doctor plus key value combinations.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the ngxdig Helm chart.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ngxdig-chart

Comment @coderabbitai help to get the list of available commands.

Comment thread charts/ngxdig/values.yaml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (2)
charts/ngxdig/Chart.yaml (1)

1-6: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Declare or verify the chart’s minimum Kubernetes version.

The defaults render securityContext.appArmorProfile; Kubernetes versions before 1.30 used AppArmor annotations instead. Without a kubeVersion constraint, older clusters may reject or ignore this field and fail to apply the intended runtime configuration. Confirm the supported range, then either declare the minimum version or render a legacy compatibility path. (kubernetes.io)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/ngxdig/Chart.yaml` around lines 1 - 6, Update the ngxdig Helm chart
metadata to explicitly define the supported Kubernetes version range based on
its use of securityContext.appArmorProfile. Set an appropriate kubeVersion
minimum for Kubernetes 1.30+; if older clusters must remain supported, add
conditional rendering for the legacy AppArmor annotation path instead.
charts/ngxdig/README.md.gotmpl (1)

25-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document optional NodePort exposure.

The PR stack adds optional NodePort exposure for the debug UI Service, but this doc only covers the default ClusterIP + port-forward flow. Consider a short section (e.g. --set service.type=NodePort) so users know how to reach the UI without port-forwarding.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/ngxdig/README.md.gotmpl` around lines 25 - 43, Update the “Accessing
the debug UI” section in the README template to document optional NodePort
exposure using the service.type=NodePort configuration and explain how users can
obtain and access the assigned node port. Keep the existing ClusterIP and
port-forward instructions unchanged, and retain the warning that the debug UI
should only be exposed on a trusted network.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yaml:
- Around line 80-81: Update the ct install command’s chart list to include
charts/aisix-cp alongside the existing charts in the workflow, ensuring it
receives install-time validation while preserving the current chart entries.

In `@AGENTS.md`:
- Line 12: Expand the ngxdig entry in AGENTS.md, or add a dedicated ngxdig
section, to document its key capabilities and typical usage patterns while
retaining the existing purpose, chart location, and api7/ngx-flame
source-of-truth details.

In `@charts/ngxdig/README.md`:
- Around line 33-48: The README access guidance should require selecting the
target collector Pod by node rather than using arbitrary `.items[0]` selection.
Update the port-forward command to include the `spec.nodeName=<node>` field
selector, and state that the selector-based ClusterIP Service is
non-node-specific and may load-balance across collector Pods.
- Around line 39-41: Update the README port-forward command’s pod selector to
use the Helm release label app.kubernetes.io/instance=ngxdig, matching the label
used in NOTES.txt, instead of selecting by app.kubernetes.io/name.

In `@charts/ngxdig/templates/daemonset.yaml`:
- Around line 33-60: Update the chart defaults in values.yaml to disable
hostPID, CAP_SYS_ADMIN, and unconfined seccomp/AppArmor settings unless
explicitly opted in, and enable readOnlyRootFilesystem by default. Ensure the
daemonset template continues propagating these security settings through
hostPID, podSecurityContext, and securityContext while preserving user-provided
opt-ins.

In `@charts/ngxdig/values.yaml`:
- Around line 91-101: Make the debug UI Service opt-in by default in the chart’s
service configuration, disabling its creation unless explicitly enabled through
a values key. Update the related deployment/templates and NOTES so they only
reference or expose the Service when enabled, while preserving direct Pod
port-forwarding as the documented alternative.

---

Nitpick comments:
In `@charts/ngxdig/Chart.yaml`:
- Around line 1-6: Update the ngxdig Helm chart metadata to explicitly define
the supported Kubernetes version range based on its use of
securityContext.appArmorProfile. Set an appropriate kubeVersion minimum for
Kubernetes 1.30+; if older clusters must remain supported, add conditional
rendering for the legacy AppArmor annotation path instead.

In `@charts/ngxdig/README.md.gotmpl`:
- Around line 25-43: Update the “Accessing the debug UI” section in the README
template to document optional NodePort exposure using the service.type=NodePort
configuration and explain how users can obtain and access the assigned node
port. Keep the existing ClusterIP and port-forward instructions unchanged, and
retain the warning that the debug UI should only be exposed on a trusted
network.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 548fb512-f613-467d-8855-b1b89faf1eba

📥 Commits

Reviewing files that changed from the base of the PR and between 2ebf1db and 287acac.

📒 Files selected for processing (13)
  • .github/workflows/ci.yaml
  • AGENTS.md
  • charts/ngxdig/.helmignore
  • charts/ngxdig/Chart.yaml
  • charts/ngxdig/README.md
  • charts/ngxdig/README.md.gotmpl
  • charts/ngxdig/ci/ct-values.yaml
  • charts/ngxdig/templates/NOTES.txt
  • charts/ngxdig/templates/_helpers.tpl
  • charts/ngxdig/templates/daemonset.yaml
  • charts/ngxdig/templates/service.yaml
  • charts/ngxdig/templates/serviceaccount.yaml
  • charts/ngxdig/values.yaml

Comment thread .github/workflows/ci.yaml
Comment thread AGENTS.md
Comment thread charts/ngxdig/README.md Outdated
Comment thread charts/ngxdig/README.md Outdated
Comment thread charts/ngxdig/templates/daemonset.yaml
Comment thread charts/ngxdig/values.yaml Outdated
@nic-6443 nic-6443 merged commit b3cb5d8 into main Jul 14, 2026
3 checks passed
@nic-6443 nic-6443 deleted the feat/ngxdig-chart branch July 14, 2026 03:54
@nic-6443 nic-6443 self-assigned this Jul 14, 2026
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.

2 participants