generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from engineerd/chore/revamp-readme
- Loading branch information
Showing
1 changed file
with
20 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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. | ||
|
@@ -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]: | ||
|