kind-action

helmApache-2.0活跃维护

在 GitHub Actions 里一键拉起 kind 的 Kubernetes 集群,方便跑 Helm chart 测试和 CI 集成验证,不用再手动搭环境。

A GitHub Action for Kubernetes IN Docker - local clusters for testing Kubernetes

v1.15.2发布于 2026-11-04 10:25 UTC383star99fork同步于 2026-11-10 12:00 UTC

怎么上手

由 README 提炼,执行前请确认
- name: Create k8s Kind Cluster
  uses: helm/kind-action@v1
硬件要求按 README 说明

README 未说明显存等硬件要求;集群创建依赖 Docker(需支持 Linux 容器),GitHub 托管 ubuntu-latest 满足;macOS/Windows 托管 runner 无 Linux 容器 Docker,只能 install_only 装二进制。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 GitHub Actions 里用 Docker 起 kind 本地 K8s 集群,给 CI 跑测试用

在 GitHub Actions 里一键拉起 kind 的 Kubernetes 集群,方便跑 Helm chart 测试和 CI 集成验证,不用再手动搭环境。

核心能力

  • 自动安装 kind 与 kubectl 并加入 PATH
  • 按需创建 kind 集群并等待控制面就绪
  • 可配置节点镜像、集群名与 kind 配置文件
  • 可选启用不安全本地镜像仓库并暴露端口
  • 支持 install_only 只装二进制不建集群

容易踩的坑

