Home

Awesome

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.

Inputs

For more information on inputs, see the API Documentation

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 will configure the cluster with an insecure local registry at my-registry:5001 on both the host and within cluster. Subsequent steps can refer to the registry address with the output of the kind setup step (i.e. ${{ steps.kind.outputs.LOCAL_REGISTRY }}).

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.