项目作者: engineerd

项目描述 :
kind (Kubernetes in Docker) GitHub Action
高级语言: TypeScript
项目地址: git://github.com/engineerd/setup-kind.git
创建时间: 2019-08-21T13:16:50Z
项目社区:https://github.com/engineerd/setup-kind

开源协议:MIT License

下载


@engineerd/setup-kind

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

This action assumes a Linux environment (amd64 or arm64 architecture), and will not work on Windows or
MacOS agents.

  1. name: "Create cluster using KinD"
  2. on: [pull_request, push]
  3. jobs:
  4. kind:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - uses: actions/checkout@master
  8. - uses: engineerd/setup-kind@v0.6.0
  9. with:
  10. version: "v0.24.0"
  11. - name: Testing
  12. run: |
  13. kubectl cluster-info
  14. kubectl version
  15. kubectl get pods -n kube-system

This will configure KinD and start a cluster in your local GitHub Action:

  1. downloading kind from https://github.com/kubernetes-sigs/kind/releases/download/v0.24.0/kind-linux-amd64
  2. /opt/hostedtoolcache/kind/0.24.0/x64/kind create cluster --name kind --wait 300s
  3. Creating cluster "kind" ...
  4. Ensuring node image (kindest/node:v1.31.0) 🖼
  5. Preparing nodes 📦
  6. Writing configuration 📜
  7. Starting control-plane 🕹️
  8. Installing CNI 🔌 ...
  9. Installing StorageClass 💾
  10. Ready after 17s 💚

Note: GitHub Actions workers come pre-configured with kubectl.

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 download and skipClusterCreation, which when present, skips creating the
cluster (the KinD tool is configured in the path).

Optional inputs:

  • version: version of Kind to use (default "v0.24.0")
  • 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 name (default "kind")
  • wait: wait for control plane node to be ready (default "300s")
  • kubeconfig: sets kubeconfig path instead of $KUBECONFIG or $HOME/.kube/config
  • skipClusterCreation: if "true", the action will not create a cluster, just
    acquire the tools
  • skipClusterDeletion: if "true", the action will not delete the cluster
  • skipClusterLogsExport: if "true", the action will not export the cluster logs
  • verbosity: numeric log verbosity, (info = 0, debug = 3, trace = 2147483647) (default "0")
  • quiet: silence all stderr output (default "false")

[gh-actions-path]:
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/