Skip to content

Add OpenShift cert requirements#14

Open
bhanvimenghani wants to merge 1 commit into
kruize:mvp_demofrom
bhanvimenghani:bhanvi/helm-chart-certification
Open

Add OpenShift cert requirements#14
bhanvimenghani wants to merge 1 commit into
kruize:mvp_demofrom
bhanvimenghani:bhanvi/helm-chart-certification

Conversation

@bhanvimenghani
Copy link
Copy Markdown

@bhanvimenghani bhanvimenghani commented May 15, 2026

PR Description:

Summary

Adds OpenShift certification requirements to Kruize Helm chart to enable submission to charts.openshift.io.

Changes Made

  • ✅ Added NOTES.txt with post-install instructions for NodePort, LoadBalancer, and ClusterIP
  • ✅ Added Helm test hooks for service health validation
  • ✅ Added required OpenShift annotations to Chart.yaml
  • ✅ All tests pass in Kubernetes cluster (Minikube validated)

Summary by Sourcery

Add OpenShift-specific metadata and Helm test resources to the Kruize chart to support OpenShift chart certification and basic service health verification.

New Features:

  • Add OpenShift chart annotations to the Kruize Helm chart metadata.
  • Add Helm test pod and supporting RBAC resources to validate Kruize service health via the /health endpoint.
  • Add Helm chart NOTES output to guide users on accessing the service after installation.

Tests:

  • Introduce Helm test hooks and resources that check Kruize service reachability and health in the target cluster.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 15, 2026

Reviewer's Guide

Adds OpenShift certification metadata and Helm test infrastructure to the Kruize chart to validate service health and satisfy charts.openshift.io requirements.

Sequence diagram for new Helm test-based service health validation

sequenceDiagram
    actor User
    participant Helm as Helm_CLI
    participant TestPod as Helm_Test_Pod
    participant KruizeSvc as Kruize_Service

    User->>Helm: helm install kruize
    Helm-->>KruizeSvc: Deploy manifests (Chart.yaml, templates)

    User->>Helm: helm test kruize
    Helm->>TestPod: Create test pod (test-connection)
    TestPod->>KruizeSvc: HTTP request for service health
    KruizeSvc-->>TestPod: Health response
    TestPod-->>Helm: Report test status
    Helm-->>User: Display test result
Loading

File-Level Changes

Change Details Files
Add OpenShift-specific chart annotations required for certification.
  • Introduce annotations block to Chart.yaml for OpenShift chart registry metadata
  • Specify chart name, provider, support URL, and supported architectures for charts.openshift.io
charts/kruize/Chart.yaml
Add Helm test pod to validate service reachability and health via NodePort.
  • Define a Helm test Pod that runs under a dedicated test ServiceAccount
  • Install minimal tooling (tar, gzip, kubectl) in the test container at runtime
  • Discover Kruize service NodePort and node IP via kubectl and construct the health endpoint URL
  • Poll the /health endpoint up to 10 times, succeeding on status containing 'UP' and failing otherwise
  • Configure Helm test hooks and hook delete policy on the test Pod
charts/kruize/templates/tests/test-connection.yaml
Define RBAC resources and ServiceAccount for Helm test execution.
  • Create a dedicated ServiceAccount for Helm tests with test hook annotations
  • Create a namespaced Role allowing get/list on services and nodes and bind it via RoleBinding to the test ServiceAccount
  • Create a ClusterRole allowing get/list on services and nodes and bind it via ClusterRoleBinding to the test ServiceAccount
  • Annotate all RBAC resources with Helm test hook and hook-delete-policy
charts/kruize/templates/tests/test-serviceaccount.yaml
charts/kruize/templates/tests/test-role.yaml
charts/kruize/templates/tests/test-rolebinding.yaml
charts/kruize/templates/tests/test-clusterrole.yaml
charts/kruize/templates/tests/test-clusterrolebinding.yaml
Add Helm NOTES template for post-install guidance.
  • Introduce NOTES.txt template to provide post-install instructions (e.g., access patterns for NodePort/LoadBalancer/ClusterIP) for the Kruize release
charts/kruize/templates/NOTES.txt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The Helm test Pod installs tools and downloads kubectl at runtime from the public internet, which can make tests flaky or fail in restricted environments; consider using a pre-built test image that already contains curl/kubectl (or relying on the cluster’s service DNS) instead.
  • The test script assumes a NodePort service and hard-codes access via nodePort, but the chart may also be used with ClusterIP or LoadBalancer; consider making the health check logic branch based on the service type so it works across configurations.
  • RBAC for the test resources grants both Role and ClusterRole permissions over services and nodes; you could tighten this by scoping namespace-level access to a Role and only granting cluster-scoped access (e.g., nodes) where strictly necessary.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Helm test Pod installs tools and downloads kubectl at runtime from the public internet, which can make tests flaky or fail in restricted environments; consider using a pre-built test image that already contains curl/kubectl (or relying on the cluster’s service DNS) instead.
- The test script assumes a NodePort service and hard-codes access via nodePort, but the chart may also be used with ClusterIP or LoadBalancer; consider making the health check logic branch based on the service type so it works across configurations.
- RBAC for the test resources grants both Role and ClusterRole permissions over services and nodes; you could tighten this by scoping namespace-level access to a Role and only granting cluster-scoped access (e.g., nodes) where strictly necessary.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant