Skip to content

Commit

Permalink
Add Insecure registry configuration (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Dec 15, 2022
1 parent 35b85ac commit 914d0d7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,14 @@ jobs:
# Test that minikube max-pods extraConfig has been set
- run: |
cat ~/.minikube/profiles/minikube/config.json | jq '.KubernetesConfig.ExtraOptions[0].Key' | grep max-pods
test-insecure-registry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- uses: ./
with:
insecure-registry: '192.168.0.0/16'

# Test that minikube max-pods extraConfig has been set
- run: |
minikube ssh cat /lib/systemd/system/docker.service | grep 192.168.0.0/16
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ By default setup-minikube caches the ISO, kicbase, and preload using GitHub Acti
</pre>
</details>

<details>
<summary>insecure-registry (optional)</summary>
<pre>
- default: ''
- value: Any container registry address which is insecure
- example: localhost:5000,10.0.0.0/24
</pre>
</details>

## Example 1:
#### Start Kubernetes on pull request

Expand Down Expand Up @@ -219,6 +228,7 @@ jobs:
cni: bridge
addons: registry,ingress
extra-config: 'kubelet.max-pods=10'
insecure-registry: localhost:5000,10.0.0.0/24
# now you can run kubectl to see the pods in the cluster
- name: kubectl
run: kubectl get pods -A
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ inputs:
description: 'IP Address to use to expose ports (docker and podman driver only)'
required: false
default: ''
insecure-registry:
description: 'Enable insecure communication with the given registries'
required: false
default: ''
runs:
using: 'node16'
main: 'dist/index.js'
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ function setArgs(args) {
{ key: 'memory', flag: '--memory' },
{ key: 'cni', flag: '--cni' },
{ key: 'addons', flag: '--addons' },
{ key: 'insecure-registry', flag: '--insecure-registry' },
{ key: 'extra-config', flag: '--extra-config' },
{ key: 'listen-address', flag: '--listen-address' },
];
Expand Down
1 change: 1 addition & 0 deletions src/minikube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function setArgs(args: string[]) {
{key: 'memory', flag: '--memory'},
{key: 'cni', flag: '--cni'},
{key: 'addons', flag: '--addons'},
{key: 'insecure-registry', flag: '--insecure-registry'},
{key: 'extra-config', flag: '--extra-config'},
{key: 'listen-address', flag: '--listen-address'},
]
Expand Down

0 comments on commit 914d0d7

Please sign in to comment.