An open API service indexing awesome lists of open source software.

https://github.com/tilt-dev/k3d-local-registry

Easy set-up (via k3d) for k3s cluster with local registry for use with Tilt
https://github.com/tilt-dev/k3d-local-registry

Last synced: 11 months ago
JSON representation

Easy set-up (via k3d) for k3s cluster with local registry for use with Tilt

Awesome Lists containing this project

README

          

# k3d-local-registry

## UPDATE(2023-05-02)

As of k3d v4.0, k3d has a built-in local registry.

Tilt-team has worked with K3d team to ensure that the built-in registry supports all the same
auto-discovery features as this script. You no longer need this script.

For instructions, see [Using a Local Registry](https://k3d.io/v5.4.9/usage/registries/#using-a-local-registry).

We can also use [ctlptl](http://github.com/tilt-dev/ctlptl), which implements a more declarative
approach to setting up local clusters.

This repo will be archived for posterity.

---

## Why

When using Tilt with a [k3s](https://k3s.io/) cluster, we recommend using a local registry for faster image pushing and pulling.

This repo provides a script to help you set up your cluster (via [k3d](https://github.com/rancher/k3d/))
with a local image registry that Tilt can auto-detect, so you don't need to do any additional configuration,
and Tilt knows where to push/pull your images to/from.

## How to Try It

1) Install [k3d](https://github.com/rancher/k3d/) (note: these instructions require **k3d v1.x**)

2) Copy the [k3d-with-registry.sh](k3d-with-registry.sh) script somewhere on your path.

3) Create a cluster with `k3d-with-registry.sh`. Currently it uses the default registry name `registry.local` and default port `5000`.

```
k3d-with-registry.sh
```

4) Verify your registry:

```
docker pull nginx:latest
docker tag nginx:latest localhost:5000/nginx:latest
docker push localhost:5000/nginx:latest
```

Set your KUBECONFIG as specified in script output (e.g. `export KUBECONFIG="$(k3d get-kubeconfig --name='diffname')"`)
and try spinning up a pod that references an image in your registry:

```
cat <