建集群必须有支持 Linux 容器的 Docker,macOS/Windows runner 上只能设 install_only: true;registry 与 cloud_provider 仅限 Linux,非 Linux 会直接报错;用 config 自定义配置时需自行在节点启用 /etc/containerd/certs.d 才能配合本地仓库;在 job 容器内运行时可能需设 KIND_EXPERIMENTAL_DOCKER_NETWORK 否则 API 连接被拒。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.15.2
  1. v1.15.2最新正式版2026-11-04 · 2026-11-04 10:25 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/helm/kind-action/compare/v1.15.1...v1.15.2

  2. v1.15.12026-10-06 · 2026-10-06 10:01 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/helm/kind-action/compare/v1.15.0...v1.15.1

  3. v1.15.02026-09-02 · 2026-09-02 15:53 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/helm/kind-action/compare/v1.14.0...v1.15.0

  4. v1.14.02026-02-17 · 2026-02-17 14:51 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/helm/kind-action/compare/v1...v1.14.0

  5. v1.13.02025-11-03 · 2025-11-03 10:07 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/helm/kind-action/compare/v1...v1.13.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Kind Action

    A GitHub Action for Kubernetes IN Docker - local clusters for testing Kubernetes using kubernetes-sigs/kind.

    Usage

    Pre-requisites

    Create a workflow YAML file in your .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

    Supported Operating Systems

    The action can install kind and kubectl on Linux, macOS, and Windows runners.

    • Cluster creation requires Docker. kind creates Kubernetes clusters using Docker containers with Linux node images, so a cluster can only be created where Docker (with Linux container support) is available. GitHub-hosted ubuntu-latest runners satisfy this.
    • Hosted macOS and Windows runners do not provide Docker for Linux containers. On these runners use install_only: true to install the kind and kubectl binaries without creating a cluster (the binaries are still added to PATH).
    • registry and cloud_provider are Linux-only. Enabling either on a non-Linux runner fails with a clear error, since they rely on Linux-specific tools and paths (sudo, /etc/hosts, /usr/local/bin, Docker networking).

    Running in a GitHub Actions job container

    When a job runs inside a container, the job container and the kind control-plane container may not share a network. If the cluster is created but API requests fail with connection refused, configure kind to use the job's Docker network and address the control plane by its container name. The job container must already have access to a Docker daemon.

    For example, set the network used by the job container and provide a kind configuration file:

    # kind-config.yaml
    kind: Cluster
    apiVersion: kind.x-k8s.io/v1alpha4
    networking:
      apiServerAddress: "127.0.0.1"
      apiServerPort: 6443
    
    jobs:
      test:
        runs-on: ubuntu-latest
        container:
          image: your-image-with-docker-access
        steps:
          - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
          - uses: helm/[email protected]
            env:
              KIND_EXPERIMENTAL_DOCKER_NETWORK: ${{ job.container.network }}
            with:
              cluster_name: kind
              config: ./kind-config.yaml
          - name: Verify cluster
            run: |
              kubectl config set-cluster kind-kind --server=https://kind-control-plane:6443
              kubectl cluster-info
    

    job.container.network must resolve to the Docker network shared with the runner's Docker daemon. If the runner does not expose that network name, set KIND_EXPERIMENTAL_DOCKER_NETWORK to the network name available to the job container instead. The kubectl config set-cluster command assumes the cluster_name is kind; for another name, use the corresponding kind-<name> context and node container name. The CI workflow exercises this setup in the test-with-job-container job.

    Inputs

    For more information on inputs, see the API Documentation

    • version: The kind version to use (default: v0.33.0)
    • version_file: The path to a file containing the kind version to use. Supports the asdf .tool-versions layout (the kind entry) and plain version files. The version is used as-is, so include the leading v (for example kind v0.33.0). Takes precedence over version when set.
    • config: The path to the kind config file
    • node_image: The Docker image for the cluster nodes
    • cluster_name: The name of the cluster to create (default: chart-testing)
    • wait: The duration to wait for the control plane to become ready (default: 60s)
    • verbosity: info log verbosity, higher value produces more output
    • kubectl_version: The kubectl version to use (default: v1.37.1)
    • registry: Whether to configure an insecure local registry (default: false)
    • registry_image: The registry image to use (default: registry:2)
    • registry_name: The registry name to use (default: kind-registry)
    • registry_port: The local port used to bind the registry (default: 5000)
    • registry_enable_delete: Enable delete operations on the registry (default: false)
    • install_only: Skips cluster creation, only install kind (default: false)
    • ignore_failed_clean: Whether to ignore the post delete cluster action failing (default: false)
    • cloud_provider: Whether to use cloud provider loadbalancer (default: false)

    Example Workflow

    Create a workflow (eg: .github/workflows/create-cluster.yml):

    name: Create Cluster
    
    on: pull_request
    
    jobs:
      create-cluster:
        runs-on: ubuntu-latest
        steps:
          - name: Create k8s Kind Cluster
            uses: helm/kind-action@v1
    

    This uses @helm/kind-action GitHub Action to spin up a kind Kubernetes cluster on every Pull Request. See @helm/chart-testing-action for a more practical example.

    Configuring Local Registry

    Create a workflow (eg: .github/workflows/create-cluster-with-registry.yml):

    name: Create Cluster with Registry
    
    on: pull_request
    
    jobs:
      create-cluster-with-registry:
        runs-on: ubuntu-latest
        steps:
          - name: Kubernetes KinD Cluster
            id: kind
            uses: helm/kind-action@v1
            with:
              registry: true
              registry_name: my-registry
              registry_port: 5001
              registry_enable_delete: true
    

    This configures the cluster to use an insecure local registry at my-registry:5001 and exposes it on the runner host at port 5001. Use localhost:5001 for Docker commands on the runner host, and the LOCAL_REGISTRY output (i.e. ${{ steps.kind.outputs.LOCAL_REGISTRY }}) for image references used by workloads inside the cluster.

    Note: If config option is used, you must manually configure the cluster nodes with registry config dir enabled at /etc/containerd/certs.d. For example:

    kind: Cluster
    apiVersion: kind.x-k8s.io/v1alpha4
    containerdConfigPatches:
    - |-
      [plugins."io.containerd.grpc.v1.cri".registry]
        config_path = "/etc/containerd/certs.d"
    

    Code of conduct

    Participation in the Helm community is governed by the Code of Conduct.