Skip to content
KinD (Kubernetes in Docker) GitHub Action
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
docs
src
test
.gitignore
LICENSE
README.md
action.yml
package-lock.json
package.json
tsconfig.json

README.md

@engineerd/setup-kind

Setup KinD (Kubernetes in Docker) with a single GitHub Action!

This action assumes a Linux environment, and will not work on Windows or MacOS.

name: "Create cluster using KinD"
on: [pull_request, push]

jobs:
  kind:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: engineerd/setup-kind@v0.1.0
    - name: Testing
      run: |
        export KUBECONFIG="$(kind get kubeconfig-path)"
        kubectl cluster-info
        kubectl get pods -n kube-system

Note: environment variables are not persisted, so the first step in your job should be export KUBECONFIG="$(kind get kubeconfig-path)". Note: GitHub Actions workers come pre-configured with kubectl version 1.15.1.

The following arguments can be configured on the job using the with keyword (see example above). Currently, possible inputs are all the flags for kind cluster create, with the additional version, which sets the Kind version to downloadm and skipClusterCreation, which when present, skips creating the cluster (the Kind tools is configured in the path).

Optional inputs:

  • version: version of Kind to use (default "v0.5.1")
  • config: path (relative to the root of the repository) to a kind config file. If omitted, a default 1-node cluster will be created
  • image: node Docker image to use for booting the cluster.
  • name: cluster context name (default "kind")
  • wait: wait for control plane node to be ready (default "300s")
  • skipClusterCreation: if "true", the action will not create a cluster, just acquire the tools

Example using optional inputs:

name: "Create cluster using KinD"
on: [pull_request, push]

jobs:
  kind:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: engineerd/setup-kind@v0.1.0
        with:
            version: "v0.5.0"        
    - name: Testing
      run: |
        export KUBECONFIG="$(kind get kubeconfig-path)"
        kubectl cluster-info
        kubectl get pods -n kube-system



You can’t perform that action at this time.