Skip to content

Commit

Permalink
Merge pull request #254 from engineerd/chore/revamp-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
radu-matei authored Oct 21, 2024
2 parents 77f76b5 + 30e7a19 commit d984c2e
Showing 1 changed file with 20 additions and 33 deletions.
53 changes: 20 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
Setup [KinD (Kubernetes in Docker)](https://kind.sigs.k8s.io/) with a single
GitHub Action!

> Because of a [deprecation in the GitHub Actions environment][gh-actions-path],
> versions lower than v0.5.0 will no longer work properly. See [this
> issue][path-issue] for more details.
> This action assumes a Linux environment (amd64 or arm64 architecture), and will _not_ work on Windows or
> MacOS agents.
Expand All @@ -19,30 +15,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: engineerd/[email protected]
- uses: engineerd/[email protected]
with:
version: "v0.24.0"
- name: Testing
run: |
kubectl cluster-info
kubectl version
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
```
> Note: KUBECONFIG is automatically merged after cluster creation starting with
> version 0.6 of Kind. See [this document for a detailed migration
> guide][kind-kubeconfig]
This will configure KinD and start a cluster in your local GitHub Action:
```
downloading kind from https://github.com/kubernetes-sigs/kind/releases/download/v0.24.0/kind-linux-amd64
/opt/hostedtoolcache/kind/0.24.0/x64/kind create cluster --name kind --wait 300s
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.31.0) 🖼
✓ Preparing nodes 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
• Installing CNI 🔌 ...
✓ Installing StorageClass 💾
• 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 tools is configured in the path).
cluster (the KinD tool is configured in the path).

Optional inputs:

- `version`: version of Kind to use (default `"v0.11.1"`)
- `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.
Expand All @@ -56,27 +64,6 @@ Optional inputs:
- `verbosity`: numeric log verbosity, (info = 0, debug = 3, trace = 2147483647) (default `"0"`)
- `quiet`: silence all stderr output (default `"false"`)

Example using optional inputs:

```yaml
name: "Create cluster using KinD"
on: [pull_request, push]
jobs:
kind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: engineerd/[email protected]
with:
version: "v0.11.1"
- name: Testing
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
```

[kind-kubeconfig]: https://github.com/kubernetes-sigs/kind/issues/1060
[gh-actions-path]:
Expand Down

0 comments on commit d984c2e

Please sign in to comment.