Skip to content

feat(helm): support admin client CA bundles - #4423

Open
lachen-nv wants to merge 2 commits into
NVIDIA:mainfrom
lachen-nv:agent/nico-api-admin-root-cert-pem
Open

feat(helm): support admin client CA bundles#4423
lachen-nv wants to merge 2 commits into
NVIDIA:mainfrom
lachen-nv:agent/nico-api-admin-root-cert-pem

Conversation

@lachen-nv

@lachen-nv lachen-nv commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The nico-api runtime supports auth.adminRootCafilePath, and the chart already
mounts the site ConfigMap at the corresponding site directory. The chart did
not, however, provide a supported way to materialize an external admin-client
CA bundle into that ConfigMap. Deployments using an existing user-certificate
PKI therefore needed an out-of-band workaround before admin client
certificates could be trusted.

This change:

  • adds the optional nico-api.siteConfig.adminRootCertPem value;
  • renders it as admin_root_cert_pem in the existing site ConfigMap;
  • validates that the value contains only bare public CERTIFICATE PEM blocks
    and rejects private keys, metadata/comments, malformed or trailing content,
    disabled site config, and paths outside the existing site mounts;
  • documents the TLS trust, default Casbin, and internal-RBAC layers, including
    the CN-only auth.additionalIssuerCns mapping and the requirement to use a
    globally unique dedicated admin-client intermediate; and
  • adds chart unit coverage for single certificates, rotation bundles, both
    supported mount paths, defaults, invalid inputs, CRLF input, and missing
    final newlines.

The value defaults to empty, and the default rendered manifests remain
byte-for-byte unchanged. The existing ConfigMap mount is reused, so this does
not change the Deployment, volumes, or in-cluster service certificate flow.

Related issues

None.

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Validated with:

  • helm unittest --strict -f 'tests/admin_root_cert_test.yaml' helm/charts/nico-api
    (14/14 tests pass)
  • helm lint helm/charts/nico-api
  • helm lint helm
  • helm template nico helm --namespace nico-system
  • a default-render comparison against the unmodified chart (no diff)
  • rendering a real CA file through --set-file and parsing the resulting
    ConfigMap entry with OpenSSL
  • negative renders for private keys, malformed PEM, extra content, invalid
    value types, disabled site config, and unsupported file paths
  • TruffleHog verified-secret scans of the changed chart and documentation

Additional Notes

Adding a CA expands the TLS client trust store. A client certificate accepted
through that store is represented as TrustedCertificate and passes the
chart's default Casbin forge/* rule. With internal RBAC enabled (the default),
admin CLI methods still require the certificate to map to ExternalUser.
additionalIssuerCns is a CN-only classifier across the combined TLS trust
store, not a cryptographic binding to this bundle, so deployments should use a
globally unique dedicated issuing-intermediate CN and keep bypass_rbac
disabled in production.

The Helm validation intentionally checks only the PEM envelope. Operators
remain responsible for validating X.509 CA semantics, chain placement, and
issuance policy before deployment.

A full pre-existing helm unittest helm/charts/nico-api run also reports seven
unrelated failures in certificate_test.yaml: those expectations omit the
already-default carbide-api.forge DNS SAN. This PR does not change
certificate generation, and its focused suite passes.

Signed-off-by: Larry Chen <lachen@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Added Helm configuration for trusting externally issued admin client certificates.
    • Supports single certificates and certificate rotation bundles through siteConfig.adminRootCertPem.
    • Clarified issuer CN mappings and admin CA file path configuration.
  • Bug Fixes

    • Added validation to reject invalid certificate bundles, private keys, metadata, comments, and unsupported paths.
  • Documentation

    • Documented certificate formatting, mounting, trust, authorization behavior, and production restrictions.

Walkthrough

The Helm chart adds siteConfig.adminRootCertPem for public admin client CA bundles. It validates certificate input and paths, renders valid bundles into the site ConfigMap, updates related authentication documentation, and adds Helm template coverage.

Changes

Admin client certificate configuration

Layer / File(s) Summary
Configuration contract
helm/charts/nico-api/values.yaml, helm/PREREQUISITES.md
Defines siteConfig.adminRootCertPem, documents auth.additionalIssuerCns and auth.adminRootCafilePath, and describes certificate trust and authorization requirements.
Validation and ConfigMap rendering
helm/charts/nico-api/templates/_helpers.tpl, helm/charts/nico-api/templates/configmap.yaml
Validates certificate type, path, PEM content, and site configuration enablement. Renders valid bundles as admin_root_cert_pem.
Validation coverage
helm/charts/nico-api/tests/admin_root_cert_test.yaml
Tests default omission, certificate bundles, supported paths, normalization, invalid content, disabled configuration, and non-string values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: Helm support for admin client CA bundles.
Description check ✅ Passed The description accurately explains the feature, validation rules, documentation, testing, and unchanged default manifests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Trivy (0.72.0)

Trivy execution failed: 2026-07-31T03:18:19Z FATAL Fatal error run error: fs scan error: scan error: scan failed: failed analysis: post analysis error: post analysis error: kubernetes scan error: fs filter error: fs filter error: walk error open smartylint.json: no such file or directory: open smartylint.json: no such file or directory


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

Signed-off-by: Larry Chen <lachen@nvidia.com>

Copy link
Copy Markdown
Contributor Author

/ok to test

@mmou-nv mmou-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@lachen-nv
lachen-nv marked this pull request as ready for review July 31, 2026 03:17
@lachen-nv
lachen-nv requested a review from a team as a code owner July 31, 2026 03:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
helm/charts/nico-api/values.yaml (1)

239-270: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Identify the chart defaults in the operator comments.

State that additionalIssuerCns: [] and adminRootCertPem: "" are the chart defaults. This makes the disabled default behavior clear before an operator overrides either value.

As per coding guidelines, “identify chart values as defaults when templates allow overrides.”

🤖 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 `@helm/charts/nico-api/values.yaml` around lines 239 - 270, Update the operator
comments for auth.additionalIssuerCns and siteConfig.adminRootCertPem to
explicitly identify [] and "" as the chart defaults, respectively, while
preserving the existing guidance for overriding either value.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@helm/charts/nico-api/values.yaml`:
- Around line 239-270: Update the operator comments for auth.additionalIssuerCns
and siteConfig.adminRootCertPem to explicitly identify [] and "" as the chart
defaults, respectively, while preserving the existing guidance for overriding
either value.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4e84782b-4e87-4714-8ac5-60aefdcddc77

📥 Commits

Reviewing files that changed from the base of the PR and between 395a11f and 4d5532f.

📒 Files selected for processing (5)
  • helm/PREREQUISITES.md
  • helm/charts/nico-api/templates/_helpers.tpl
  • helm/charts/nico-api/templates/configmap.yaml
  • helm/charts/nico-api/tests/admin_root_cert_test.yaml
  • helm/charts/nico-api/values.yaml

@shayan1995 shayan1995 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Backward-compatible, well-validated, and the trust model caveats are all correctly documented. The existing site ConfigMap mount already covered both paths — this just gives operators a supported way to populate the file. Good to go.

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.

4 participants