← Back to Pull requests

feat: add reusable create-cluster (Kind) composite action #1072

Open
TrueFurina opened this pull request with 83 lines diff across 2 files
View on GitHub
TrueFurina TrueFurina commented on Aug 27, 2026 12:21 UTC
Author

Summary

Adds a reusable composite action (.github/actions/create-cluster) that spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real cluster instead of each workflow re-implementing the setup inline. This mirrors the pattern already used by sdk and trainer e2e workflows.

Requirements met

  • Composite action with inputs for Kubernetes version and Kind node image (both with sensible defaults)

  • Exports KUBECONFIG (via $GITHUB_ENV) so subsequent steps can talk to the cluster directly

  • Optional cluster name input
  • Changes

  • New file: .github/actions/create-cluster/action.yml
  • Verification

  • YAML follows the composite-action spec (runs.using: composite)

  • Inputs match the issue requirements
  • Diff: 83 lines (+83 / -0) across 2 files Reviewer: juliusvonkohout Review duration: 92505m
    All Vouch review confidence checks passed
    Residual risk 0.04 = Change Risk (0.38) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.38 · 83 lines diff across 2 files
    0.38
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 5 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    88%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.265
    Real PR Conversation Timeline
    24 items
    google-oss-prow[bot] google-oss-prow[bot] commented on Aug 27, 2026 12:21 UTC
    Bot

    [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 juliusvonkohout for approval. For more information see the Kubernetes Code Review Process.

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

    <details open>
    Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["juliusvonkohout"]} -->

    juliusvonkohout juliusvonkohout commented on code on Aug 27, 2026 13:22 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,36 @@
    +name: "Create Kind Cluster"
    +description: >-
    +  Spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real
    +  cluster without each workflow re-implementing the setup inline. Exports
    +  KUBECONFIG so subsequent steps can talk to the cluster directly.
    +inputs:
    +  kubernetes-version:
    +    description: Kubernetes version for the cluster.
    +    required: false
    +    default: v1.31.0

    1.36 please take a look at the workflow in the community distribution as reference

    juliusvonkohout juliusvonkohout commented on code on Aug 27, 2026 13:30 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,36 @@
    +name: "Create Kind Cluster"
    +description: >-
    +  Spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real
    +  cluster without each workflow re-implementing the setup inline. Exports
    +  KUBECONFIG so subsequent steps can talk to the cluster directly.
    +inputs:
    +  kubernetes-version:
    +    description: Kubernetes version for the cluster.
    +    required: false
    +    default: v1.31.0
    tariq-hasan tariq-hasan commented on Sep 08, 2026 05:21 UTC
    Contributor

    Hi @TrueFurina! Checking in to see if you are still working on the PR. There are some pending comments above that needed to be addressed.

    TrueFurina TrueFurina commented on Sep 11, 2026 08:34 UTC
    Author

    Thanks @juliusvonkohout — updated the composite action to Kubernetes 1.37 (kind v0.33.0):

  • Bumped helm/kind-action to v1.15.0.

  • Pinned kind-node-image to kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5 (the v0.33.0 default node image).

  • Fixed the version mapping: version is now the Kind CLI version v0.33.0 (it was previously mistakenly passed the Kubernetes version), and kubectl_version is driven by the kubernetes-version input.

  • Added the referenced kind-config.yaml (single control-plane node) — the action previously pointed at a config file that wasn't committed, which would have failed at runtime.
  • Let me know if you'd prefer a different node-image pin or a multi-node config.

    Copilot Copilot commented on code on Sep 11, 2026 16:49 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,37 @@
    +name: "Create Kind Cluster"
    +description: >-
    +  Spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real
    +  cluster without each workflow re-implementing the setup inline. Exports
    +  KUBECONFIG so subsequent steps can talk to the cluster directly.
    +inputs:
    +  kubernetes-version:
    +    description: Kubernetes version (drives the kubectl version and the pinned node image below).
    +    required: false
    +    default: v1.37.0
    +  kind-node-image:
    +    description: Kind node image (kindest/node) matching kubernetes-version.
    +    required: false
    +    default: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
    +  cluster-name:
    +    description: Name of the Kind cluster.
    +    required: false
    +    default: kind
    +runs:
    +  using: "composite"
    +  steps:
    +    - name: Checkout repository
    +      uses: actions/checkout@v4

    This checkout is an unintended side effect for a reusable composite action: callers of a local action have already checked out the repository, and this step can reset that workspace to the workflow repository/ref, discarding a different checkout or generated files before the caller's next steps. Remove the checkout step and rely on the caller's checkout.

    Copilot Copilot commented on code on Sep 11, 2026 16:49 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,37 @@
    +name: "Create Kind Cluster"
    +description: >-
    +  Spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real
    +  cluster without each workflow re-implementing the setup inline. Exports
    +  KUBECONFIG so subsequent steps can talk to the cluster directly.
    +inputs:
    +  kubernetes-version:
    +    description: Kubernetes version (drives the kubectl version and the pinned node image below).
    +    required: false
    +    default: v1.37.0
    +  kind-node-image:
    +    description: Kind node image (kindest/node) matching kubernetes-version.
    +    required: false
    +    default: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
    +  cluster-name:
    +    description: Name of the Kind cluster.
    +    required: false
    +    default: kind
    +runs:
    +  using: "composite"
    +  steps:
    +    - name: Checkout repository
    +      uses: actions/checkout@v4
    +
    +    - name: Create Kind cluster
    +      uses: helm/kind-action@v1.15.0
    +      with:
    +        cluster_name: ${{ inputs.cluster-name }}
    +        node_image: ${{ inputs.kind-node-image }}
    +        version: v0.33.0
    +        kubectl_version: ${{ inputs.kubernetes-version }}
    +        config: ${{ github.action_path }}/kind-config.yaml
    +
    +    - name: Export KUBECONFIG
    +      shell: bash
    +      run: |
    +        echo "KUBECONFIG=$HOME/.kube/config" >> "$GITHUB_ENV"

    When a job already sets KUBECONFIG, Kind uses that environment variable unless an explicit --kubeconfig is supplied, but this step always exports $HOME/.kube/config. The newly created cluster can therefore be written to one path while subsequent steps read another. Preserve the existing value (or pass and export one explicit path) instead of unconditionally replacing it.

    Copilot Copilot commented on code on Sep 11, 2026 16:49 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,37 @@
    +name: "Create Kind Cluster"
    +description: >-
    +  Spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real
    +  cluster without each workflow re-implementing the setup inline. Exports
    +  KUBECONFIG so subsequent steps can talk to the cluster directly.
    +inputs:
    +  kubernetes-version:
    +    description: Kubernetes version (drives the kubectl version and the pinned node image below).
    +    required: false
    +    default: v1.37.0
    +  kind-node-image:
    +    description: Kind node image (kindest/node) matching kubernetes-version.
    +    required: false
    +    default: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
    +  cluster-name:
    +    description: Name of the Kind cluster.
    +    required: false
    +    default: kind
    +runs:
    +  using: "composite"
    +  steps:
    +    - name: Checkout repository
    +      uses: actions/checkout@v4
    +
    +    - name: Create Kind cluster
    +      uses: helm/kind-action@v1.15.0

    This repository pins third-party Actions to immutable commit SHAs (for example .github/workflows/github-stale.yaml:34), but this mutable tag allows the cluster-creation code to change without a reviewed diff. Pin helm/kind-action to the commit for v1.15.0 and retain the release in a comment.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Sep 11, 2026 16:49 UTC
    Reviewer

    🟡 Changes recommended

    Unresolved findings affect workspace state, kubeconfig handling, Kubernetes-version behavior, and third-party action pinning.

    Once you've addressed the issues Copilot identified, you can request another Copilot review.

    <details>
    <summary>Pull request overview</summary>

    Adds a reusable composite action for creating a Kind Kubernetes cluster in CI.

    Changes:

  • Adds configurable Kubernetes version, node image, and cluster name inputs.

  • Creates a single-control-plane Kind cluster.

  • Exports KUBECONFIG for subsequent workflow steps.

  • Adds Kind cluster configuration.

  • </details>

    <details>
    <summary>File summaries</summary>

    | File | Summary |
    |---|---|
    | .github/actions/create-cluster/action.yml | Defines the reusable cluster setup action. Review findings cover unintended checkout behavior, KUBECONFIG handling, Kubernetes version/image alignment, and pinning the third-party action. |
    | .github/actions/create-cluster/kind-config.yaml | Provides the Kind control-plane configuration. |
    </details>

    <details>
    <summary>Review details</summary>

    Suppressed comments (1)

    .github/actions/create-cluster/action.yml:10

  • kubernetes-version is described as controlling both kubectl and the node image, but its only use is kubectl_version at line 31. If a caller overrides this input without also overriding kind-node-image, the action still creates a v1.37.0 cluster, so the requested Kubernetes version is not what the tests run against. Either derive/validate a matching image or rename and document this input as the kubectl version.

  •   kubernetes-version:
        description: Kubernetes version (drives the kubectl version and the pinned node image below).
        required: false
        default: v1.37.0
    

  • Files reviewed: 2/2 changed files

  • Comments generated: 3

  • Review effort level: Lite (auto)

  • </details>

    [!NOTE]

    Copilot is running an experiment and ran this review at Lite.

    ---

    💡 <a href="/kubeflow/testing/new/master?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=webui#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>

    TrueFurina TrueFurina commented on Sep 12, 2026 20:52 UTC
    Author

    Addressed all three points from the Copilot review, plus the version bump requested earlier.

    1. Removed the self-checkout step. Agreed — a composite action shouldn't reset a workspace it doesn't own. Callers have already checked out the repository, and re-checking could discard a different ref or generated files before the caller's next steps. The action now relies on the caller's checkout.

    2. Pinned helm/kind-action to an immutable commit — 06c1ae10762d3b9c1644e7fe69596ae519e015a2, with # v1.15.0 retained as a comment, matching the convention in .github/workflows/github-stale.yaml.

    3. KUBECONFIG now preserves the caller's value. The export step was unconditionally writing $HOME/.kube/config, so if a job had already exported KUBECONFIG (and Kind honours it unless an explicit --kubeconfig is passed), the cluster would be written to one path while later steps read another. It now re-exports the existing value when set and only falls back to the default location when unset.

    Also carried over from @juliusvonkohout's earlier comments: Kubernetes 1.37 via kind v0.33.0, with kind-config.yaml added (it was referenced but missing, which would have failed at runtime).

    Head is 022c861f. Happy to adjust the KUBECONFIG handling if you'd rather pass one explicit path through to Kind instead.

    juliusvonkohout juliusvonkohout commented on Sep 16, 2026 08:14 UTC
    Contributor

    Please check the failing dco

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Sep 16, 2026 08:15 UTC
    Reviewer

    🟢 Approval recommended

    The implementation is sound, with only a minor input-description clarification identified.

    <details>
    <summary>Review details</summary>

    Suppressed comments (1)

    Previously missed (1) — in code that hasn't changed since the last review.

    .github/actions/create-cluster/action.yml:8

  • This description says the input drives the node image, but it is only passed as kubectl_version; the independently defaulted kind-node-image still determines the cluster's Kubernetes version. A caller overriding only this input could therefore unknowingly create a different server version. Document that this controls the client and that kind-node-image must be changed separately.
  • Files reviewed: 2/2 changed files

  • Comments generated: 0 new

  • Review effort level: Balanced

  • </details>

    TrueFurina TrueFurina commented on Oct 03, 2026 09:41 UTC
    Author

    DCO fix: the branch had 5 commits, none carrying Signed-off-by. Squashed into a single DCO-signed commit on top of current master (tree content unchanged). DCO check should go green now.

    juliusvonkohout juliusvonkohout commented on Oct 09, 2026 09:02 UTC
    Contributor

    Please rebase to master

    Copilot Copilot commented on code on Oct 12, 2026 17:21 UTC
    Code Review
    hack/boilerplate/boilerplate.py:1
    @@ -316,17 +287,6 @@ def parse_args() -> argparse.Namespace:
                 "master). Resolved as origin/<ref> then <ref>."
             ),
         )
    -    parser.add_argument(
    -        "--exclude",
    -        action="append",
    -        default=[],
    -        metavar="REGEX",
    -        help=(
    -            "Skip files whose repository-relative path (forward slashes) "
    -            "matches this Python regular expression, applied with re.search. "
    -            "May be given multiple times."
    -        ),
    -    )
         return parser.parse_args()

    Removing this option breaks the existing public verify-boilerplate action: .github/actions/verify-boilerplate/action.yml:51-61 still exposes exclude, and lines 123-140 still pass each entry as --exclude. Any caller setting that input now fails immediately with argparse's “unrecognized arguments” error instead of running verification. Please restore the parser and exclusion handling (including invalid-pattern validation and stale-pattern warnings), or update the action and documentation atomically if this is an intentional breaking change.

    Copilot Copilot commented on code on Oct 12, 2026 17:21 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,41 @@
    +name: "Create Kind Cluster"

    This new YAML file is missing the mandatory repository boilerplate. YAML/YML files are explicitly checked with the sh template (hack/boilerplate/boilerplate.py:44-60), and README.md:14-16 requires every source file to carry it, so this file will fail the shared verifier. Add the standard header before the action metadata.

    Copilot Copilot commented on code on Oct 12, 2026 17:21 UTC
    Code Review
    .github/actions/create-cluster/kind-config.yaml:1
    @@ -0,0 +1,4 @@
    +kind: Cluster

    This new YAML file also lacks the required boilerplate header. The checker maps .yaml files to boilerplate.sh.txt (hack/boilerplate/boilerplate.py:44-60), so checking this new config reports a header mismatch. Prepend the standard repository header.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 12, 2026 17:21 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟡 Changes recommended

    The new YAML files lack required headers, and removing exclusion support breaks the existing verification action.

    <details open>
    <summary><strong>3 open findings</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> Restore exclude option compatibility in boilerplate verifier · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Add mandatory boilerplate header to new YAML action · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Add required boilerplate header to new YAML file · New

  • </details>

    🧠 Review effort: Balanced

    TrueFurina TrueFurina commented on Oct 24, 2026 13:43 UTC
    Author

    Rebased and re-scoped — the branch is now a single DCO-signed commit on top of current master (da72697), +45/−0 across 2 files: .github/actions/create-cluster/action.yml and kind-config.yaml.

    While redoing the squash I found something that shouldn't have been in this PR at all. The previous revision also reverted hack/boilerplate/boilerplate.py, removing the --exclude option that landed via #1090. Nothing in a Kind-cluster action relates to boilerplate — and since .github/actions/verify-boilerplate/action.yml passes --exclude, merging that revert would have made the boilerplate check fail with an unrecognized-argument error. That revert is dropped; boilerplate.py is now untouched by this PR.

    Contents of the action, for review:

  • helm/kind-action pinned to an immutable SHA (06c1ae1, # v1.15.0 kept as a comment)

  • Kind CLI v0.33.0, Kubernetes default v1.37.0, node image pinned by digest

  • KUBECONFIG is re-exported when the caller already set it, falling back to $HOME/.kube/config only when unset — so later steps never read a different file than Kind wrote

  • kind-config.yaml (single control-plane) is committed; the action referenced it but the file was missing before
  • Happy to adjust the node-image pin, add a multi-node config, or pass an explicit --kubeconfig through to Kind instead — whichever you prefer. Ready for /lgtm whenever convenient.

    juliusvonkohout juliusvonkohout commented on code on Oct 27, 2026 14:30 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,41 @@
    +name: "Create Kind Cluster"
    +description: >-
    +  Spins up a local Kubernetes cluster (Kind) so CI jobs can run against a real
    +  cluster without each workflow re-implementing the setup inline. Exports
    +  KUBECONFIG so subsequent steps can talk to the cluster directly.
    +inputs:
    +  kubernetes-version:
    +    description: Kubernetes version (drives the kubectl version and the pinned node image below).

    [P2] Keep Kubernetes version selection aligned with the node image

    This input is passed only as kubectl_version, while kind-node-image defaults independently to v1.37.0. Overriding only kubernetes-version therefore leaves the API server on v1.37.0, so a Kubernetes version matrix can test the wrong server release. The community-distribution Kind setup used by GitHub Actions derives the default kubectl version from the selected node image. Could we align the two values and verify the resulting server version, or rename this input to kubectl-version and explicitly document the independent image selection?

    juliusvonkohout juliusvonkohout commented on code on Oct 27, 2026 14:30 UTC
    Code Review
    .github/actions/create-cluster/action.yml:1
    @@ -0,0 +1,41 @@
    +name: "Create Kind Cluster"

    [P2] Add the required license headers to both new YAML files

    Both this file and .github/actions/create-cluster/kind-config.yaml lack the mandatory repository boilerplate. Running the current verifier against these exact files reports a header mismatch for the action and a file shorter than the expected header for the cluster configuration. Could we add the standard year-less Apache 2.0 header (Copyright The Kubeflow Authors.) to both files?

    juliusvonkohout juliusvonkohout commented on Oct 27, 2026 14:30 UTC
    Reviewer

    AI-assisted review by GitHub Copilot.

    Two concerns remain: Kubernetes version selection and the missing license headers. The unrelated boilerplate-verifier change has been removed. YAML parsing and four kubeconfig-export scenarios passed; real cluster creation was not tested because Docker is unavailable.

    Kind reference: the community-distribution Kind setup used by GitHub Actions.

    TrueFurina TrueFurina commented on Oct 28, 2026 15:26 UTC
    Author

    Thanks @juliusvonkohout — both points are addressed in df25a71, now a single
    DCO-signed commit rebased on current master (+65/−0 and +18/−0, two files).

    1. Kubernetes version selection. You were right that the version input was decorative:
    kubernetes-version only fed kubectl_version, while the cluster's server version was decided
    by the kind-node-image default. Overriding the version alone still produced a v1.37.0 cluster —
    the exact failure mode this action is meant to prevent.

    The image now follows the version unless it is pinned explicitly:

    kind-node-image:
      default: ""            # was: kindest/node:v1.37.0@sha256:...
    node_image: ${{ inputs.kind-node-image || format('kindest/node:{0}', inputs.kubernetes-version) }}
    

  • default path: kubernetes-version: v1.36.0 → kindest/node:v1.36.0 and kubectl v1.36.0, one input, one version;

  • pinned path: set kind-node-image to tag@sha256:... and it wins, so digest pinning is still available for supply-chain reasons.
  • Both input descriptions now say which one takes precedence.

    2. License headers. Both new YAML files start with the year-less Apache-2.0 header copied
    verbatim from hack/boilerplate/boilerplate.sh.txt. The sh template is the right one here:
    boilerplate.py maps yaml/yml to the sh stem in EXTENSION_TEMPLATES.

    What I did not verify. YAML parses and the headers match the template byte-for-byte, but I
    could not exercise real cluster creation — no Docker on my side either. So this is not evidence
    that the Kind bootstrap works end to end, only that the two review points are gone. If you want
    that covered, a smoke job that creates a cluster with kubernetes-version: v1.36.0 and asserts
    kubectl version would close the gap.

    Assignees
    TrueFurina TrueFurina
    Labels
    risk: low confidence: 88.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.0% (MEDIUM) · Higher = larger blast radius
    38.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88.6% · Lower = rushed or shallow review
    88.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.3% · Safe to merge
    4.3%