Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 book: document how to use Lima on macOS for development #11119

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/book/src/developer/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ You'll need the [docker daemon][docker] v19.03 or newer available.

[docker]: https://docs.docker.com/install/

On MacOS systems using [Lima](https://github.com/lima-vm/lima) is a viable alternative to Docker Desktop.

### A Cluster

You'll likely want an existing cluster as your [management cluster][mcluster].
Expand Down
24 changes: 23 additions & 1 deletion docs/book/src/developer/tilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ workflow that offers easy deployments and rapid iterative builds.

## Prerequisites

1. [Docker](https://docs.docker.com/install/): v19.03 or newer
1. [Docker](https://docs.docker.com/install/): v19.03 or newer (on MacOS e.g. via [Lima](https://github.com/lima-vm/lima))
2. [kind](https://kind.sigs.k8s.io): v0.24.0 or newer
3. [Tilt](https://docs.tilt.dev/install.html): v0.30.8 or newer
4. [kustomize](https://github.com/kubernetes-sigs/kustomize): provided via `make kustomize`
Expand Down Expand Up @@ -507,6 +507,28 @@ syntax highlighting and auto-formatting. To enable it for Tiltfile a file associ

NB: The socket defined by `DOCKER_HOST` is used only for the `hack/tools/internal/tilt-prepare` command, the image build is running the `podman build`/`podman push` commands.

## Using Lima

[Lima] can be used instead of Docker Desktop. Please note that especially with CAPD the rootless template of Lima does not work.

The following command creates a working Lima machine for developing Cluster API with CAPD:

```bash
limactl start template://docker-rootful --name "docker" --tty=false \
--set '.provision += {"mode":"system","script":"#!/bin/bash\nset -eux -o pipefail\ncat << EOF > \"/etc/sysctl.d/99-capi.conf\"\nfs.inotify.max_user_watches = 1048576\nfs.inotify.max_user_instances = 8192\nEOF\nsysctl -p \"/etc/sysctl.d/99-capi.conf\""}' \
--set '.mounts[0] = {"location": "~", "writable": true}' \
--memory 12 --cpus 10 --disk 64 \
--vm-type vz --rosetta=true
```

After creating the Lima machine we need to set `DOCKER_HOST` to the correct path:

```bash
export DOCKER_HOST=$(limactl list "docker" --format 'unix://{{.Dir}}/sock/docker.sock')
```

[Lima]: https://github.com/lima-vm/lima

## Troubleshooting Tilt

### Tilt is stuck
Expand Down
Loading