You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default setup-minikube caches the ISO, kicbase, and preload using GitHub Action Cache, if you'd like to disable this caching add the following to your workflow file.
- default: latest
- options:
- version in format of 'X.X.X'
- 'latest' for the latest stable release
- 'HEAD' for the latest development build
- example: 1.24.0
driver (optional)
- default: '' (minikube will auto-select)
- options:
- docker
- none (baremetal)
- virtualbox (available on macOS free agents)
- also possible if installed on self-hosted agent: podman, parallels, vmwarefusion, hyperkit, vmware, ssh
- default: stable
- options:
- 'stable' for the latest stable Kubernetes version
- 'latest' for the Newest Kubernetes version
- 'vX.X.X'
- example: v1.23.1
cpus (optional)
- default: '' (minikube will auto-set)
- options:
- ''
- 'max' to use the maximum available CPUs
- example: 4
memory (optional)
- default: '' (minikube will auto-set)
- options:
- '' where unit = b, k, m or g
- 'max' to use the maximum available memory
- example: 4000m
- default: ''
- value: Any extra config fields (see [docs](https://minikube.sigs.k8s.io/docs/handbook/config/#kubernetes-configuration))
feature-gates (optional)
- default: ''
- value: Enable feature gates in API service (see [docs](https://minikube.sigs.k8s.io/docs/handbook/config/#enabling-feature-gates))
listen-address (optional)
- default: ''
- value: IP Address to use to expose ports (docker and podman driver only)
mount-path (optional)
- default: ''
- value: Mount the source directory from your host into the target directory inside the cluster (format: :)
install-path (optional)
- default: ''
- value: Path where the executables (minikube) will get installed. Useful when having multiple self-hosted runners on one machine.
insecure-registry (optional)
- default: ''
- value: Any container registry address which is insecure
- example: localhost:5000,10.0.0.0/24
start-args (optional)
- default: ''
- value: Any flags you would regularly pass into minikube via CLI
- example: --delete-on-failure --subnet 192.168.50.0
Example 1:
Start Kubernetes on pull request
name: CI
on:
- pull_request
jobs:
job1:
runs-on: ubuntu-latest
name: job1
steps:
- name: start minikube
id: minikube
uses: medyagh/setup-minikube@latest
# now you can run kubectl to see the pods in the cluster
- name: kubectl
run: kubectl get pods -A
Example 2
Start Kubernetes using all configuration options
name: CI
on:
- pull_request
jobs:
job1:
runs-on: ubuntu-latest
name: job1
steps:
- name: start minikube
uses: medyagh/setup-minikube@latest
id: minikube
with:
cache: false
minikube-version: 1.24.0
driver: docker
container-runtime: containerd
kubernetes-version: v1.22.3
cpus: 4
memory: 4000m
cni: bridge
addons: registry,ingress
extra-config: 'kubelet.max-pods=10'
feature-gates: 'DownwardAPIHugePages=true'
mount-path: '/Users/user1/test-files:/testdata'
wait: false
insecure-registry: 'localhost:5000,10.0.0.0/24'
start-args: '--delete-on-failure --subnet 192.168.50.0'
# now you can run kubectl to see the pods in the cluster
- name: kubectl
run: kubectl get pods -A
Example 3:
Build image and deploy to Kubernetes on pull request
name: CI
on:
- push
- pull_request
jobs:
job1:
runs-on: ubuntu-latest
name: build discover and deploy
steps:
- uses: actions/checkout@v4
with:
repository: medyagh/local-dev-example-with-minikube
- name: Start minikube
uses: medyagh/setup-minikube@latest
# now you can run kubectl to see the pods in the cluster
- name: Try the cluster!
run: kubectl get pods -A
- name: Build image
run: |
minikube image build -t local/devex:v1 .
- name: Deploy to minikube
run: |
kubectl apply -f deploy/k8s.yaml
kubectl wait --for=condition=ready pod -l app=local-devex
- name: Test service URLs
run: |
minikube service list
minikube service local-devex-svc --url
echo -n "------------------opening the service------------------"
curl $(minikube service local-devex-svc --url)/version
setup-minikube is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.
setup-minikube is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.