https://github.com/tilt-dev/minikube-local
The best way to set minikube up for local development
https://github.com/tilt-dev/minikube-local
Last synced: about 1 year ago
JSON representation
The best way to set minikube up for local development
- Host: GitHub
- URL: https://github.com/tilt-dev/minikube-local
- Owner: tilt-dev
- License: apache-2.0
- Archived: true
- Created: 2020-09-16T23:00:30.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-03T13:38:29.000Z (about 3 years ago)
- Last Synced: 2025-03-11T10:48:19.483Z (over 1 year ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 9
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minikube-local
## UPDATE(2023-04-03)
As of Minikube 1.26, this script no longer works, due to [upstream breaking API changes](https://github.com/tilt-dev/ctlptl/issues/239).
Please migrate to [ctlptl](http://github.com/tilt-dev/ctlptl), which checks
the version of Minikube and uses the right config.
This repo will be archived for posterity.
---
The best way to set minikube up for local development
[](https://circleci.com/gh/tilt-dev/minikube-local)
When using Tilt with a [Minikube](https://minikube.sigs.k8s.io/docs/) cluster,
we recommend using a local registry for faster image pushing and pulling.
This repo documents the best way to set it up.
## Why use Minikube with a local registry?
Minikube offers many different ways to get your app into the cluster.
Using a local registry is the best method for iterative app development.
- Unlike with a remote registry, the image stays local to your machine, with no
network traffic to wait on or credentials to setup.
- Unlike with an in-cluster builder, you can reset the cluster without deleting
the image cache.
- Unlike with loading into the container runtime, docker will skip pushing any
layers that already exist in the registry.
Over all these approaches, a local registry has good speed, incremental caching,
and few footguns. But setting it up is awkward and fiddly. This script makes it
easy.
## How to Try It
1) Install [Minikube](https://minikube.sigs.k8s.io/docs/)
2) Copy the [minikube-with-registry.sh](minikube-with-registry.sh) script somewhere on your path.
3) Create a cluster with `minikube-with-registry.sh`. Currently it creates the registry at port 5000.
```
minikube-with-registry.sh
```
4) Try pushing an image.
```
docker tag alpine localhost:5000/alpine
docker push localhost:5000/alpine
```
You can now use the image name `localhost:5000/alpine` in any resources you deploy to the cluster.
[Tilt](https://tilt.dev) will automatically detect the local registry created by this script.
## Thanks to
High five to [MicroK8s](https://github.com/ubuntu/microk8s) for the initial local registry feature
that inspired a lot of this work.
The Kind team ran with this, writing up documentation and hooks for how to [set up a local registry](https://kind.sigs.k8s.io/docs/user/local-registry/) with Kind.
This repo adapts the Kind team's approach and applies the local registry configmap, so that tools
like Tilt can discover the local-registry. This protocol is a [Kubernetes Enhancement Proposal](https://github.com/kubernetes/enhancements/issues/1755).
## License
Copyright 2020 Windmill Engineering
Licensed under [the Apache License, Version 2.0](LICENSE)