Skip to content

Commit 65adf85

Browse files
authored
Merge pull request #56 from spowelljr/addStartArgs
Add start-args field
2 parents 415b850 + 3942922 commit 65adf85

7 files changed

Lines changed: 226 additions & 214 deletions

File tree

.github/workflows/test.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,48 @@ on: # rebuild any PRs and main branch changes
77
branches:
88
- master
99
- 'releases/*'
10-
1110
jobs:
1211
build: # make sure build/ci work properly
1312
runs-on: ubuntu-latest
1413
steps:
15-
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
16-
- run: |
17-
npm install
18-
npm run all
14+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
15+
- run: |
16+
npm install
17+
npm run all
1918
test: # make sure the action works on a clean machine without building
2019
runs-on: ubuntu-latest
2120
steps:
22-
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
23-
- uses: ./
24-
with:
25-
addons: ingress
26-
27-
# Test that nginx ingress has been enabled
28-
- run: |
29-
minikube addons list | grep 'ingress ' | grep enabled
21+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
22+
- uses: ./
23+
with:
24+
addons: ingress
25+
# Test that nginx ingress has been enabled
26+
- run: |
27+
minikube addons list | grep 'ingress ' | grep enabled
3028
test-extraOptions:
3129
runs-on: ubuntu-latest
3230
steps:
3331
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
3432
- uses: ./
3533
with:
3634
extra-config: 'kubelet.max-pods=10'
37-
3835
# Test that minikube max-pods extraConfig has been set
3936
- run: |
4037
cat ~/.minikube/profiles/minikube/config.json | jq '.KubernetesConfig.ExtraOptions[0].Key' | grep max-pods
4138
test-insecure-registry:
4239
runs-on: ubuntu-latest
4340
steps:
44-
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
41+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
4542
- uses: ./
4643
with:
4744
insecure-registry: '192.168.0.0/16'
48-
4945
# Test that minikube max-pods extraConfig has been set
5046
- run: |
5147
minikube ssh cat /lib/systemd/system/docker.service | grep 192.168.0.0/16
5248
test-featureGatesOptions:
5349
runs-on: ubuntu-latest
5450
steps:
55-
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
51+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
5652
- uses: ./
5753
with:
5854
feature-gates: 'ValidatingAdmissionPolicy=true'

README.md

Lines changed: 61 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
## Basic Usage
77
```
88
steps:
9-
- name: start minikube
10-
id: minikube
11-
uses: medyagh/setup-minikube@latest
9+
- name: start minikube
10+
id: minikube
11+
uses: medyagh/setup-minikube@latest
1212
1313
```
1414

@@ -221,6 +221,15 @@ By default setup-minikube caches the ISO, kicbase, and preload using GitHub Acti
221221
</pre>
222222
</details>
223223

224+
<details>
225+
<summary>start-args (optional)</summary>
226+
<pre>
227+
- default: ''
228+
- value: Any flags you would regularly pass into minikube via CLI
229+
- example: --delete-on-failure --subnet 192.168.50.0
230+
</pre>
231+
</details>
232+
224233
## Example 1:
225234
#### Start Kubernetes on pull request
226235

@@ -233,12 +242,12 @@ jobs:
233242
runs-on: ubuntu-latest
234243
name: job1
235244
steps:
236-
- name: start minikube
237-
id: minikube
238-
uses: medyagh/setup-minikube@latest
239-
# now you can run kubectl to see the pods in the cluster
240-
- name: kubectl
241-
run: kubectl get pods -A
245+
- name: start minikube
246+
id: minikube
247+
uses: medyagh/setup-minikube@latest
248+
# now you can run kubectl to see the pods in the cluster
249+
- name: kubectl
250+
run: kubectl get pods -A
242251
```
243252

244253
## Example 2
@@ -253,25 +262,28 @@ jobs:
253262
runs-on: ubuntu-latest
254263
name: job1
255264
steps:
256-
- name: start minikube
257-
uses: medyagh/setup-minikube@latest
258-
id: minikube
259-
with:
260-
minikube-version: 1.24.0
261-
driver: docker
262-
container-runtime: containerd
263-
kubernetes-version: v1.22.3
264-
cpus: 4
265-
memory: 4000m
266-
cni: bridge
267-
addons: registry,ingress
268-
extra-config: 'kubelet.max-pods=10'
269-
feature-gates: 'DownwardAPIHugePages=true'
270-
mount-path: '/Users/user1/test-files:/testdata'
271-
insecure-registry: localhost:5000,10.0.0.0/24
272-
# now you can run kubectl to see the pods in the cluster
273-
- name: kubectl
274-
run: kubectl get pods -A
265+
- name: start minikube
266+
uses: medyagh/setup-minikube@latest
267+
id: minikube
268+
with:
269+
cache: false
270+
minikube-version: 1.24.0
271+
driver: docker
272+
container-runtime: containerd
273+
kubernetes-version: v1.22.3
274+
cpus: 4
275+
memory: 4000m
276+
cni: bridge
277+
addons: registry,ingress
278+
extra-config: 'kubelet.max-pods=10'
279+
feature-gates: 'DownwardAPIHugePages=true'
280+
mount-path: '/Users/user1/test-files:/testdata'
281+
wait: false
282+
insecure-registry: 'localhost:5000,10.0.0.0/24'
283+
start-args: '--delete-on-failure --subnet 192.168.50.0'
284+
# now you can run kubectl to see the pods in the cluster
285+
- name: kubectl
286+
run: kubectl get pods -A
275287
```
276288

277289
## Example 3:
@@ -286,28 +298,28 @@ jobs:
286298
runs-on: ubuntu-latest
287299
name: build discover and deploy
288300
steps:
289-
- uses: actions/checkout@v2
290-
- name: Start minikube
291-
uses: medyagh/setup-minikube@latest
301+
- uses: actions/checkout@v2
302+
- name: Start minikube
303+
uses: medyagh/setup-minikube@latest
292304
# now you can run kubectl to see the pods in the cluster
293-
- name: Try the cluster!
294-
run: kubectl get pods -A
295-
- name: Build image
296-
run: |
297-
export SHELL=/bin/bash
298-
eval $(minikube -p minikube docker-env)
299-
make build-image
300-
echo -n "verifying images:"
301-
docker images
302-
- name: Deploy to minikube
303-
run:
304-
kubectl apply -f deploy/deploy-minikube.yaml
305-
- name: Test service URLs
306-
run: |
307-
minikube service list
308-
minikube service discover --url
309-
echo -n "------------------opening the service------------------"
310-
curl $(minikube service discover --url)/version
305+
- name: Try the cluster!
306+
run: kubectl get pods -A
307+
- name: Build image
308+
run: |
309+
export SHELL=/bin/bash
310+
eval $(minikube -p minikube docker-env)
311+
make build-image
312+
echo -n "verifying images:"
313+
docker images
314+
- name: Deploy to minikube
315+
run: |
316+
kubectl apply -f deploy/deploy-minikube.yaml
317+
- name: Test service URLs
318+
run: |
319+
minikube service list
320+
minikube service discover --url
321+
echo -n "------------------opening the service------------------"
322+
curl $(minikube service discover --url)/version
311323
```
312324
## Real World:
313325
#### Add your own repo here:

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ inputs:
6969
description: 'Enable insecure communication with the given registries'
7070
required: false
7171
default: ''
72+
start-args:
73+
description: 'Any flags you would regularly pass into minikube via CLI'
74+
required: false
75+
default: ''
7276
runs:
7377
using: 'node16'
7478
main: 'dist/index.js'

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)