3
3
Setup [ KinD (Kubernetes in Docker)] ( https://kind.sigs.k8s.io/ ) with a single
4
4
GitHub Action!
5
5
6
- > Because of a [ deprecation in the GitHub Actions environment] [ gh-actions-path ] ,
7
- > versions lower than v0.5.0 will no longer work properly. See [ this
8
- > issue] [ path-issue ] for more details.
9
-
10
6
> This action assumes a Linux environment (amd64 or arm64 architecture), and will _ not_ work on Windows or
11
7
> MacOS agents.
12
8
@@ -19,30 +15,42 @@ jobs:
19
15
runs-on : ubuntu-latest
20
16
steps :
21
17
- uses : actions/checkout@master
22
- - uses : engineerd/setup-kind@v0.5.0
18
+ - uses : engineerd/setup-kind@v0.6.0
19
+ with :
20
+ version : " v0.24.0"
23
21
- name : Testing
24
22
run : |
25
23
kubectl cluster-info
24
+ kubectl version
26
25
kubectl get pods -n kube-system
27
- echo "current-context:" $(kubectl config current-context)
28
- echo "environment-kubeconfig:" ${KUBECONFIG}
29
26
` ` `
30
27
31
- > Note: KUBECONFIG is automatically merged after cluster creation starting with
32
- > version 0.6 of Kind. See [this document for a detailed migration
33
- > guide][kind-kubeconfig]
28
+ This will configure KinD and start a cluster in your local GitHub Action:
29
+
30
+ ` ` `
31
+ downloading kind from https://github.com/kubernetes-sigs/kind/releases/download/v0.24.0/kind-linux-amd64
32
+ /opt/hostedtoolcache/kind/0.24.0/x64/kind create cluster --name kind --wait 300s
33
+ Creating cluster "kind" ...
34
+ ✓ Ensuring node image (kindest/node:v1.31.0) 🖼
35
+ ✓ Preparing nodes 📦
36
+ ✓ Writing configuration 📜
37
+ ✓ Starting control-plane 🕹️
38
+ • Installing CNI 🔌 ...
39
+ ✓ Installing StorageClass 💾
40
+ • Ready after 17s 💚
41
+ ```
34
42
35
43
> Note: GitHub Actions workers come pre-configured with ` kubectl ` .
36
44
37
45
The following arguments can be configured on the job using the ` with ` keyword
38
46
(see example above). Currently, possible inputs are all the flags for
39
47
` kind cluster create ` , with the additional version, which sets the Kind version
40
48
to download and ` skipClusterCreation ` , which when present, skips creating the
41
- cluster (the Kind tools is configured in the path).
49
+ cluster (the KinD tool is configured in the path).
42
50
43
51
Optional inputs:
44
52
45
- - `version` : version of Kind to use (default `"v0.11.1 "`)
53
+ - ` version ` : version of Kind to use (default ` "v0.24.0 " ` )
46
54
- ` config ` : path (relative to the root of the repository) to a kind config file.
47
55
If omitted, a default 1-node cluster will be created
48
56
- ` image ` : node Docker image to use for booting the cluster.
@@ -56,27 +64,6 @@ Optional inputs:
56
64
- ` verbosity ` : numeric log verbosity, (info = 0, debug = 3, trace = 2147483647) (default ` "0" ` )
57
65
- ` quiet ` : silence all stderr output (default ` "false" ` )
58
66
59
- Example using optional inputs :
60
-
61
- ` ` ` yaml
62
- name: "Create cluster using KinD"
63
- on: [pull_request, push]
64
-
65
- jobs:
66
- kind:
67
- runs-on: ubuntu-latest
68
- steps:
69
- - uses: actions/checkout@master
70
- - uses: engineerd/setup-kind@v0.5.0
71
- with:
72
- version: "v0.11.1"
73
- - name: Testing
74
- run: |
75
- kubectl cluster-info
76
- kubectl get pods -n kube-system
77
- echo "current-context:" $(kubectl config current-context)
78
- echo "environment-kubeconfig:" ${KUBECONFIG}
79
- ` ` `
80
67
81
68
[ kind-kubeconfig ] : https://github.com/kubernetes-sigs/kind/issues/1060
82
69
[ gh-actions-path] :
0 commit comments